Content recommendation method and device
The content recommendation method addresses server instability in information stream applications by using a cache for content delivery and cache management, ensuring continuous content provision and enhanced user experience.
Patent Information
- Application Number
- JP2024552074
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-03-02
- Filing Date
- 2023-02-23
- Publication Date
- 2025-12-15
- Estimated Expiration
- 2043-02-23
AI Technical Summary
Information stream recommendation applications suffer from instability due to malfunctioning recommendation servers, leading to random content provision and a degraded user experience.
Implement a content recommendation method that utilizes a recommendation cache to provide content when the server is down and communicates with the server normally when available, along with cache management strategies to optimize storage and prevent duplicates.
Enhances the stability of information stream recommendation applications by ensuring continuous content delivery and optimizing cache usage, thereby improving user experience.
Smart Images

Figure 0007785966000006 
Figure 0007785966000007 
Figure 0007785966000008
Abstract
Description
[Technical Field]
[0001] [CROSS-REFERENCE TO RELATED APPLICATIONS] This application is based on and claims priority from a Chinese application having application number 202210197812.4 and filing date March 2, 2022, the entire disclosure of which is incorporated herein by reference.
[0002] [Technical field] The present invention relates to the technical field of content recommendation, and more particularly to a method and apparatus for recommending content. [Background technology]
[0003] Currently, many applications provide content to users through personalized recommendations, and applications that provide content to users through such recommendations are called information stream recommendation applications. For example, there are shot video applications that provide video content to users through personalized recommendations. Summary of the Invention
[0004] According to a first aspect, an embodiment of the present invention is a content recommendation method applied to an information stream server, comprising: receiving content request information transmitted by a terminal device, the content request information being for requesting acquisition of recommended content corresponding to the target user; determining whether a recommendation server is down; When the recommendation server is out of order, obtaining first recommended content based on a recommendation cache corresponding to the target user, wherein the recommendation cache stores a plurality of recommended content items corresponding to the target user, and the plurality of recommended content items are written when the recommendation server is not out of order; and transmitting the first recommended content to the terminal device.
[0005] In an alternative embodiment of the present invention, the method comprises: If the recommendation server is normal, sending recommendation request information to the recommendation server, the recommendation request information being for requesting to obtain recommended content corresponding to the target user; receiving the second recommended content sent by the recommendation server; and transmitting the second recommended content to the terminal device.
[0006] In one alternative embodiment of the present invention, the step of determining whether the recommendation server has failed as described above may include: obtaining status indication information of the recommended server; and determining whether the recommended server has failed based on the status indication.
[0007] In one alternative embodiment of the present invention, the step of determining whether the recommendation server has failed as described above may include: If response information returned by the recommendation server is not received within a response time period of a preset length of time, determining that the recommendation server has failed.
[0008] In an alternative embodiment of the present invention, the recommended content in the recommendation cache is sorted in descending order of relevance to the target user; The aforementioned obtaining first recommended content based on the recommendation cache corresponding to the target user includes: determining a top number of recommended content in the recommendation cache; generating the first recommended content based on a top first number of recommended content in the recommendation cache.
[0009] According to a second aspect, an embodiment of the present invention is a content recommendation method applied to a recommendation server, comprising: receiving recommendation request information sent by an information stream server, the recommendation request information being for requesting to obtain recommended content corresponding to the target user; Obtaining a recommended content sequence corresponding to the target user through a preset recommendation algorithm, wherein the recommended content sequence includes a plurality of recommended contents, and the plurality of recommended contents are sorted in descending order of relevance to the target user; A content recommendation method is provided, which includes: sending a top second number of recommended contents of the recommended content sequence to the information stream server; and writing the recommended content sequence into a recommendation cache corresponding to the target user.
[0010] In an alternative embodiment of the present invention, the method comprises: The method further includes sending status indication information to the information stream server, the status indication information being for indicating whether the recommendation server is out of order.
[0011] In an alternative embodiment of the present invention, the method comprises: The method further includes, before writing the recommended content sequence to a recommendation cache corresponding to the target user, performing a duplicate elimination process on the recommended content in the recommended content sequence based on the recommended content stored in the recommendation cache corresponding to the target user and the recommended content sent to the information stream server.
[0012] In an alternative embodiment of the present invention, the method comprises: The method further includes clearing the recommended content in the recommendation cache corresponding to the target user when the length of time during which the information stream server has not transmitted the recommended content corresponding to the target user to the terminal device corresponding to the target user exceeds a first length of time.
[0013] In an alternative embodiment of the present invention, the method comprises: The method further includes determining a capacity of cache space for storing a recommendation cache corresponding to each user based on at least one of the average number of active users of the recommendation server within the first time period, the average fault recovery time of the recommendation server, the average consumption time per one of the recommended contents, the average amount of data per one of the recommended contents, and a fault tolerance factor.
[0014] As an optional embodiment of the present invention, the cache space capacity of the recommendation cache corresponding to each user is positively correlated with at least one of the average number of active users of the recommendation server within the first time length, the average fault repair time of the recommendation server, the average data amount per one of the recommended contents, or the fault tolerance factor, and is negatively correlated with the average consumption time per one of the recommended contents.
[0015] As an alternative embodiment of the present invention, determining the capacity of cache space for storing the recommendation cache corresponding to each user based on at least one of the average number of active users of the recommendation server within the first time period, the average time to repair the failure of the recommendation server, the average consumption time per one of the recommended contents, the average amount of data per one of the recommended contents, and a fault tolerance factor, as described above, includes: the average number of active users of the recommendation server within the first time period, the average fault recovery time of the recommendation server, the average consumption time per one of the recommended contents, the average data amount per one of the recommended contents, a fault tolerance factor, and the following formula:
number
[0016] According to a third aspect, an embodiment of the present invention comprises: a receiving unit for receiving content request information transmitted by a terminal device, the content request information being for requesting acquisition of recommended content corresponding to a target user; a processor for determining whether a recommendation server has failed; an acquisition unit for acquiring first recommended content based on a recommendation cache corresponding to the target user when the processing unit determines that the recommendation server is out of order, the recommendation cache storing a plurality of recommended content items corresponding to the target user, and the plurality of recommended content items being written when the recommendation server is not out of order; a transmitting unit for transmitting the first recommended content to the terminal device.
[0017] As an alternative embodiment of the present invention, the sending unit is further used for sending recommendation request information to the recommendation server when the recommendation server is normal, the recommendation request information being for requesting to obtain recommended content corresponding to the target user; the receiving unit is further used to receive second recommended content transmitted by the recommendation server; The transmitting unit is further used to transmit the second recommended content to the terminal device.
[0018] As an alternative embodiment of the present invention, the processing unit is specifically used to obtain status indication information of the recommended server and determine whether the recommended server is faulty based on the status indication information.
[0019] As an alternative embodiment of the present invention, the processing unit is specifically used to determine that the recommendation server is faulty if response information returned by the recommendation server is not received within a response time period of a predetermined length of time.
[0020] In an alternative embodiment of the present invention, the recommended content in the recommendation cache is sorted in descending order of relevance to the target user; Specifically, the acquisition unit is used to determine the top first number of recommended contents in the recommendation cache, and to generate the first recommended content based on the top first number of recommended contents in the recommendation cache.
[0021] According to a fourth aspect, an embodiment of the present invention comprises: a receiving unit for receiving recommendation request information transmitted by an information stream server, the recommendation request information being for requesting a target user to acquire recommended content; a processing unit for acquiring a recommended content sequence corresponding to the target user by a preset recommendation algorithm, the recommended content sequence including a plurality of recommended contents, and the plurality of recommended contents being sorted in descending order of relevance to the target user; a transmitting unit for transmitting the second most recommended content of the recommended content sequence to the information stream server; a cache manager for writing the recommended content sequence into a recommendation cache corresponding to the target user.
[0022] As an alternative embodiment of the present invention, The sending unit is further used for sending status indication information to the information stream server, the status indication information being for indicating whether the recommended server is out of order or not.
[0023] As an optional embodiment of the present invention, the cache management unit is further used to perform a duplication elimination process on the recommended content in the recommended content sequence based on the recommended content stored in the recommended cache corresponding to the target user and the recommended content sent to the information stream server before writing the recommended content sequence to the recommended cache corresponding to the target user.
[0024] As an alternative embodiment of the present invention, the cache management unit is further used to clear the recommended content in the recommendation cache corresponding to the target user when the length of time during which the information stream server has not sent the recommended content corresponding to the target user to the terminal device corresponding to the target user exceeds a first length of time.
[0025] As an alternative embodiment of the present invention, the cache management unit is further used to determine the capacity of cache space for storing the recommendation cache corresponding to each user based on at least one of the average number of active users of the recommendation server within the first time period, the average fault recovery time of the recommendation server, the average consumption time per one of the recommended contents, the average data amount per one of the recommended contents, and a fault tolerance factor.
[0026] As an optional embodiment of the present invention, the cache space capacity of the recommendation cache corresponding to each user is positively correlated with at least one of the average number of active users of the recommendation server within the first time length, the average fault repair time of the recommendation server, the average data amount per one of the recommended contents, or the fault tolerance factor, and is negatively correlated with the average consumption time per one of the recommended contents.
[0027] As an alternative embodiment of the present invention, the cache management unit specifically calculates the average number of active users of the recommended server within the first time period, the average fault recovery time of the recommended server, the average consumption time per one of the recommended contents, the average data amount per one of the recommended contents, a fault tolerance factor, and the following formula, i.e.,
number
[0028] According to a fifth aspect, an embodiment of the present invention provides an electronic device including a memory and a processor, wherein the memory is for storing a computer program, and the processor, when executing the computer program, causes the electronic device to realize the content recommendation method described in any one of the above embodiments.
[0029] According to a sixth aspect, an embodiment of the present invention provides a computer-readable recording medium having stored thereon a computer program that, when executed by a computing device, causes the computing device to implement the content recommendation method described in any one of the above embodiments.
[0030] According to a seventh aspect, an embodiment of the present invention provides a computer program product that, when executed on a computer, causes the computer to implement the content recommendation method according to any one of the above embodiments.
[0031] According to an eighth aspect, an embodiment of the present invention provides a computer program comprising instructions that, when executed by a processor, cause the processor to perform the content recommendation method according to any one of the preceding embodiments. [Brief explanation of the drawings]
[0032] The drawings herein, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present invention and, together with the description, serve to explain the principles of the invention.
[0033] In order to more clearly describe the technical solutions in the embodiments of the present invention or the prior art, the following briefly describes the drawings that need to be referred to in the description of the embodiments or the prior art. Obviously, those skilled in the art can obtain other drawings based on these drawings without any creative efforts. [Figure 1] 1 is a scenario architecture diagram of a content recommendation method according to an embodiment of the present invention; [Figure 2] 2 is an interaction flowchart of a content recommendation method according to an embodiment of the present invention; [Figure 3] 1 is a schematic diagram of the configuration of an information stream server according to an embodiment of the present invention; [Figure 4] FIG. 2 is a schematic diagram illustrating the configuration of a recommendation server according to an embodiment of the present invention. [Figure 5]1 is a schematic diagram illustrating a hardware configuration of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0034] In order to make the above objects, features and advantages of the present invention more clearly understandable, the following further describes the aspects of the present invention. It should be noted that, unless contradictory, the embodiments of the present invention and the features in the embodiments can be combined with each other.
[0035] In the following description, many specific details are set forth in order to fully understand the present invention, but the present invention may be embodied in other forms different from those described herein. Obviously, the embodiments in the specification are only some of the embodiments of the present invention, but not all of the embodiments.
[0036] In the embodiments of the present invention, terms such as "exemplary" or "for example" are used to denote an example, illustration, or explanation. In the embodiments of the present invention, any embodiment or design solution described as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or design solutions. Rather, the use of terms such as "exemplary" or "for example" is intended to present related concepts in a concrete manner. Also, in the description of the embodiments of the present invention, "plurality" means two or more unless otherwise specified.
[0037] Because all content provided to users by an information stream recommendation application is generated by a recommendation system, the stability of the information stream recommendation application depends heavily on the stability of the recommendation system. If the recommendation system is out of order, the information stream recommendation application can only randomly provide content to users, which causes users to lose interest in the pushed content, seriously affecting the user experience. Therefore, how to improve the stability of information stream recommendation applications is an issue that needs to be resolved as soon as possible.
[0038] In view of this, embodiments of the present invention provide a content recommendation method and apparatus for improving the stability of information stream recommendation applications.
[0039] The following first describes the scenario architecture of the content recommendation method according to an embodiment of the present invention.
[0040] As shown in FIG. 1, in some embodiments, the scenario architecture of the content recommendation method according to the embodiments of the present invention includes a terminal device 11, an information stream server 12, and a recommendation server 13.
[0041] An information stream recommendation application is installed in the terminal device 11, and in response to a user's operation on the information stream recommendation application, the information stream server 12 may transmit content request information to request recommended content corresponding to the logged-in user of the information stream recommendation application. When the information stream server 12 receives the content request information transmitted by the terminal device 11, it first determines whether the recommendation server 13 is malfunctioning. If the recommendation server 13 is normal (no malfunction has occurred), it transmits recommendation request information to the recommendation server 13, receives the recommended content transmitted by the recommendation server 13, and transmits the recommended content generated by the recommendation server 13 to the terminal device. If the recommendation server 13 is malfunctioning, it generates recommended content based on the recommended content written in the recommendation cache when the recommendation server 13 was operating normally, and transmits the recommended content to the terminal device. In response to the recommendation request information, the recommendation server 13 determines recommended content corresponding to the user using a recommendation algorithm, generates recommended content to be transmitted to the information stream server 12 based on the determined recommended content sequence, and writes the determined recommended content sequence to the recommendation cache.
[0042] The terminal device 11 in the embodiment of the present invention may be a mobile terminal device or a non-mobile terminal device. The mobile terminal device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an in-vehicle terminal, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile terminal device may be a personal computer (PC), a television (TV), an ATM, or a self-service machine, etc. Alternatively, the terminal device 11 may be any other type of device, and the embodiment of the present invention is not limited thereto.
[0043] An embodiment of the present invention provides a content recommendation method, and as shown in FIG. 2, the content recommendation method includes the following steps S11 to S19.
[0044] S11: In response to a user operation, the terminal device transmits content request information to the information stream server.
[0045] In response, the information stream server receives the content request information sent by the terminal device.
[0046] The content request information is for requesting to obtain recommended content corresponding to the target user.
[0047] In an embodiment of the present invention, the target user may be a logged-in user of an information stream recommendation application installed on a terminal device. The terminal device may include an identification of the target user in the content request information to request obtaining recommended content corresponding to the target user. The identification of the target user may specifically be the target user's identity document (ID), the target user's login account, etc.
[0048] S12: The information stream server determines whether the recommendation server has failed.
[0049] In some embodiments, an implementation in which the information stream server determines whether a recommendation server has failed includes: The information stream server sends a request to a recommendation server to obtain recommendation request information of recommended content corresponding to the target user; If the response information returned by the recommended server is received within the response time length, the recommended server is determined to be normal (no failure has occurred), and the response time length is, for example, a preset value; and determining that the recommendation server has failed if no response information is received from the recommendation server within the response time length.
[0050] In some embodiments, the response time length may be set based on the maximum response time length of the recommended server. For example, if the maximum response time length of the recommended server is 2 seconds, the response time length may be set to 2 seconds.
[0051] In some other embodiments, the implementation in which the information stream server determines whether the recommendation server has failed includes: The information stream server obtains status indication information of the recommendation server, and determines whether the recommendation server is out of order based on the status indication information.
[0052] In some embodiments, the implementation of the information stream server obtaining the status indication information of the recommendation server includes the following.
[0053] Alternatively, in an implementation in which the recommendation server transmits status indication information to the information stream server, the recommendation server may be configured to periodically transmit status indication information to the information stream server at a predetermined time interval, or may be configured to transmit status indication information to the information stream server when a status change occurs in the recommendation server (from failure to normal, or from normal to failure), or may transmit status confirmation information to the recommendation server and receive the status indication information transmitted by the recommendation server.
[0054] That is, the content recommendation method according to the embodiment of the present invention comprises: The method further includes the recommendation server sending status indication information to the information stream server, the status indication information being for indicating whether the recommendation server is out of order.
[0055] In the above step S12, if the information stream server determines that the recommendation server is out of order, the content recommendation method according to the embodiment of the present invention further executes the following steps S13 and S14.
[0056] S13: The information stream server obtains a first recommended content based on a recommendation cache corresponding to the target user.
[0057] The recommendation cache stores a plurality of recommended contents corresponding to the target user, and the plurality of recommended contents are written when the recommendation server is not experiencing a failure.
[0058] In some embodiments, an implementation of obtaining first recommended content based on a recommendation cache corresponding to the target user includes: determining a first number of top recommended contents in the recommendation cache, the first number being, for example, a preset value; generating the first recommended content based on a top first number of recommended content in the recommendation cache.
[0059] In some embodiments, the recommendation cache corresponding to the target user stores the indicator information of the recommended content corresponding to the target user, and the implementation form in which the information stream server obtains the first recommended content based on the recommendation cache corresponding to the target user includes: Obtaining indicator information of at least one recommended content according to a recommendation cache corresponding to the target user; and obtaining the first recommended content based on indicator information of the at least one recommended content.
[0060] In some embodiments, generating the first recommended content based on a first number of top recommended content in the recommendation cache by the information stream server comprises: The information stream server generates the first recommended content by removing recommended content sent to the terminal device from the top first number of recommended content in the recommendation cache.
[0061] For example, if the first number is 4, the top four recommended contents in the recommendation cache include recommended content A, recommended content B, recommended content C, and recommended content D, and recommended content C has already been sent to the terminal device, so the first recommended content generated includes recommended content A, recommended content B, and recommended content D.
[0062] S14: The information stream server transmits the first recommended content to the terminal device.
[0063] In response, the terminal device receives the first recommended content sent by the information stream server.
[0064] As a result, when the recommendation server is out of order, the information stream server can send recommended content corresponding to the target user to the terminal device, thereby avoiding randomly providing content to users when the recommendation server is out of order, and improving the stability of the information stream recommendation application.
[0065] In the above step S12, if the information stream server determines that the recommendation server is normal, the content recommendation method according to the embodiment of the present invention further executes the following steps S15 to S19.
[0066] S15: The information stream server sends recommendation request information to the recommendation server.
[0067] In response, the recommendation server receives the recommendation request information sent by the information stream server.
[0068] The recommendation request information is for requesting to obtain recommended content corresponding to the target user.
[0069] Similarly, the information stream server may include the target user's identification information in the recommendation request information to request to obtain the recommended content corresponding to the target user.
[0070] S16: The recommendation server obtains a recommended content sequence corresponding to the target user through a preset recommendation algorithm.
[0071] The recommended content sequence includes a plurality of recommended contents, and the plurality of recommended contents are sorted in descending order of relevance to the target user.
[0072] In some embodiments, an implementation in which a recommendation server obtains a recommended content sequence corresponding to the target user through a preset recommendation algorithm includes: Obtaining a relevance between each piece of content and the target user through a preset recommendation algorithm; sorting each content in descending order based on relevance and obtaining a sorted result for each content; The method may further include determining the top m pieces of content in the sorted result as a recommended content sequence corresponding to the target user.
[0073] The m value may be set as a parameter of the recommendation algorithm as needed. For example, the m value may be 1000, 2000, etc.
[0074] S17: The recommendation server transmits the second most recommended content (second recommended content) in the recommended content sequence to the information stream server, where the second number is, for example, a preset value.
[0075] In response, the information stream server receives the second recommended content (the second most numerous recommended content in the sequence of recommended content) sent by the recommendation server.
[0076] The embodiment of the present invention does not limit the second number, and the second number may be set to any positive integer as needed in practice. For example, the second number may be 4 or 6.
[0077] S18: The recommendation server writes the recommended content sequence into a recommendation cache corresponding to the target user.
[0078] In some embodiments, a content recommendation method according to an embodiment of the present invention comprises: The method further includes, before the recommendation server writes the recommended content sequence into the recommendation cache corresponding to the target user, performing a duplicate elimination process on the recommended content in the recommended content sequence based on the recommended content stored in the recommendation cache corresponding to the target user and the recommended content sent to the information stream server.
[0079] In the embodiment of the present invention, before writing the recommended content sequence into the recommendation cache corresponding to the target user, the recommended content in the recommended content sequence is subjected to a de-duplication process based on the recommended content stored in the recommendation cache corresponding to the target user and the recommended content sent to the information stream server, thereby preventing duplicate recommended content from being stored in the recommendation cache and further preventing cache space from being wasted due to the duplicate recommended content.
[0080] S19: The information stream server transmits the second recommended content to the terminal device.
[0081] In response, the terminal device receives the second recommended content sent by the information stream server.
[0082] A content recommendation method according to an embodiment of the present invention, upon receiving content request information sent by a terminal device to request the acquisition of recommended content corresponding to a target user, first determines whether a recommendation server is faulty. If the recommendation server is faulty, the method acquires first recommended content based on a plurality of recommended content items written in a recommendation cache when the recommendation server is not faulty, and transmits the first recommended content item to the terminal device. The content recommendation method according to an embodiment of the present invention writes a plurality of recommended content items corresponding to the target user to a recommendation cache corresponding to the target user when the recommendation server is not faulty, and acquires recommended content items to be transmitted to the terminal device based on the recommendation cache when the recommendation server is faulty. Therefore, even when the recommendation server is faulty, the content recommendation method according to an embodiment of the present invention can still transmit recommended content items corresponding to the user to the terminal device, thereby avoiding an impact on the user's experience. Therefore, an embodiment of the present invention can improve the stability of information stream recommendation applications.
[0083] As an alternative embodiment of the present invention, a content recommendation method according to an embodiment of the present invention includes: The recommendation server further includes clearing the recommended content in the recommendation cache corresponding to the target user when the length of time during which the information stream server has not sent the recommended content corresponding to the target user to the terminal device corresponding to the target user exceeds a first length of time.
[0084] After a terminal device sends content request information to an information stream server, the information stream server always returns recommended content to the terminal device regardless of whether the recommendation server is out of order. Therefore, the time length during which the information stream server does not send recommended content corresponding to the target user to the terminal device corresponding to the target user is the time length during which the terminal device does not send content request information to the information stream server. Therefore, whether to clear the recommended content in the recommendation cache corresponding to the target user may be determined based on the time length during which the terminal device does not send content request information to the information stream server.
[0085] In the above embodiment, when the time length during which the information stream server does not send the recommended content corresponding to the target user to the terminal device corresponding to the target user exceeds a first time length, the recommended content in the recommendation cache corresponding to the target user is cleared. Therefore, in the above embodiment, when the target user does not use the information stream recommendation application for a long time, the recommendation cache corresponding to the target user is cleared, which can further improve the utilization rate of the cache space.
[0086] As an alternative embodiment of the present invention, a content recommendation method according to the present invention includes: The method further includes the recommendation server determining a capacity of cache space for storing a recommendation cache corresponding to each user based on at least one of the average number of active users of the recommendation server within the first time period, the average fault recovery time of the recommendation server, the average consumption time per one of the recommended contents, the average amount of data per one of the recommended contents, and a fault tolerance factor.
[0087] In some embodiments, the capacity of cache space of the recommendation cache corresponding to each user is positively correlated with the average number of active users of the recommendation server within the first time period, the average fault recovery time of the recommendation server, the average data volume and fault tolerance factor per one of the recommended contents, and negatively correlated with the average consumption time per one of the recommended contents.
[0088] Illustratively, the first time period is 24 hours, and the average number of active users of the recommendation server within the first time period is the number of daily active users (DUA) of the recommendation server.
[0089] Illustratively, the first period of time is one week, and the average number of active users of the recommendation server within the first period of time is the number of active users per week (Week Active User, WUA) of the recommendation server.
[0090] In some embodiments, the mean time to repair of the recommended servers may be predicted based on historical data.
[0091] Illustratively, the fault tolerance factor may be 1.1 or 1.2.
[0092] Furthermore, determining a capacity of cache space for storing a recommendation cache corresponding to each user based on at least one of the average number of active users of the recommendation server within the first time period, the average time to repair a failure of the recommendation server, the average consumption time per one of the recommended contents, the average amount of data per one of the recommended contents, and a fault tolerance factor, as described above, includes: the average number of active users of the recommendation server within the first time period, the average fault recovery time of the recommendation server, the average consumption time per one of the recommended contents, the average data amount per one of the recommended contents, a fault tolerance factor, and the following formula:
number
[0093] Based on the same inventive concept, as an implementation of the above method, an embodiment of the present invention further provides an information stream server and a recommendation server, which correspond to the above method embodiment. For ease of reading, this embodiment does not go into detail about the details of the above method embodiment, but it is clear that the information stream server and recommendation server in this embodiment can correspondingly realize all the contents of the above method embodiment.
[0094] An embodiment of the present invention provides an information stream server. Figure 3 is a schematic diagram of the information stream server. As shown in Figure 3, the information stream server 300 includes: a receiving unit 31 for receiving content request information transmitted by a terminal device, the content request information being for requesting acquisition of recommended content corresponding to a target user; a processing unit 32 for determining whether a recommended server has failed; an acquisition unit (33) for acquiring first recommended content based on a recommendation cache corresponding to the target user when the processing unit determines that the recommendation server is out of order, the recommendation cache storing a plurality of recommended content items corresponding to the target user, and the plurality of recommended content items being written when the recommendation server is not out of order; and a transmitting unit 34 for transmitting the first recommended content to the terminal device.
[0095] As an alternative embodiment of the present invention, The sending unit 34 is further used to send recommendation request information to the recommendation server when the recommendation server is normal, the recommendation request information being for requesting to obtain recommended content corresponding to the target user; the receiving unit 31 is further used to receive second recommended content transmitted by the recommendation server; The sending unit 34 is further used to send the second recommended content to the terminal device.
[0096] As an alternative embodiment of the present invention, the processing unit 32 is specifically used to obtain status indication information of the recommended server and determine whether the recommended server is faulty based on the status indication information.
[0097] As an alternative embodiment of the present invention, the processing unit 32 is specifically used to determine that the recommendation server is faulty if no response information returned by the recommendation server is received within a predetermined response time period.
[0098] In an alternative embodiment of the present invention, the recommended content in the recommendation cache is sorted in descending order of relevance to the target user; Specifically, the acquisition unit 33 is used to determine the top first number of recommended contents in the recommendation cache, and to generate the first recommended content based on the top first number of recommended contents in the recommendation cache.
[0099] An embodiment of the present invention provides a recommendation server. Figure 4 is a schematic diagram of the configuration of the information stream server. As shown in Figure 4, the recommendation server 400: a receiving unit 41 for receiving recommendation request information sent by an information stream server, the recommendation request information being for requesting a target user to acquire recommended content corresponding to the target user; a processing unit 42 for acquiring a recommended content sequence corresponding to the target user by a preset recommendation algorithm, the recommended content sequence including a plurality of recommended contents, and the plurality of recommended contents being sorted in descending order of relevance to the target user; a transmitting unit (43) for transmitting the top first number of recommended contents of the recommended content sequence to the information stream server; and a cache manager 44 for writing the recommended content sequence into a recommendation cache corresponding to the target user.
[0100] As an alternative embodiment of the present invention, The sending unit 43 is further used for sending status indication information to the information stream server, the status indication information being for indicating whether the recommended server is out of order or not.
[0101] As an optional embodiment of the present invention, the cache management unit 44 is further used to perform a duplicate elimination process on the recommended content in the recommended content sequence based on the recommended content stored in the recommended cache corresponding to the target user and the recommended content sent to the information stream server before writing the recommended content sequence to the recommended cache corresponding to the target user.
[0102] As an optional embodiment of the present invention, the cache management unit 44 is further used to clear the recommended content in the recommendation cache corresponding to the target user when the length of time during which the information stream server does not send the recommended content corresponding to the target user to the terminal device corresponding to the target user exceeds a first length of time.
[0103] As an alternative embodiment of the present invention, the cache management unit 44 is further used to determine the capacity of cache space for storing the recommendation cache corresponding to each user based on at least one of the average number of active users of the recommendation server within the first time period, the average fault recovery time of the recommendation server, the average consumption time per recommended content, the average data amount per recommended content, and a fault tolerance factor.
[0104] As an optional embodiment of the present invention, the cache space capacity of the recommendation cache corresponding to each user is positively correlated with at least one of the average number of active users of the recommendation server within the first time length, the average fault repair time of the recommendation server, the average data amount per one of the recommended contents, or the fault tolerance factor, and is negatively correlated with the average consumption time per one of the recommended contents.
[0105] As an alternative embodiment of the present invention, the cache management unit 44 specifically calculates the average number of active users of the recommended server within the first time period, the average fault recovery time of the recommended server, the average consumption time per one of the recommended contents, the average data amount per one of the recommended contents, a fault tolerance factor, and the following formula, i.e.,
number
[0106] The information stream server and recommendation server according to this embodiment can implement the content recommendation method according to the above method embodiment, and the implementation principles and technical effects are similar, so they will not be further described here.
[0107] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device. Figure 5 is a schematic diagram of the configuration of an electronic device according to an embodiment of the present invention. As shown in Figure 5, the electronic device according to this embodiment includes a memory 501 and a processor 502, where the memory 501 is for storing a computer program, and the processor 502 executes the computer program to perform the content recommendation method according to the embodiment.
[0108] Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes the computing device to implement the content recommendation method according to the above embodiment.
[0109] Based on the same inventive concept, an embodiment of the present invention further provides a computer program product which, when executed in a computer, causes the computing device to implement the content recommendation method according to the above embodiment.
[0110] Based on the same inventive concept, an embodiment of the present invention further provides a computer program comprising instructions which, when executed by a processor, cause said processor to perform the content recommendation method according to the above embodiment.
[0111] As will be appreciated by those skilled in the art, embodiments of the present invention may be provided as a method, a system, or a computer program product. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product embodied in one or more computer-usable storage mediums containing computer-usable program code.
[0112] The processor may be a Central Processing Unit (CPU), or may be other general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.
[0113] The memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in the form of a computer-readable medium, such as read-only memory (ROM) or flash memory (flash RAM), etc. The memory is an example of a computer-readable medium.
[0114] Computer-readable media include persistent and non-persistent, removable and non-removable storage media. Storage media can implement the storage of information by any method or technology, and information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage devices, magnetic cassettes, magnetic disk storage devices or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0115] Finally, it should be noted that the above-mentioned embodiments are only used to explain the technical solutions of the present invention, and are not intended to limit the same. Although the present invention has been described in detail with reference to the above-mentioned embodiments, those skilled in the art may still modify the technical solutions described in the above-mentioned embodiments or replace some or all of the technical features therein with equivalents, and these modifications or replacements will not cause the essence of the corresponding technical solutions to depart from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A content recommendation method applied to an information stream server, comprising: receiving content request information transmitted by a terminal device, the content request information being for requesting acquisition of recommended content corresponding to the target user; determining whether a recommendation server is down; When the recommendation server is out of order, obtaining first recommended content based on a recommendation cache corresponding to the target user, wherein the recommendation cache stores a plurality of recommended contents corresponding to the target user, and the plurality of recommended contents are written when the recommendation server is not out of order, and the recommendation server is configured to, before writing the recommended content sequence into the recommendation cache corresponding to the target user, perform a duplicate elimination process on the recommended content in the recommended content sequence based on the recommended content stored in the recommendation cache corresponding to the target user and the recommended content sent to the information stream server; and transmitting the first recommended content to the terminal device.
2. If the recommendation server is normal, sending recommendation request information to the recommendation server, the recommendation request information being for requesting to obtain recommended content corresponding to the target user; receiving second recommended content sent by the recommendation server; The method of claim 1 , further comprising: transmitting the second recommended content to the terminal device.
3. Determining whether the recommendation server is down includes: obtaining status indication information of the recommended server; and determining whether the recommendation server has failed based on the status indication information.
4. Determining whether the recommendation server is down includes:
2. The method of claim 1, further comprising determining that the recommendation server has failed if response information returned by the recommendation server is not received within a predetermined response time period.
5. The recommended content in the recommendation cache is sorted in descending order of relevance to the target user, and obtaining first recommended content based on the recommendation cache corresponding to the target user includes: determining a top number of recommended content in the recommendation cache; and generating the first recommended content based on a first number of top recommended content in the recommendation cache.
6. A content recommendation method applied to a recommendation server, comprising: receiving recommendation request information sent by an information stream server, the recommendation request information being for requesting to obtain recommended content corresponding to the target user; Obtaining a recommended content sequence corresponding to the target user through a preset recommendation algorithm, wherein the recommended content sequence includes a plurality of recommended contents, and the plurality of recommended contents are sorted in descending order of relevance to the target user; performing a duplicate elimination process on the recommended content in the recommended content sequence based on the recommended content stored in a recommendation cache corresponding to the target user and the recommended content transmitted to the information stream server; a second number of recommended contents of the recommended content sequence being the top two in the recommended content sequence to the information stream server; and a second number of recommended contents of the recommended content sequence being written into a recommendation cache corresponding to the target user.
7. 7. The method of claim 6, further comprising sending status indication information to the information stream server, the status indication information being for indicating whether the recommendation server has failed.
8. 7. The method of claim 6, further comprising: clearing the recommended content in the recommendation cache corresponding to the target user when a length of time during which the information stream server has not sent the recommended content corresponding to the target user to the terminal device corresponding to the target user exceeds a first length of time.
9. The method of claim 6, further comprising determining a capacity of cache space for storing a recommendation cache corresponding to each user based on at least one of the average number of active users of the recommendation server within a first period of time, the average time to repair a failure of the recommendation server, the average consumption time per piece of the recommended content, the average amount of data per piece of the recommended content, and a fault tolerance factor.
10. The method of claim 9, wherein the capacity of cache space of the recommendation cache corresponding to each user is positively correlated with at least one of the average number of active users of the recommendation server within the first time period, the average time to repair a failure of the recommendation server, the average amount of data per piece of recommended content, or a fault tolerance factor, and is negatively correlated with the average length of time spent per piece of recommended content.
11. determining a capacity of a cache space for storing a recommendation cache corresponding to each user based on at least one of an average number of active users of the recommendation server within the first time period, an average time to repair a failure of the recommendation server, an average consumption time per one of the recommended contents, an average amount of data per one of the recommended contents, and a fault tolerance factor; the average number of active users of the recommendation server within the first time period, the average fault recovery time of the recommendation server, the average consumption time per one of the recommended contents, the average data amount per one of the recommended contents, a fault tolerance factor, and the following formula: [Equation 1] and determining a capacity of cache space for storing a recommendation cache corresponding to each user based on the first time length, where CacheSize is the capacity of cache space for storing a recommendation cache corresponding to each user, TTR is the mean time to repair of the recommendation server, T is the average consumption time per one of the recommended contents, S is the average amount of data per one of the recommended contents, AU is the average number of active users of the recommendation server within the first time length, and F is a fault tolerance factor.
12. a receiving unit for receiving recommendation request information transmitted by an information stream server, the recommendation request information being for requesting a target user to acquire recommended content; a processing unit for acquiring a recommended content sequence corresponding to the target user by a preset recommendation algorithm, the recommended content sequence including a plurality of recommended contents, and the plurality of recommended contents being sorted in descending order of relevance to the target user; a transmitter for transmitting a second highest number of recommended contents of the recommended content sequence to the information stream server; A recommendation server including a cache management unit for performing a duplicate removal process on the recommended content in the recommended content sequence based on the recommended content stored in the recommendation cache corresponding to the target user and the recommended content transmitted to the information stream server, and for writing the recommended content sequence into the recommendation cache corresponding to the target user.
13. Memory and a processor coupled to said memory and configured to implement the content recommendation method of any one of claims 1 to 11 based on instructions stored in said memory.
14. A computer-readable storage medium having stored thereon a computer program that, when executed by a computing device, causes the computing device to implement the content recommendation method according to any one of claims 1 to 11.
15. A computer program comprising instructions which, when executed by a processor, cause the processor to perform the content recommendation method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Video recommendation method and device and server
CN109729432A
Content recommendation method and device, server and computer readable storage medium
CN113268666A
Information processing apparatus, information processing system, information processing method, program, and storage medium
JP2014149645A