CN108133031B - Method and device for filtering recommended video candidate result - Google Patents

Method and device for filtering recommended video candidate result Download PDF

Info

Publication number
CN108133031B
CN108133031B CN201711486750.4A CN201711486750A CN108133031B CN 108133031 B CN108133031 B CN 108133031B CN 201711486750 A CN201711486750 A CN 201711486750A CN 108133031 B CN108133031 B CN 108133031B
Authority
CN
China
Prior art keywords
video
recommended
bloom filter
user
filtered
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
CN201711486750.4A
Other languages
Chinese (zh)
Other versions
CN108133031A (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 Sohu New Media Information Technology Co Ltd
Original Assignee
Beijing Sohu New Media Information 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 Sohu New Media Information Technology Co Ltd filed Critical Beijing Sohu New Media Information Technology Co Ltd
Priority to CN201711486750.4A priority Critical patent/CN108133031B/en
Publication of CN108133031A publication Critical patent/CN108133031A/en
Application granted granted Critical
Publication of CN108133031B publication Critical patent/CN108133031B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/73Querying
    • G06F16/735Filtering based on additional data, e.g. user or group profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the invention discloses a method and a device for filtering recommended video candidate results, which are characterized by receiving a video recommendation service call request which is sent by a user and comprises a user Identification (ID), and determining a first bloom filter example which comprises a system history recommended video and a second bloom filter example which comprises a recommended video consumed by the user history and corresponds to the user ID from a Redis database; determining a video to be filtered from the recommended video candidate result; and inquiring whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, determining that the video to be filtered is the video to be recommended, adding the video to be filtered to the first bloom filter instance, and if not, determining that the video to be filtered is not recommended. Based on the method and the device, the accuracy and efficiency of filtering the system history recommended videos and the recommended videos historically consumed by the user in the recommended video candidate results can be improved.

Description

Method and device for filtering recommended video candidate result
Technical Field
The invention relates to the technical field of video recommendation, in particular to a method and a device for filtering and recommending video candidate results.
Background
In the video recommendation system, a result finally recommended to a user needs to be obtained from recommended video candidate results calculated by a recommendation engine. According to specific demand scenarios, the video recommendation system user should recommend different video results every time the video recommendation system user refreshes the video data, and recommended videos that the user has watched or collected, praise and the like and consumed should not be continuously recommended to the user, so that data that are not repeated with the system history recommended videos and the recommended videos that the user has historically consumed need to be efficiently selected from recommended video candidate results every time the video recommendation service is invoked.
The video recommendation systems currently implemented in the industry all need to solve the problem of filtering system history recommendation videos and recommendation videos historically consumed by users in recommendation video candidate results. At present, the conventional scheme for solving the problems is to store all system history recommended videos and recommended videos historically consumed by users in a data set stored in a Redis database, then judge whether candidate recommended videos in recommended video candidate results exist in the data set one by one, and if the candidate recommended videos exist, do not recommend the candidate recommended videos.
However, in the prior art, as the time for a user to use the video recommendation system increases, the number of times that the user invokes the recommendation service of the video recommendation system and the number of times that the user plays and collects the consumed recommended video behaviors are correspondingly increased, and the number of bits of the video ID is very long, so that the storage space of the Redis database occupied by the data set is more and more huge. The data structure of the Redis database is based on a hash algorithm, that is, the storage structure of the data set is based on a hash function, and the hash function has hash collision under the condition of large data volume, so that when the storage space of the Redis database occupied by the data set is too large, the accuracy of filtering the system history recommended videos and the recommended videos consumed by the users in the recommended video candidate results is low.
In addition, there are often a plurality of candidate video recommendations in the recommended video candidate results, and since the data set is stored in the Redis database, and it is determined one by one whether the candidate recommended video in the recommended video candidate results already exists in the data set, an operation function of the Redis database needs to be called many times, which may result in a low efficiency of filtering the system history recommended video and the recommended video consumed by the user history in the recommended video candidate results.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for filtering recommended candidate results, which can solve the problems of low accuracy and low efficiency in filtering a system history recommended video and a recommended video historically consumed by a user in recommended video candidate results in the prior art.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a method of filtering recommended video candidates, comprising:
receiving a video recommendation service call request sent by a user, wherein the video recommendation service call request comprises a user Identification (ID);
determining a first bloom filter instance containing system history recommended videos and a second bloom filter instance containing recommended videos historically consumed by a user, which correspond to the user ID, from a Redis database;
determining a video to be filtered from the recommended video candidate result;
and inquiring whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, determining that the video to be filtered is the video to be recommended, adding the video to be filtered to the first bloom filter instance, and if not, determining that the video to be filtered is not recommended.
Optionally, after determining that the video to be filtered is a video to be recommended, and adding the video to be filtered to the first bloom filter instance, the method further includes:
and judging whether the number of the system history recommended videos included in the first bloom filter instance reaches a first preset threshold value, and if so, resetting the first bloom filter instance.
Optionally, the video recommendation service invocation request includes a number of videos requested to be recommended by a user, and after the video to be filtered is determined to be a video to be recommended and is added to the first bloom filter instance, the method further includes:
judging whether the number of videos recommended to the user is larger than the number of videos requested to be recommended by the user, if not, returning to execute the step of determining the videos to be filtered from the recommended video candidate results and executing the steps in sequence until the frequency of determining the videos to be filtered from the recommended video candidate results reaches a second preset threshold value, and generating a final video recommendation result and sending the final video recommendation result to the user; and if so, directly generating a final video recommendation result and sending the final video recommendation result to the user.
Optionally, after generating a final video recommendation result and sending the final video recommendation result to the user, the method further includes:
monitoring the consumption events of the user on the recommended videos in the final video recommendation result;
and when the consumption event of the user to any recommended video in the final video recommendation results is monitored, adding the recommended video to the second bloom filter instance.
Optionally, the determining, from the Redis database, a first bloom filter instance containing system history recommended videos and a second bloom filter instance containing recommended videos historically consumed by the user, which correspond to the user ID, includes:
generating a storage key value corresponding to the user ID;
reading a bloom filter serialized character string corresponding to the user ID from a Redis database according to the storage key value;
if the reading is successful, obtaining a byte array according to the serialized character string and then performing deserialization to obtain the first bloom filter instance and the second bloom filter instance;
and if the reading fails, newly building the first bloom filter instance and the second bloom filter instance.
An apparatus for filtering recommended video candidates, comprising:
the video recommendation service call processing system comprises a receiving module, a sending module and a sending module, wherein the receiving module is used for receiving a video recommendation service call request sent by a user, and the video recommendation service call request comprises a user Identification (ID);
the bloom filter instance determining module is used for determining a first bloom filter instance containing a system history recommended video and a second bloom filter instance containing a recommended video which is consumed by a user in history, which correspond to the user ID, from a Redis database;
the module for determining the video to be filtered is used for determining the video to be filtered from the recommended video candidate result;
and the processing module is used for inquiring whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, determining that the video to be filtered is the video to be recommended, adding the video to be filtered to the first bloom filter instance, and if not, determining that the video to be filtered is not recommended.
Optionally, the processing module is further configured to:
after the video to be filtered is determined to be a video to be recommended and the video to be filtered is added to the first bloom filter instance, whether the number of system history recommended videos included in the first bloom filter instance reaches a first preset threshold value is judged, and if yes, the first bloom filter instance is reset.
Optionally, the processing module is further configured to:
if the video recommendation service call request comprises the number of videos requested to be recommended by a user, after the videos to be filtered are determined to be the videos to be recommended and the videos to be filtered are added to the first bloom filter instance, whether the number of the videos recommended to the user is larger than the number of the videos requested to be recommended by the user is judged, if not, the steps of determining the videos to be filtered from the candidate results of the recommended videos are returned and executed in sequence until the frequency of determining the videos to be filtered from the candidate results of the recommended videos reaches a second preset threshold value, and a final video recommendation result is generated and sent to the user; and if so, directly generating a final video recommendation result and sending the final video recommendation result to the user.
Optionally, the processing module is further configured to:
after a final video recommendation result is generated and sent to the user, monitoring a consumption event of the user on a recommended video in the final video recommendation result; and when the consumption event of the user to any recommended video in the final video recommendation results is monitored, adding the recommended video to the second bloom filter instance.
Optionally, the bloom filter instance determining module is specifically configured to:
generating a storage key value corresponding to the user ID;
reading a bloom filter serialized character string corresponding to the user ID from a Redis database according to the storage key value;
if the reading is successful, obtaining a byte array according to the serialized character string and then performing deserialization to obtain the first bloom filter instance and the second bloom filter instance;
and if the reading fails, newly building the first bloom filter instance and the second bloom filter instance.
Based on the technical scheme, the embodiment of the invention discloses a method and a device for filtering a recommended video candidate result, wherein the method comprises the steps of receiving a video recommendation service call request sent by a user, wherein the video recommendation service call request comprises a user Identification (ID); determining a first bloom filter instance containing system history recommended videos and a second bloom filter instance containing recommended videos historically consumed by a user, which correspond to the user ID, from a Redis database; determining a video to be filtered from the recommended video candidate result; and inquiring whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, determining that the video to be filtered is the video to be recommended, adding the video to be filtered to the first bloom filter instance, and if not, determining that the video to be filtered is not recommended. Based on the method and the device, the accuracy and efficiency of filtering the system history recommended videos and the recommended videos historically consumed by the user in the recommended video candidate results can be improved.
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 embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method for filtering recommended video candidates according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating another method for filtering recommended video candidates according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for filtering recommended video candidates according to another embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for filtering recommended video candidates 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 the video recommendation system, a result finally recommended to a user needs to be obtained from recommended video candidate results calculated by a recommendation engine. According to specific demand scenarios, the video recommendation system user should recommend different video results every time the video recommendation system user refreshes the video data, and recommended videos that the user has watched or collected, praise and the like and consumed should not be continuously recommended to the user, so that data that are not repeated with the system history recommended videos and the recommended videos that the user has historically consumed need to be efficiently selected from recommended video candidate results every time the video recommendation service is invoked.
Redis is an open-source, network-enabled, memory-based, optionally persistent key-value pair storage database written using ANSI C. It is not only robust, but also has replication characteristics and unique data models that are generated to solve problems. Redis provides five different types of data structures to which a wide variety of questions can naturally be mapped: through the characteristics of copying, persistence (persistence), client-side fragmentation (client-side sharing), and the like, a user can conveniently expand Redis into a system capable of containing hundreds of GB of data and processing millions of requests per second.
The video recommendation systems currently implemented in the industry all need to solve the problem of filtering system history recommendation videos and recommendation videos historically consumed by users in recommendation video candidate results. At present, the conventional scheme for solving the problems is to store all system history recommended videos and recommended videos historically consumed by users in a data set stored in a Redis database, then judge whether candidate recommended videos in recommended video candidate results exist in the data set one by one, and if the candidate recommended videos exist, do not recommend the candidate recommended videos.
The set storage structure provided by the Redis database is a data structure without repeated elements. The Redis database stores two namespaces of system historical recommended videos and recommended videos historically consumed by users, and each user and a group of key value pairs of video IDs corresponding to the user are arranged under each namespace. That is to say, in the prior art, a complete video ID is stored in the data set, and as the time for a user to use the video recommendation system increases, the times for the user to invoke the recommendation service of the video recommendation system and the times for playing and collecting the consumed recommended video behaviors, etc. increase correspondingly, and the number of bits of the video ID is very long, so that the storage space of the Redis database occupied by the data set is also more and more huge. The data structure of the Redis database is based on a hash algorithm, that is, the storage structure of the data set is based on a hash function, and the hash function has hash collision under the condition of large data volume, so that when the storage space of the Redis database occupied by the data set is too large, the accuracy of filtering the system history recommended videos and the recommended videos consumed by the users in the recommended video candidate results is low.
In addition, there are often a plurality of candidate video recommendations in the recommended video candidate results, and since the data set is stored in the Redis database, and it is determined one by one whether the candidate recommended video in the recommended video candidate results already exists in the data set, an operation function of the Redis database needs to be called many times, which may result in a low efficiency of filtering the system history recommended video and the recommended video consumed by the user history in the recommended video candidate results.
Therefore, the invention provides a method and a device for filtering recommended video candidate results, and aims to solve the problems of low accuracy and low efficiency in filtering system history recommended videos and recommended videos historically consumed by users in the recommended video candidate results in the prior art. The following embodiments are provided to describe the method and apparatus for filtering recommended video candidates according to the present invention in detail.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a method for filtering recommended video candidates according to an embodiment of the present invention, where the method includes the following steps:
step S100, receiving a video recommendation service call request sent by a user, wherein the video recommendation service call request comprises a user Identification (ID).
Step S110, determining a first bloom filter example containing a system history recommended video and a second bloom filter example containing a recommended video historically consumed by the user corresponding to the user ID from a Redis database.
To ensure the temporal performance of the video recommendation system, a Redis database store bloom filter is used in this embodiment.
The core implementation of a bloom filter is one very large array of bits and several hash functions. Assuming that the length of the bit array is m, the number of the hash functions is k, each bit of the m-bit array is set to be 0, when a piece of data needs to be written into the bloom filter, the hash value of the piece of data is calculated by using k different hash functions, and the obtained hash value is ensured to be located in the interval of {1, m }. Then k hash functions will now obtain k hash values, and all the bits corresponding to these values in the bit array are set to 1, and at this time, the piece of data has already been written into the bloom filter. When more data is added to the bloom filter, if a bit is found to already be 1, it is skipped.
When inquiring whether the bloom filter contains a certain piece of data, the hash calculation is carried out by the k hash functions to obtain k hash values, whether the value of the corresponding bit is 1 or not is checked in the bit array for the k hash values, if the value of the k bit is not 1, the bloom filter is proved to be not present with the piece of data, and if the obtained values of the k bits are all 1, the bloom filter is proved to be possibly contained with the piece of data.
For judging whether a certain piece of data exists or not, if the bloom filter judges that the certain piece of data exists, the certain piece of data possibly exists, and if the certain piece of data does not exist, so that the error video recommendation system can tolerate the error.
And step S120, determining a video to be filtered from the recommended video candidate result.
Step S130, querying whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, executing step S140, and if not, executing step S150.
Step S140, determining that the video to be filtered is the video to be recommended, and adding the video to be filtered to the first bloom filter instance.
And step S150, determining that the video to be filtered is not recommended.
The embodiment of the invention discloses a method for filtering a recommended video candidate result, which comprises the steps of receiving a video recommendation service call request sent by a user, wherein the video recommendation service call request comprises a user Identification (ID); determining a first bloom filter instance containing system history recommended videos and a second bloom filter instance containing recommended videos historically consumed by a user, which correspond to the user ID, from a Redis database; determining a video to be filtered from the recommended video candidate result; and inquiring whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, determining that the video to be filtered is the video to be recommended, adding the video to be filtered to the first bloom filter instance, and if not, determining that the video to be filtered is not recommended. Based on the method, the accuracy and efficiency of filtering the system history recommended videos and the recommended videos historically consumed by the user in the recommended video candidate results can be improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for filtering recommended video candidates according to another embodiment of the present invention, the method including the following steps:
step S200, receiving a video recommendation service call request sent by a user, wherein the video recommendation service call request comprises a user Identification (ID).
Step S210, determining a first bloom filter example containing a system history recommended video and a second bloom filter example containing a recommended video historically consumed by the user corresponding to the user ID from a Redis database.
The method specifically comprises the following steps: generating a storage key value corresponding to the user ID; reading a bloom filter serialized character string corresponding to the user ID from a Redis database according to the storage key value; if the reading is successful, obtaining a byte array according to the serialized character string and then performing deserialization to obtain the first bloom filter instance and the second bloom filter instance; and if the reading fails, newly building the first bloom filter instance and the second bloom filter instance. When the bloom filter instance is newly built or deserialized, the estimated capacity size and accuracy of the built bloom filter instance need to be specified, and the parameters are related to the occupied storage space of the generated bloom filter instance.
Step S220, determining a video to be filtered from the recommended video candidate result.
Step S230, querying whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, executing step S240 and step S250, and if not, executing step S260.
Step S240, determining that the video to be filtered is the video to be recommended, and adding the video to be filtered to the first bloom filter instance.
Step S250, determining whether the number of system history recommended videos included in the first bloom filter instance reaches a first preset threshold, and if so, resetting the first bloom filter instance.
The first preset threshold is based on the size of a video recommendation engine warranty data candidate set
And step S260, determining that the video to be filtered is not recommended.
In the method for filtering a recommended video candidate result disclosed in the embodiment of the present invention, after determining that the video to be filtered is a video to be recommended and adding the video to be filtered to the first bloom filter instance, the method further includes: and judging whether the number of the system history recommended videos included in the first bloom filter instance reaches a first preset threshold value, if so, resetting the first bloom filter instance, and further avoiding the problem that the accuracy of filtering the system history recommended videos in the recommended video candidate result is low due to the fact that the number of the system history recommended videos included in the first bloom filter instance is too large.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for filtering recommended video candidates according to another embodiment of the present invention, where the method includes the following steps:
step S300, receiving a video recommendation service call request sent by a user, wherein the video recommendation service call request comprises a user Identification (ID) and the quantity of videos requested to be recommended by the user.
Step S310, a first bloom filter example containing a system history recommended video and a second bloom filter example containing a recommended video which is consumed by the user in history and corresponds to the user ID are determined from a Redis database.
The method specifically comprises the following steps: generating a storage key value corresponding to the user ID; reading a bloom filter serialized character string corresponding to the user ID from a Redis database according to the storage key value; if the reading is successful, obtaining a byte array according to the serialized character string and then performing deserialization to obtain the first bloom filter instance and the second bloom filter instance; and if the reading fails, newly building the first bloom filter instance and the second bloom filter instance.
Step S320, determining a video to be filtered from the recommended video candidate result.
Step S330, querying whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, executing step S340 to step S370, and if not, executing step S380.
Step S340, determining that the video to be filtered is a video to be recommended, and adding the video to be filtered to the first bloom filter instance.
Step S350, judging whether the number of the videos recommended to the user is larger than the number of the videos requested to be recommended by the user, if not, returning to execute the step of determining the videos to be filtered from the recommended video candidate results and executing the steps in sequence until the frequency of determining the videos to be filtered from the recommended video candidate results reaches a second preset threshold value, and generating a final video recommendation result and sending the final video recommendation result to the user; and if so, directly generating a final video recommendation result and sending the final video recommendation result to the user.
And step S360, monitoring the consumption event of the recommended video in the final video recommendation result by the user.
Step S370, when a consumption event of any recommended video in the final video recommendation result by the user is monitored, adding the recommended video to the second bloom filter instance.
The video events consumed by the user are collected by a video client using the video recommendation system and are sent to kafka, the video recommendation system collects and analyzes the consumption events, the serialization character strings of the second bloom filter instances of the corresponding users are read from the Redis database according to the obtained user IDs, the second bloom filter instances are deserialized from the character strings if the serialization character strings of the second bloom filter instances are successfully read, and the second bloom filter instances are newly built if the serialization character strings of the second bloom filter instances do not exist. The video ID consumed by the user contained in the consumption event is then added to a second bloom filter instance, which is then serialized into a serialized string stored in a corresponding location of the Redis database.
And step S380, determining that the video to be filtered is not recommended.
In the method for filtering recommended video candidate results disclosed in this embodiment, after determining that the video to be filtered is a video to be recommended and adding the video to be filtered to the first bloom filter instance, the method further includes: judging whether the number of videos recommended to the user is larger than the number of videos requested to be recommended by the user, if not, returning to execute the step of determining the videos to be filtered from the recommended video candidate results and executing the steps in sequence until the frequency of determining the videos to be filtered from the recommended video candidate results reaches a second preset threshold value, and generating a final video recommendation result and sending the final video recommendation result to the user; and if so, directly generating a final video recommendation result and sending the final video recommendation result to the user. After generating the final video recommendation and sending the final video recommendation to the user, the method further comprises: monitoring the consumption events of the user on the recommended videos in the final video recommendation result; and when the consumption event of the user to any recommended video in the final video recommendation results is monitored, adding the recommended video to the second bloom filter instance. The accuracy and efficiency of filtering the system history recommended videos and the recommended videos historically consumed by the user in the recommended video candidate results can be further improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an apparatus for filtering recommended video candidates according to an embodiment of the present invention, where the apparatus includes:
the video recommendation system comprises a receiving module 100, a processing module and a display module, wherein the receiving module is used for receiving a video recommendation service call request sent by a user, and the video recommendation service call request comprises a user Identification (ID);
a bloom filter instance determining module 110, configured to determine, from a Redis database, a first bloom filter instance containing system history recommended videos and a second bloom filter instance containing recommended videos historically consumed by a user, which correspond to the user ID;
a to-be-filtered video determining module 120, configured to determine a to-be-filtered video from the recommended video candidate result;
the processing module 130 is configured to query whether the first bloom filter instance and the second bloom filter instance include the video to be filtered, determine that the video to be filtered is a video to be recommended if the video to be filtered is included, add the video to be filtered to the first bloom filter instance, and determine that the video to be filtered is not recommended if the video to be filtered is not included.
Optionally, the processing module 130 is further configured to:
after the video to be filtered is determined to be a video to be recommended and the video to be filtered is added to the first bloom filter instance, whether the number of system history recommended videos included in the first bloom filter instance reaches a first preset threshold value is judged, and if yes, the first bloom filter instance is reset.
Optionally, the processing module 130 is further configured to:
if the video recommendation service call request comprises the number of videos requested to be recommended by a user, after the videos to be filtered are determined to be the videos to be recommended and the videos to be filtered are added to the first bloom filter instance, whether the number of the videos recommended to the user is larger than the number of the videos requested to be recommended by the user is judged, if not, the steps of determining the videos to be filtered from the candidate results of the recommended videos are returned and executed in sequence until the frequency of determining the videos to be filtered from the candidate results of the recommended videos reaches a second preset threshold value, and a final video recommendation result is generated and sent to the user; and if so, directly generating a final video recommendation result and sending the final video recommendation result to the user.
Optionally, the processing module 130 is further configured to:
after a final video recommendation result is generated and sent to the user, monitoring a consumption event of the user on a recommended video in the final video recommendation result; and when the consumption event of the user to any recommended video in the final video recommendation results is monitored, adding the recommended video to the second bloom filter instance.
Optionally, the bloom filter instance determining module 110 is specifically configured to:
generating a storage key value corresponding to the user ID;
reading a bloom filter serialized character string corresponding to the user ID from a Redis database according to the storage key value;
if the reading is successful, obtaining a byte array according to the serialized character string and then performing deserialization to obtain the first bloom filter instance and the second bloom filter instance;
and if the reading fails, newly building the first bloom filter instance and the second bloom filter instance.
It should be noted that specific function implementation of each module is already described in detail in the method embodiment, and is not described in detail in this embodiment.
In summary, the following steps:
the embodiment of the invention discloses a method and a device for filtering a recommended video candidate result, which are used for receiving a video recommendation service call request sent by a user, wherein the video recommendation service call request comprises a user Identification (ID); determining a first bloom filter instance containing system history recommended videos and a second bloom filter instance containing recommended videos historically consumed by a user, which correspond to the user ID, from a Redis database; determining a video to be filtered from the recommended video candidate result; and inquiring whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, determining that the video to be filtered is the video to be recommended, adding the video to be filtered to the first bloom filter instance, and if not, determining that the video to be filtered is not recommended. Based on the method and the device, the accuracy and efficiency of filtering the system history recommended videos and the recommended videos historically consumed by the user in the recommended video candidate results can be improved.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for filtering recommended video candidates, comprising:
receiving a video recommendation service call request sent by a user, wherein the video recommendation service call request comprises a user Identification (ID);
determining a first bloom filter instance containing system history recommended videos and a second bloom filter instance containing recommended videos historically consumed by a user, which correspond to the user ID, from a Redis database, wherein the determining of the first bloom filter instance containing system history recommended videos and the second bloom filter instance containing recommended videos historically consumed by the user, which correspond to the user ID, from the Redis database comprises: generating a storage key value corresponding to the user ID; reading a bloom filter serialized character string corresponding to the user ID from a Redis database according to the storage key value; if the reading is successful, obtaining a byte array according to the serialized character string and then performing deserialization to obtain the first bloom filter instance and the second bloom filter instance; if the reading fails, newly building the first bloom filter instance and the second bloom filter instance;
determining a video to be filtered from the recommended video candidate result;
and inquiring whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, determining that the video to be filtered is the video to be recommended, adding the video to be filtered to the first bloom filter instance, and if not, determining that the video to be filtered is not recommended.
2. The method of claim 1, wherein after the determining that the video to be filtered is a video to be recommended and adding the video to be filtered to the first bloom filter instance, the method further comprises:
and judging whether the number of the system history recommended videos included in the first bloom filter instance reaches a first preset threshold value, and if so, resetting the first bloom filter instance.
3. The method of claim 1, wherein the video recommendation service invocation request comprises a number of videos requested to be recommended by a user, and after the determining that the video to be filtered is a video to be recommended and adding the video to be filtered to the first bloom filter instance, the method further comprises:
judging whether the number of videos recommended to the user is larger than the number of videos requested to be recommended by the user, if not, returning to execute the step of determining the videos to be filtered from the recommended video candidate results and executing the steps in sequence until the frequency of determining the videos to be filtered from the recommended video candidate results reaches a second preset threshold value, and generating a final video recommendation result and sending the final video recommendation result to the user; and if so, directly generating a final video recommendation result and sending the final video recommendation result to the user.
4. The method of claim 3, wherein after generating the final video recommendation to send to the user, the method further comprises:
monitoring the consumption events of the user on the recommended videos in the final video recommendation result;
and when the consumption event of the user to any recommended video in the final video recommendation results is monitored, adding the recommended video to the second bloom filter instance.
5. An apparatus for filtering recommended video candidates, comprising:
the video recommendation service call processing system comprises a receiving module, a sending module and a sending module, wherein the receiving module is used for receiving a video recommendation service call request sent by a user, and the video recommendation service call request comprises a user Identification (ID);
a bloom filter instance determining module, configured to determine, from a Redis database, a first bloom filter instance containing system history recommended videos and a second bloom filter instance containing recommended videos historically consumed by a user, which correspond to the user ID, where the bloom filter instance determining module is specifically configured to: generating a storage key value corresponding to the user ID; reading a bloom filter serialized character string corresponding to the user ID from a Redis database according to the storage key value; if the reading is successful, obtaining a byte array according to the serialized character string and then performing deserialization to obtain the first bloom filter instance and the second bloom filter instance; if the reading fails, newly building the first bloom filter instance and the second bloom filter instance;
the module for determining the video to be filtered is used for determining the video to be filtered from the recommended video candidate result;
and the processing module is used for inquiring whether the first bloom filter instance and the second bloom filter instance contain the video to be filtered, if so, determining that the video to be filtered is the video to be recommended, adding the video to be filtered to the first bloom filter instance, and if not, determining that the video to be filtered is not recommended.
6. The apparatus of claim 5, wherein the processing module is further configured to:
after the video to be filtered is determined to be a video to be recommended and the video to be filtered is added to the first bloom filter instance, whether the number of system history recommended videos included in the first bloom filter instance reaches a first preset threshold value is judged, and if yes, the first bloom filter instance is reset.
7. The apparatus of claim 5, wherein the processing module is further configured to:
if the video recommendation service call request comprises the number of videos requested to be recommended by a user, after the videos to be filtered are determined to be the videos to be recommended and the videos to be filtered are added to the first bloom filter instance, whether the number of the videos recommended to the user is larger than the number of the videos requested to be recommended by the user is judged, if not, the steps of determining the videos to be filtered from the candidate results of the recommended videos are returned and executed in sequence until the frequency of determining the videos to be filtered from the candidate results of the recommended videos reaches a second preset threshold value, and a final video recommendation result is generated and sent to the user; and if so, directly generating a final video recommendation result and sending the final video recommendation result to the user.
8. The apparatus of claim 7, wherein the processing module is further configured to:
after a final video recommendation result is generated and sent to the user, monitoring a consumption event of the user on a recommended video in the final video recommendation result; and when the consumption event of the user to any recommended video in the final video recommendation results is monitored, adding the recommended video to the second bloom filter instance.
CN201711486750.4A 2017-12-29 2017-12-29 Method and device for filtering recommended video candidate result Active CN108133031B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711486750.4A CN108133031B (en) 2017-12-29 2017-12-29 Method and device for filtering recommended video candidate result

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711486750.4A CN108133031B (en) 2017-12-29 2017-12-29 Method and device for filtering recommended video candidate result

Publications (2)

Publication Number Publication Date
CN108133031A CN108133031A (en) 2018-06-08
CN108133031B true CN108133031B (en) 2021-01-29

Family

ID=62394162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711486750.4A Active CN108133031B (en) 2017-12-29 2017-12-29 Method and device for filtering recommended video candidate result

Country Status (1)

Country Link
CN (1) CN108133031B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159436B (en) * 2018-11-07 2023-12-12 腾讯科技(深圳)有限公司 Method, device and computing equipment for recommending multimedia content
CN110209874B (en) * 2019-04-24 2021-08-20 北京奇艺世纪科技有限公司 Information processing method, information processing device, electronic equipment and storage medium
CN110781386A (en) * 2019-10-10 2020-02-11 支付宝(杭州)信息技术有限公司 Information recommendation method and device, and bloom filter creation method and device
CN110784729B (en) * 2019-10-25 2020-10-30 广州华多网络科技有限公司 Live broadcast room entrance pipeline data processing method, device, equipment and storage medium
CN111698126B (en) * 2020-04-28 2021-10-01 武汉旷视金智科技有限公司 Information monitoring method, system and computer readable storage medium
CN111711860B (en) * 2020-05-14 2022-09-30 北京奇艺世纪科技有限公司 Video recommendation filtering method, device, server and storage medium
CN111857850B (en) * 2020-07-21 2022-03-25 掌阅科技股份有限公司 Filter initialization method, electronic device and storage medium
CN112347355A (en) * 2020-11-11 2021-02-09 广州酷狗计算机科技有限公司 Data processing method, device, server and storage medium
CN112528125A (en) * 2020-12-23 2021-03-19 北京明略软件系统有限公司 Method and device for avoiding content repeated recommendation, electronic equipment and storage medium
CN112818019B (en) * 2021-01-29 2024-02-02 北京思特奇信息技术股份有限公司 Query request filtering method applied to Redis client and Redis client
CN113536034A (en) * 2021-09-17 2021-10-22 飞狐信息技术(天津)有限公司 Data writing method and data reading method based on bloom filter
CN114173176B (en) * 2021-11-17 2023-07-14 聚好看科技股份有限公司 Server, display equipment and media asset filtering method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718455A (en) * 2014-12-01 2016-06-29 阿里巴巴集团控股有限公司 Data query method and apparatus
CN105740266A (en) * 2014-12-10 2016-07-06 国际商业机器公司 Data deduplication method and device
CN106294462A (en) * 2015-06-01 2017-01-04 Tcl集团股份有限公司 A kind of method and system obtaining recommendation video
CN107038213A (en) * 2017-02-28 2017-08-11 华为技术有限公司 A kind of method and device of video recommendations

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4547596B2 (en) * 2002-12-12 2010-09-22 ソニー株式会社 Information processing apparatus, information processing method, and program
CN106445944A (en) * 2015-08-06 2017-02-22 阿里巴巴集团控股有限公司 Data query request processing method and apparatus, and electronic device
CN106326431A (en) * 2016-08-25 2017-01-11 乐视控股(北京)有限公司 Information recommendation method and device
CN107454442B (en) * 2017-09-07 2021-02-05 阿里巴巴(中国)有限公司 Method and device for recommending video
CN107645667A (en) * 2017-09-21 2018-01-30 广州华多网络科技有限公司 Video recommendation method, system and server apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718455A (en) * 2014-12-01 2016-06-29 阿里巴巴集团控股有限公司 Data query method and apparatus
CN105740266A (en) * 2014-12-10 2016-07-06 国际商业机器公司 Data deduplication method and device
CN106294462A (en) * 2015-06-01 2017-01-04 Tcl集团股份有限公司 A kind of method and system obtaining recommendation video
CN107038213A (en) * 2017-02-28 2017-08-11 华为技术有限公司 A kind of method and device of video recommendations

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BloomStore: Bloom-Filter based Memory-efficient Key-Value Store for Indexing of Data Deduplication;Guanlin Lu 等;《2012 IEEE 28th Symposium on Mass Storage Systems》;20120709;1-11 *
布隆过滤器在网页去重中的研究与应用;黄涛;《中国优秀硕士学位论文全文数据库 信息科技辑》;20130915(第09期);I138-543 *

Also Published As

Publication number Publication date
CN108133031A (en) 2018-06-08

Similar Documents

Publication Publication Date Title
CN108133031B (en) Method and device for filtering recommended video candidate result
WO2016081633A1 (en) Service addressing in distributed environment
CN107861981B (en) Data processing method and device
CN110162270B (en) Data storage method, storage node and medium based on distributed storage system
CN108846021B (en) Mass small file storage method based on user access preference model
CN113726783B (en) Abnormal IP address identification method and device, electronic equipment and readable storage medium
CN110933136A (en) Service node selection method, device, equipment and readable storage medium
CN111221700A (en) Cluster node state monitoring method, device, equipment and readable storage medium
CN109063210B (en) Resource object query method, device, equipment and storage medium of storage system
CN111562884A (en) Data storage method and device and electronic equipment
CN111062642A (en) Method and device for identifying industrial risk degree of object and electronic equipment
CN112866062B (en) Distributed pressure test system, method, device, equipment and storage medium
CN110597879A (en) Method and device for processing time series data
CN107168643B (en) Data storage method and device
CN108920326A (en) Determine system time-consuming abnormal method, apparatus and electronic equipment
CN108390770B (en) Information generation method and device and server
CN115811483A (en) Network state monitoring method and device, electronic equipment and storage medium
CN114860432A (en) Method and device for determining information of memory fault
CN110543496B (en) Data processing method and device for time sequence database cluster
CN112861014A (en) Function recommendation method and device, electronic equipment and computer-readable storage medium
CN113505276A (en) Scoring method, device, equipment and storage medium of pre-calculation model
CN113326064A (en) Method for dividing business logic module, electronic equipment and storage medium
CN110209679B (en) data storage method and terminal equipment for improving access efficiency
CN108363819B (en) Query engine matching method, device, server group and readable storage medium
CN111352825B (en) Data interface testing method and device and server

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