[go: up one dir, main page]

CN106161569A - The recommendation of Web content, buffer replacing method and equipment - Google Patents

The recommendation of Web content, buffer replacing method and equipment Download PDF

Info

Publication number
CN106161569A
CN106161569A CN201510202934.8A CN201510202934A CN106161569A CN 106161569 A CN106161569 A CN 106161569A CN 201510202934 A CN201510202934 A CN 201510202934A CN 106161569 A CN106161569 A CN 106161569A
Authority
CN
China
Prior art keywords
content
recommendation
queue
popularity
recommended
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.)
Granted
Application number
CN201510202934.8A
Other languages
Chinese (zh)
Other versions
CN106161569B (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.)
XFusion Digital Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510202934.8A priority Critical patent/CN106161569B/en
Publication of CN106161569A publication Critical patent/CN106161569A/en
Application granted granted Critical
Publication of CN106161569B publication Critical patent/CN106161569B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

本发明实施例提供一种网络内容的推荐、缓存替换方法和设备,CDN通过向推荐系统发送缓存内容队列中的缓存内容的标识,以便推荐系统在向用户推荐内容时,会根据CDN发送的缓存内容生成推荐结果,从而确保推荐系统推荐给用户的推荐结果尽可能的在CDN的缓存内容队列中,而不需要从用户请求的内容所在的原始服务器获取,减少了用户等待的时间,并且可以减少CDN的回源带宽的占用。推荐系统也会根据推荐结果生成全体内容的推荐热度,并将全体内容的推荐热度发送给CDN,以便于CDN在进行缓存替换时考虑到推荐热度,从而尽可能地把推荐热度高的内容保留在缓存中,使用户可以更快的获取推荐系统所推荐的内容。

Embodiments of the present invention provide a network content recommendation and cache replacement method and device. The CDN sends the identifier of the cached content in the cached content queue to the recommender system, so that the recommender system will use the cached content sent by the CDN when recommending content to the user. The content generates recommendation results, so as to ensure that the recommendation results recommended by the recommendation system to the user are in the cache content queue of the CDN as much as possible, and do not need to be obtained from the original server where the content requested by the user is located, which reduces the waiting time of the user and can reduce CDN back-to-source bandwidth usage. The recommendation system will also generate the recommendation heat of all content based on the recommendation results, and send the recommendation heat of all content to the CDN, so that the CDN can take the recommendation heat into consideration when performing cache replacement, and keep the content with high recommendation heat in the CDN as much as possible. In the cache, users can get the content recommended by the recommendation system faster.

Description

网络内容的推荐、缓存替换方法和设备Recommendation, cache replacement method and device for web content

技术领域technical field

本发明实施例涉及网络内容推荐技术,尤其涉及一种网络内容的推荐、缓存替换方法和设备。The embodiment of the present invention relates to network content recommendation technology, and in particular to a method and device for network content recommendation and cache replacement.

背景技术Background technique

互联网的出现和普及给用户带来了大量的信息,满足了用户在信息时代对信息的需求,但随着网络的迅速发展而带来的网上信息量的大幅增长,使得用户在面对大量信息时无法从中获得对自己真正有用的那部分信息,对信息的使用效率反而降低了,即所谓的信息超载(informationoverload)问题。解决信息超载问题一个非常有潜力的办法是推荐系统(RecommendationSystems,简称RS),推荐系统用于根据用户的信息需求、兴趣等,将用户感兴趣的信息、产品等推荐给用户。The emergence and popularization of the Internet has brought a large amount of information to users, which has met the needs of users for information in the information age. Sometimes you can't get the part of the information that is really useful to you, and the efficiency of using the information is reduced, which is the so-called information overload (information overload) problem. A very potential way to solve the problem of information overload is Recommendation Systems (referred to as RS). The recommendation system is used to recommend the information and products that the user is interested in to the user according to the user's information needs and interests.

内容分发网络(Content delivery network或Content distribution network,常缩写为CDN)是一种在因特网(Internet)上构建的分布式服务器系统,该系统包含多个数据中心,其目的是使网络内容更快、更稳定的传输给用户,降低网络时延,提升用户体验。CDN节点会部署在多个地点、多个不同的网络上,这样可以减少用户和网络内容之间传输所需的流量,进而可以降低带宽成本,并且CDN节点之间也会动态的互相传输内容,并对用户的下载行为进行优化,借此减少网络内容供应者所需要的带宽成本,改善用户的下载速度,提高系统的稳定性。Content distribution network (Content delivery network or Content distribution network, often abbreviated as CDN) is a distributed server system built on the Internet (Internet), which includes multiple data centers, and its purpose is to make network content faster, More stable transmission to users, reducing network delay and improving user experience. CDN nodes will be deployed in multiple locations and on multiple different networks, which can reduce the traffic required for transmission between users and network content, thereby reducing bandwidth costs, and CDN nodes will also dynamically transmit content to each other. And optimize the user's download behavior, thereby reducing the bandwidth cost required by the network content provider, improving the user's download speed, and improving the stability of the system.

目前现有的网络系统中推荐系统和CDN系统独立工作,这样会造成推荐系统所推荐的内容可能不在CDN缓存中,从而使得用户向CDN边缘服务器请求网络内容时,CDN需要回源获取网络内容,即CDN边缘服务器需要先从网络内容所在的服务器中将网络内容获取到CDN缓存中,然后,CDN边缘服务器在将网络内容发送给用户,CDN回源获取网络内容会导致用户等待时间长、占用CDN回源带宽等。In the existing network system, the recommendation system and the CDN system work independently, which may cause the content recommended by the recommendation system to not be in the CDN cache, so that when the user requests network content from the CDN edge server, the CDN needs to go back to the source to obtain the network content. That is, the CDN edge server needs to first obtain the network content from the server where the network content is located in the CDN cache, and then, the CDN edge server sends the network content to the user, and the CDN returns to the source to obtain the network content, which will cause the user to wait for a long time and occupy the CDN Back-to-source bandwidth, etc.

发明内容Contents of the invention

本发明实施例提供一种网络内容的推荐、缓存替换方法和设备,已解决推荐系统向用户推荐的内容不在CDN缓存中,导致用户等待时间长的问题。Embodiments of the present invention provide a network content recommendation and cache replacement method and device, which have solved the problem that the content recommended by the recommendation system to the user is not in the CDN cache, resulting in long waiting time for the user.

本发明第一方面提供一种网络内容的推荐方法,包括:The first aspect of the present invention provides a method for recommending network content, including:

推荐系统接收内容分发网络CDN发送的缓存内容队列中的缓存内容的标识,根据所述缓存内容的标识和全体内容库获取所述缓存内容的信息,将所述缓存内容的标识和所述缓存内容的信息添加到缓存内容库;The recommendation system receives the identifier of the cached content in the cached content queue sent by the content distribution network CDN, obtains the information of the cached content according to the identifier of the cached content and the entire content library, and combines the identifier of the cached content with the cached content The information added to the cache content library;

当所述推荐系统接收到客户端发送的推荐请求消息时,所述推荐系统根据预先获取的用户兴趣特征和所述全体内容库,采用第一推荐算法计算得到第一推荐结果;When the recommendation system receives the recommendation request message sent by the client, the recommendation system uses the first recommendation algorithm to calculate the first recommendation result according to the pre-acquired user interest characteristics and the entire content library;

所述推荐系统根据所述缓存内容库获取第二推荐结果;The recommendation system acquires a second recommendation result according to the cached content library;

所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果;The recommendation system fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result;

所述推荐系统将所述目标推荐结果推送给目标用户。The recommendation system pushes the target recommendation result to the target user.

结合第一方面,在第一方面的第一种可能的实现方式中,所述推荐系统根据所述缓存内容库获取第二推荐结果,包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, the recommendation system obtains the second recommendation result according to the cached content library, including:

所述推荐系统根据所述用户兴趣特征和所述缓存内容库,采用第二推荐算法计算得到所述第二推荐结果。The recommendation system calculates the second recommendation result by using a second recommendation algorithm according to the user interest characteristics and the cached content library.

结合第一方面,在第一方面的第二种可能的实现方式中,所述推荐系统根据所述缓存内容库获取第二推荐结果,包括:With reference to the first aspect, in a second possible implementation of the first aspect, the recommendation system acquires a second recommendation result according to the cached content library, including:

所述推荐系统从所述第一推荐结果选择属于所述缓存内容库的推荐内容,将所选择的推荐内容作为所述第二推荐结果。The recommendation system selects recommended content belonging to the cached content library from the first recommendation result, and takes the selected recommended content as the second recommendation result.

结合第一方面、第一方面的第一种至第二种可能的实现方式中的任一一种,在第一方面的第三种可能的实现方式中,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,包括:In combination with the first aspect, any one of the first to second possible implementations of the first aspect, in the third possible implementation of the first aspect, the recommendation system integrates The algorithm fuses the first recommendation result and the second recommendation result to obtain a target recommendation result, including:

所述推荐系统确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;The recommendation system determines common recommendation content in the first recommendation result and the second recommendation result;

所述推荐系统从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;The recommendation system deletes the common recommendation content from the first recommendation result to obtain a third recommendation result;

所述推荐系统根据推荐内容的得分,对所述第二推荐结果和所述第三推荐结果中的推荐内容统一进行排序;The recommendation system uniformly sorts the recommended content in the second recommendation result and the third recommendation result according to the score of the recommended content;

所述推荐系统将排序后的推荐内容作为所述目标推荐结果,或者,所述推荐系统按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。The recommendation system takes the sorted recommended content as the target recommendation result, or the recommendation system selects part of the recommended content from the sorted recommended content according to a preset algorithm as the target recommendation result.

结合第一方面、第一方面的第一种至第二种可能的实现方式中的任一一种,在第一方面的第四种可能的实现方式中,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,包括:In combination with the first aspect, any one of the first to second possible implementations of the first aspect, in the fourth possible implementation of the first aspect, the recommendation system integrates The algorithm fuses the first recommendation result and the second recommendation result to obtain a target recommendation result, including:

所述推荐系统确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;The recommendation system determines common recommendation content in the first recommendation result and the second recommendation result;

所述推荐系统从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;The recommendation system deletes the common recommendation content from the first recommendation result to obtain a third recommendation result;

所述推荐系统从所述第三推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;The recommendation system selects a%*k recommended content from the third recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100;

所述推荐系统从所述第二推荐结果中选择(1-a%)*k个推荐内容;The recommendation system selects (1-a%)*k recommended content from the second recommendation result;

所述推荐系统根据推荐内容的得分,对从所述第三推荐结果中选择的推荐内容和从所述第二推荐结果中选择的推荐内容进行统一排序,将统一排序后的推荐内容作为所述目标推荐结果。The recommendation system uniformly sorts the recommended content selected from the third recommendation result and the recommended content selected from the second recommendation result according to the scores of the recommended content, and uses the unified sorted recommended content as the Target recommendation results.

结合第一方面的第四种可能的实现方式,在第一方面的第五种可能的实现方式中,所述推荐系统从所述第三推荐结果中选择a%*k个推荐内容,包括:With reference to the fourth possible implementation of the first aspect, in a fifth possible implementation of the first aspect, the recommendation system selects a%*k recommended content from the third recommendation result, including:

所述推荐系统根据推荐内容的得分对所述第三推荐结果中的推荐内容进行排序,从排序后的所述第三推荐结果中选择排序在前的a%*k个推荐内容;The recommendation system sorts the recommended content in the third recommendation result according to the score of the recommended content, and selects the top a%*k recommended content from the sorted third recommendation result;

所述推荐系统从所述第二推荐结果中选择(1-a%)*k个推荐内容,包括:The recommendation system selects (1-a%)*k recommended content from the second recommendation result, including:

所述推荐系统根据推荐内容的得分对所述第二推荐结果中的推荐内容进行排序,从排序后的所述第二推荐结果中选择排序在前的(1-a%)*k个推荐内容。The recommendation system sorts the recommended content in the second recommendation result according to the score of the recommended content, and selects the top (1-a%)*k recommended content from the sorted second recommendation result .

结合第一方面的第三种至第五种可能的实现方式中的任一一种,在第一方面的第六种可能的实现方式中,所述推荐系统从所述第一推荐结果中删除所述共同的推荐内容之后,所述方法还包括:With reference to any one of the third to fifth possible implementations of the first aspect, in a sixth possible implementation of the first aspect, the recommendation system deletes from the first recommendation results After the common recommended content, the method also includes:

所述推荐系统提高所述第二推荐结果中包括的所述共同的推荐内容的得分。The recommendation system increases the score of the common recommended content included in the second recommendation result.

结合第一方面、第一方面的第一种至第二种可能的实现方式中的任一一种,在第一方面的第七种可能的实现方式中,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,包括:In combination with the first aspect, any one of the first to second possible implementations of the first aspect, in the seventh possible implementation of the first aspect, the recommendation system integrates The algorithm fuses the first recommendation result and the second recommendation result to obtain a target recommendation result, including:

所述推荐系统确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;The recommendation system determines common recommendation content in the first recommendation result and the second recommendation result;

所述推荐系统从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;The recommendation system deletes the common recommendation content from the second recommendation result to obtain a fourth recommendation result;

所述推荐系统根据推荐内容的得分,对所述第一推荐结果和所述第四推荐结果中的推荐内容统一进行排序;The recommendation system uniformly sorts the recommended content in the first recommendation result and the fourth recommendation result according to the score of the recommended content;

所述推荐系统将排序后的推荐内容作为所述目标推荐结果,或者,所述推荐系统按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。The recommendation system takes the sorted recommended content as the target recommendation result, or the recommendation system selects part of the recommended content from the sorted recommended content according to a preset algorithm as the target recommendation result.

结合第一方面、第一方面的第一种至第二种可能的实现方式中的任一一种,在第一方面的第八种可能的实现方式中,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,包括:In combination with the first aspect, any one of the first to second possible implementations of the first aspect, in the eighth possible implementation of the first aspect, the recommendation system integrates The algorithm fuses the first recommendation result and the second recommendation result to obtain a target recommendation result, including:

所述推荐系统确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;The recommendation system determines common recommendation content in the first recommendation result and the second recommendation result;

所述推荐系统从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;The recommendation system deletes the common recommendation content from the second recommendation result to obtain a fourth recommendation result;

所述推荐系统从所述第一推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;The recommendation system selects a%*k recommended content from the first recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100;

所述推荐系统从所述第四推荐结果中选择(1-a%)*k个推荐内容;The recommendation system selects (1-a%)*k recommended content from the fourth recommendation result;

所述推荐系统根据推荐内容的得分,对从所述第一推荐结果中选择的推荐内容和从所述第四推荐结果中选择的推荐内容进行统一排序,并将统一排序后的推荐内容作为所述目标推荐结果。The recommendation system uniformly sorts the recommended content selected from the first recommendation result and the recommended content selected from the fourth recommendation result according to the scores of the recommended content, and uses the unified sorted recommended content as the recommended content. The target recommendation results.

结合第一方面的第八种可能的实现方式,在第一方面的第九种可能的实现方式中,所述推荐系统从所述第一推荐结果中选择a%*k个推荐内容,包括:With reference to the eighth possible implementation of the first aspect, in the ninth possible implementation of the first aspect, the recommendation system selects a%*k recommended content from the first recommendation result, including:

所述推荐系统根据推荐内容的得分对所述第一推荐结果中的推荐内容进行排序,从排序后的所述第一推荐结果中选择排序在前的a%*k个推荐内容;The recommendation system sorts the recommended content in the first recommendation result according to the score of the recommended content, and selects the top a%*k recommended content from the sorted first recommendation result;

所述推荐系统从所述第四推荐结果中选择(1-a%)*k个推荐内容,包括:The recommendation system selects (1-a%)*k recommended content from the fourth recommendation result, including:

所述推荐系统根据推荐内容的得分对所述第四推荐结果中的推荐内容进行排序,从排序后的所述第四推荐结果中选择(1-a%)*k个推荐内容。The recommendation system sorts the recommended content in the fourth recommendation result according to the score of the recommended content, and selects (1-a%)*k recommended content from the sorted fourth recommendation result.

结合第一方面的第七种至第九种可能的实现方式中的任一一种,在第一方面的第十种可能的实现方式中,所述推荐系统从所述第二推荐结果中删除所述共同的推荐内容之后,所述方法还包括:With reference to any one of the seventh to ninth possible implementations of the first aspect, in a tenth possible implementation of the first aspect, the recommendation system deletes from the second recommendation results After the common recommended content, the method also includes:

所述推荐系统提高所述第一推荐结果中包括的所述共同的推荐内容的得分。The recommendation system increases the score of the common recommended content included in the first recommendation result.

结合第一方面、第一方面的第一种至第二种可能的实现方式中的任一一种,在第一方面的第十一种可能的实现方式中,所述方法还包括:In combination with the first aspect, any one of the first to second possible implementations of the first aspect, in the eleventh possible implementation of the first aspect, the method further includes:

所述推荐系统根据所述全体内容库中的全体内容的推荐情况生成推荐热度库,所述推荐热度库中包括所述全体内容库中的全体内容在预设时间内的推荐热度;The recommendation system generates a recommendation popularity library according to the recommendation situation of all the contents in the entire content library, and the recommendation popularity library includes the recommendation popularity of all the contents in the entire content library within a preset time;

所述推荐系统将推荐热度库中的所有内容发送给所述CDN。The recommendation system sends all the content in the recommended popularity library to the CDN.

结合第一方面的第十一种可能的实现方式,在第一方面的第十二种可能的实现方式中,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果之后,所述方法还包括:With reference to the eleventh possible implementation manner of the first aspect, in a twelfth possible implementation manner of the first aspect, the recommendation system performs a calculation of the first recommendation result and the second recommendation result according to a preset fusion algorithm. The two recommendation results are fused, and after the target recommendation result is obtained, the method further includes:

所述推荐系统根据所述目标推荐结果更新所述推荐热度库。The recommendation system updates the recommendation popularity library according to the target recommendation result.

结合第一方面、第一方面的第一种至第十二种可能的实现方式中的任一一种,在第一方面的第十三种可能的实现方式中,所述CDN发送的缓存内容为所述缓存内容队列的前P%的内容,或者,为所述缓存内容队列的前P%的内容相对于上次发送的内容的增量数据,其中,P为大于0小于100。In combination with the first aspect and any one of the first to twelfth possible implementations of the first aspect, in the thirteenth possible implementation of the first aspect, the cached content sent by the CDN It is the content of the top P% of the cache content queue, or the incremental data of the content of the top P% of the cache content queue relative to the content sent last time, where P is greater than 0 and less than 100.

本发明第二方面提供一种网络内容的缓存替换方法,包括:The second aspect of the present invention provides a cache replacement method for network content, including:

内容分发网络CDN边缘服务器获取缓存内容队列中的缓存内容的推荐热度和访问热度;The content distribution network CDN edge server obtains the recommendation popularity and access popularity of the cached content in the cached content queue;

所述CDN边缘服务器根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换。The CDN edge server performs cache replacement on the cache content queue according to the access popularity and recommendation popularity of the cache content in the cache content queue.

结合第二方面,在第二方面的第一种可能的实现方式中,所述CDN边缘服务器根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换,包括:With reference to the second aspect, in a first possible implementation manner of the second aspect, the CDN edge server performs cache replacement on the cache content queue according to the access popularity and recommendation popularity of the cache content in the cache content queue, include:

若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则所述CDN边缘服务器确定对所述缓存内容队列的队尾访问热度较小的缓存内容进行淘汰;If the size of the cached content in the cached content queue is greater than or equal to the first threshold, the CDN edge server determines to eliminate the cached content at the end of the cached content queue with less popular access;

所述CDN边缘服务器比较所述缓存内容队列的队尾具有相同访问热度的缓存内容的推荐热度,淘汰所述具有相同访问热度的缓存内容中推荐热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于或等于所述第一阈值。The CDN edge server compares the recommended popularity of the cached content with the same access popularity at the tail of the cache content queue, and eliminates the cache content with the lower recommended popularity among the cache contents with the same access popularity, until the cache content queue If the size of the cached content in the queue is smaller than a second threshold, the elimination of the cached content queue is stopped, and the second threshold is smaller than or equal to the first threshold.

结合第二方面,在第二方面的第二种可能的实现方式中,所述CDN边缘服务器根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换,包括:With reference to the second aspect, in a second possible implementation manner of the second aspect, the CDN edge server performs cache replacement on the cached content queue according to the access popularity and recommendation popularity of the cached content in the cached content queue, include:

若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则所述CDN边缘服务器确定对所述缓存内容队列的队尾的访问热度较小的缓存内容进行淘汰;If the size of the cached content in the cached content queue is greater than or equal to the first threshold, the CDN edge server determines to eliminate the cached content at the queue tail of the cached content queue with less popular access;

所述CDN边缘服务器根据所述缓存内容队列的队尾的缓存内容的访问热度和推荐热度,计算所述缓存内容队列的队尾中缓存内容的综合热度;The CDN edge server calculates the comprehensive popularity of the cache content at the tail of the cache content queue according to the access popularity and recommendation popularity of the cache content at the tail of the cache content queue;

所述CDN边缘服务器淘汰所述缓存内容队列的队尾中综合热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于等于所述第一阈值。The CDN edge server eliminates cached content with low overall popularity in the tail of the cached content queue until the size of the cached content in the cached content queue is smaller than a second threshold, then stops eliminating the cached content queue , the second threshold is less than or equal to the first threshold.

结合第二方面,在第二方面的第三种可能的实现方式中,所述CDN边缘服务器获取缓存内容队列中的缓存内容的推荐热度和访问热度,包括:With reference to the second aspect, in a third possible implementation manner of the second aspect, the CDN edge server obtains the recommendation popularity and access popularity of the cached content in the cached content queue, including:

所述CDN边缘服务器根据所述缓存内容队列中的缓存内容的历史访问情况生成所述缓存内容队列中的缓存内容的访问热度;The CDN edge server generates the access heat of the cached content in the cached content queue according to the historical access conditions of the cached content in the cached content queue;

所述CDN边缘服务器接收推荐系统发送的所述缓存内容队列中的缓存内容的推荐热度,所述缓存内容队列中的缓存内容的推荐热度是所述推荐系统根据所述缓存内容队列中的缓存内容的推荐情况生成的。The CDN edge server receives the recommendation heat of the cache content in the cache content queue sent by the recommendation system, and the recommendation heat of the cache content in the cache content queue is the recommendation system according to the cache content in the cache content queue generated by the recommendations.

结合第二方面、第二方面的第一种至第三种可能的实现方式中任一一种,在第二方面的第四种可能的实现方式中,所述方法还包括:In combination with the second aspect, any one of the first to third possible implementations of the second aspect, in a fourth possible implementation of the second aspect, the method further includes:

所述CDN边缘服务器获取候选内容队列中的候选内容的推荐热度和访问热度;The CDN edge server acquires recommendation popularity and access popularity of candidate content in the candidate content queue;

所述CDN边缘服务器根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换。The CDN edge server performs cache replacement on the candidate content queue according to the recommendation popularity and access popularity of the candidate content in the candidate content queue.

结合第二方面的第四种可能的实现方式,在第二方面的第五种可能的实现方式中,所述CDN边缘服务器根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换,包括:With reference to the fourth possible implementation manner of the second aspect, in a fifth possible implementation manner of the second aspect, the CDN edge server evaluates the The above candidate content queues are used for cache replacement, including:

若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则所述CDN边缘服务器确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;If the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, the CDN edge server determines to eliminate the candidate content at the tail of the candidate content queue that has less popular access;

所述CDN边缘服务器比较所述候选内容队列中具有相同访问热度的候选内容的推荐热度,淘汰所述具有相同访问热度的候选内容中推荐热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。The CDN edge server compares the recommendation popularity of the candidate content with the same access popularity in the candidate content queue, and eliminates the candidate content with the lower recommendation popularity among the candidate content with the same access popularity, until the candidate content in the candidate content queue If the size of the candidate content is smaller than a fourth threshold, the elimination of the candidate content queue is stopped, and the fourth threshold is smaller than or equal to the third threshold.

结合第二方面的第四种可能的实现方式,在第二方面的第六种可能的实现方式中,所述CDN边缘服务器根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换,包括:With reference to the fourth possible implementation manner of the second aspect, in a sixth possible implementation manner of the second aspect, the CDN edge server evaluates the The above candidate content queues are used for cache replacement, including:

若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则所述CDN边缘服务器确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;If the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, the CDN edge server determines to eliminate the candidate content at the tail of the candidate content queue that has less popular access;

所述CDN边缘服务器根据所述候选内容队列的队尾中候选内容的访问热度和推荐热度,计算所述候选内容队列的队尾中候选内容的综合热度;The CDN edge server calculates the comprehensive popularity of the candidate content in the queue tail of the candidate content queue according to the access popularity and recommendation popularity of the candidate content in the queue tail of the candidate content queue;

所述CDN边缘服务器淘汰所述候选内容队列的队尾中候选内容的综合热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。The CDN edge server eliminates the candidate content with lower comprehensive popularity of the candidate content in the tail of the candidate content queue until the size of the candidate content in the candidate content queue is smaller than the fourth threshold, then stops processing the candidate content The queue is eliminated, and the fourth threshold is less than or equal to the third threshold.

结合第二方面的第四种可能的实现方式,在第二方面的第七种可能的实现方式中,所述CDN边缘服务器获取候选内容队列中的候选内容的推荐热度和访问热度,包括:With reference to the fourth possible implementation manner of the second aspect, in the seventh possible implementation manner of the second aspect, the CDN edge server obtains the recommendation popularity and access popularity of the candidate content in the candidate content queue, including:

所述CDN边缘服务器根据所述候选内容队列中的候选内容的历史访问情况生成所述候选内容队列中的候选内容的访问热度;The CDN edge server generates the access heat of the candidate content in the candidate content queue according to the historical access conditions of the candidate content in the candidate content queue;

所述推荐系统接收推荐系统发送的所述候选内容的推荐热度,所述候选内容的推荐热度是所述推荐系统根据所述候选内容的推荐情况生成的。The recommendation system receives the recommendation popularity of the candidate content sent by the recommendation system, and the recommendation popularity of the candidate content is generated by the recommendation system according to the recommendation situation of the candidate content.

本发明第三方面提供一种网络内容的缓存替换方法,包括:A third aspect of the present invention provides a cache replacement method for network content, including:

CDN的边缘服务器接收客户端发送的内容获取请求,所述内容获取请求中包括待访问内容的标识信息;The edge server of the CDN receives the content acquisition request sent by the client, and the content acquisition request includes identification information of the content to be accessed;

所述CDN边缘服务器根据所述待访问内容的标识信息确定所述待访问内容是否在自己的缓存内容队列中;The CDN edge server determines whether the content to be accessed is in its cache content queue according to the identification information of the content to be accessed;

若所述待访问内容在所述缓存内容队列中,则所述CDN边缘服务器向所述客户端返回所述待访问内容;If the content to be accessed is in the cached content queue, the CDN edge server returns the content to be accessed to the client;

所述CDN边缘服务器更新所述待访问内容的访问热度,并根据所述待访问内容的访问热度和推荐热度计算所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述缓存内容队列;The CDN edge server updates the access popularity of the content to be accessed, and calculates the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed, and updates the Cache content queue;

当需要对所述缓存内容队列进行缓存替换时,所述CDN边缘服务器根据所述缓存内容队列中缓存内容的热度信息,淘汰所述缓存内容队列中热度较小的缓存内容。When it is necessary to perform cache replacement on the cached content queue, the CDN edge server eliminates less popular cached content in the cached content queue according to the popularity information of the cached content in the cached content queue.

结合第三方面,在第三方面的第一种可能的实现方式中,若所述待访问内容的标识信息不在所述缓存内容队列中,所述CDN边缘服务器根据所述待访问内容的标识信息确定所述待访问内容是否在所述CDN边缘服务器的候选内容队列中;With reference to the third aspect, in a first possible implementation manner of the third aspect, if the identification information of the content to be accessed is not in the cached content queue, the CDN edge server Determine whether the content to be accessed is in the candidate content queue of the CDN edge server;

若所述待访问内容在所述候选内容队列中,则所述CDN边缘服务器更新所述待访问内容的访问热度,根据所述待访问内容的访问热度和推荐热度确定所述待访问内容的热度信息;If the content to be accessed is in the candidate content queue, the CDN edge server updates the access popularity of the content to be accessed, and determines the popularity of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed information;

所述CDN边缘服务器根据所述待访问内容的热度信息判断所述待访问内容的热度是否大于预设的热度阈值;The CDN edge server determines whether the popularity of the content to be accessed is greater than a preset popularity threshold according to the popularity information of the content to be accessed;

若所述待访问内容的热度大于所述热度阈值,则所述CDN边缘服务器将所述待访问内容添加到所述缓存内容队列中,并从所述候选内容队列中删除所述待访问内容;If the popularity of the content to be accessed is greater than the popularity threshold, the CDN edge server adds the content to be accessed to the cache content queue, and deletes the content to be accessed from the candidate content queue;

所述CDN边缘服务器向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。The CDN edge server returns to the client the IP address of the original server where the content server to be accessed is located.

结合第三方面,在第三方面的第二种可能的实现方式中,若所述待访问内容不在所述候选内容队列中,所述CDN边缘服务器将所述待访问内容添加到所述候选内容队列中;With reference to the third aspect, in a second possible implementation manner of the third aspect, if the content to be accessed is not in the candidate content queue, the CDN edge server adds the content to be accessed to the candidate content in the queue;

所述CDN边缘服务器更新所述待访问内容的访问热度,根据所述待访问内容的热度和所述待访问内容的推荐热度确定所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述候选内容队列;The CDN edge server updates the access popularity of the content to be accessed, determines the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed, and determines the popularity information of the content to be accessed according to the popularity of the content to be accessed information to update the candidate content queue;

所述CDN边缘服务器向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。The CDN edge server returns to the client the IP address of the original server where the content server to be accessed is located.

结合第三方面,在第三方面的第三种可能的实现方式中,若所述待访问内容的热度小于或等于所述热度阈值,则所述CDN边缘服务器根据所述待访问内容的热度信息更新所述候选内容队列;With reference to the third aspect, in a third possible implementation manner of the third aspect, if the popularity of the content to be accessed is less than or equal to the popularity threshold, the CDN edge server, according to the popularity information of the content to be accessed updating the candidate content queue;

所述CDN边缘服务器向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。The CDN edge server returns to the client the IP address of the original server where the content server to be accessed is located.

结合第三方面、以及第三方面的第一种至第三种可能的实现,在第三方面的第四种可能的实现方式中,所述方法还包括:In combination with the third aspect and the first to third possible implementations of the third aspect, in a fourth possible implementation of the third aspect, the method further includes:

当需要对所述候选内容队列进行缓存替换时,所述CDN边缘服务器根据所述候选内容队列中候选内容的热度信息,淘汰所述候选内容队列中热度较小的候选内容。When it is necessary to cache and replace the candidate content queue, the CDN edge server eliminates less popular candidate content in the candidate content queue according to the popularity information of the candidate content in the candidate content queue.

本发明第四方面提供一种推荐系统,包括:A fourth aspect of the present invention provides a recommendation system, including:

接收模块,用于接收内容分发网络CDN发送的缓存内容队列中的缓存内容的标识,根据所述缓存内容的标识和全体内容库获取所述缓存内容的信息,将所述缓存内容的标识和所述缓存内容的信息添加到缓存内容库;The receiving module is configured to receive the identifier of the cached content in the cached content queue sent by the content distribution network CDN, obtain the information of the cached content according to the identifier of the cached content and the entire content library, and combine the identifier of the cached content with the Add the information about the cached content to the cached content repository;

推荐模块,用于当所述推荐系统接收到客户端发送的推荐请求消息时,根据预先获取的用户兴趣特征和所述全体内容库,采用第一推荐算法计算得到第一推荐结果;A recommendation module, configured to use a first recommendation algorithm to calculate a first recommendation result according to the pre-acquired user interest characteristics and the entire content library when the recommendation system receives a recommendation request message sent by the client;

所述推荐模块,还用于根据所述缓存内容库获取第二推荐结果;The recommendation module is further configured to obtain a second recommendation result according to the cached content library;

融合模块,用于根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果;a fusion module, configured to fuse the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result;

发送模块,用于将所述目标推荐结果推送给目标用户。A sending module, configured to push the target recommendation result to the target user.

结合第四方面,在第四方面的第一种可能的实现方式中,所述推荐模块根据所述缓存内容库获取第二推荐结果,具体为:With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the recommendation module acquires a second recommendation result according to the cached content library, specifically:

根据所述用户兴趣特征和所述缓存内容库,采用第二推荐算法计算得到所述第二推荐结果。According to the user interest feature and the cached content library, the second recommendation result is calculated by using a second recommendation algorithm.

结合第四方面,在第四方面的第二种可能的实现方式中,所述推荐模块根据所述缓存内容库获取第二推荐结果,具体为:With reference to the fourth aspect, in a second possible implementation manner of the fourth aspect, the recommendation module acquires a second recommendation result according to the cached content library, specifically:

从所述第一推荐结果选择属于所述缓存内容库的推荐内容,将所选择的推荐内容作为所述第二推荐结果。Select recommended content belonging to the cached content library from the first recommended result, and use the selected recommended content as the second recommended result.

结合第四方面、第四方面的第一种至第二种可能的实现方式中的任一一种,在第四方面的第三种可能的实现方式中,所述融合模块具体用于:In combination with the fourth aspect, any one of the first to second possible implementations of the fourth aspect, in the third possible implementation of the fourth aspect, the fusion module is specifically used for:

确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;determining common recommended content in the first recommendation result and the second recommendation result;

从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;deleting the common recommendation content from the first recommendation result to obtain a third recommendation result;

根据推荐内容的得分,对所述第二推荐结果和所述第三推荐结果中的推荐内容统一进行排序;According to the score of the recommended content, the recommended content in the second recommended result and the third recommended result is uniformly sorted;

将排序后的推荐内容作为所述目标推荐结果,或者,按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。The sorted recommended content is used as the target recommendation result, or part of the recommended content is selected from the sorted recommended content according to a preset algorithm as the target recommendation result.

结合第四方面、第四方面的第一种至第二种可能的实现方式中的任一一种,在第四方面的第四种可能的实现方式中,所述融合模块具体用于:In combination with the fourth aspect, any one of the first to second possible implementations of the fourth aspect, in the fourth possible implementation of the fourth aspect, the fusion module is specifically used for:

确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;determining common recommended content in the first recommendation result and the second recommendation result;

从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;deleting the common recommendation content from the first recommendation result to obtain a third recommendation result;

从所述第三推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;Select a%*k recommended content from the third recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100;

从所述第二推荐结果中选择(1-a%)*k个推荐内容;Select (1-a%)*k recommended content from the second recommended result;

根据推荐内容的得分,对从所述第三推荐结果中选择的推荐内容和从所述第二推荐结果中选择的推荐内容进行统一排序,将统一排序后的推荐内容作为所述目标推荐结果。According to the scores of the recommended content, the recommended content selected from the third recommended result and the recommended content selected from the second recommended result are uniformly sorted, and the uniformly sorted recommended content is used as the target recommended result.

结合第四方面的第四种可能的实现方式,在第四方面的第五种可能的实现方式中,所述融合模块从所述第三推荐结果中选择a%*k个推荐内容,具体为:With reference to the fourth possible implementation of the fourth aspect, in a fifth possible implementation of the fourth aspect, the fusion module selects a%*k recommended content from the third recommendation result, specifically :

根据推荐内容的得分对所述第三推荐结果中的推荐内容进行排序,从排序后的所述第三推荐结果中选择排序在前的a%*k个推荐内容;sorting the recommended content in the third recommendation result according to the score of the recommended content, and selecting the top a%*k recommended content from the sorted third recommendation result;

所述融合模块从所述第二推荐结果中选择(1-a%)*k个推荐内容,具体为:The fusion module selects (1-a%)*k recommended content from the second recommendation result, specifically:

根据推荐内容的得分对所述第二推荐结果中的推荐内容进行排序,从排序后的所述第二推荐结果中选择排序在前的(1-a%)*k个推荐内容。The recommended content in the second recommended result is sorted according to the score of the recommended content, and the top (1-a%)*k recommended content is selected from the sorted second recommended result.

结合第四方面的第三种至第五种可能的实现方式中的任一一种,在第四方面的第六种可能的实现方式中,所述融合模块从所述第一推荐结果中删除所述共同的推荐内容之后,还用于:With reference to any one of the third to fifth possible implementations of the fourth aspect, in a sixth possible implementation of the fourth aspect, the fusion module deletes from the first recommendation result Following the common recommended content, it is also used to:

提高所述第二推荐结果中包括的所述共同的推荐内容的得分。The score of the common recommended content included in the second recommendation result is increased.

结合第四方面、第四方面的第一种至第二种可能的实现方式中的任一一种,在第四方面的第七种可能的实现方式中,所述融合模块具体用于:In combination with the fourth aspect, any one of the first to second possible implementations of the fourth aspect, in the seventh possible implementation of the fourth aspect, the fusion module is specifically used to:

确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;determining common recommended content in the first recommendation result and the second recommendation result;

从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;deleting the common recommendation content from the second recommendation result to obtain a fourth recommendation result;

根据推荐内容的得分,对所述第一推荐结果和所述第四推荐结果中的推荐内容统一进行排序;According to the score of the recommended content, the recommended content in the first recommended result and the fourth recommended result is uniformly sorted;

将排序后的推荐内容作为所述目标推荐结果,或者,按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。The sorted recommended content is used as the target recommendation result, or part of the recommended content is selected from the sorted recommended content according to a preset algorithm as the target recommendation result.

结合第四方面、第四方面的第一种至第二种可能的实现方式中的任一一种,在第四方面的第八种可能的实现方式中,所述融合模块具体用于:In combination with the fourth aspect, any one of the first to second possible implementations of the fourth aspect, in the eighth possible implementation of the fourth aspect, the fusion module is specifically used for:

确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;determining common recommended content in the first recommendation result and the second recommendation result;

从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;deleting the common recommendation content from the second recommendation result to obtain a fourth recommendation result;

从所述第一推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;Select a%*k recommended content from the first recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100;

从所述第四推荐结果中选择(1-a%)*k个推荐内容;Select (1-a%)*k recommended content from the fourth recommended result;

根据推荐内容的得分,对从所述第一推荐结果中选择的推荐内容和从所述第四推荐结果中选择的推荐内容进行统一排序,并将统一排序后的推荐内容作为所述目标推荐结果。According to the score of the recommended content, the recommended content selected from the first recommended result and the recommended content selected from the fourth recommended result are uniformly sorted, and the unified sorted recommended content is used as the target recommended result. .

结合第四方面的第八种可能的实现方式,在第四方面的第九种可能的实现方式中,所述融合模块从所述第一推荐结果中选择a%*k个推荐内容,具体为:With reference to the eighth possible implementation of the fourth aspect, in the ninth possible implementation of the fourth aspect, the fusion module selects a%*k recommended content from the first recommendation result, specifically :

根据推荐内容的得分对所述第一推荐结果中的推荐内容进行排序,从排序后的所述第一推荐结果中选择排序在前的a%*k个推荐内容;sorting the recommended content in the first recommendation result according to the score of the recommended content, and selecting the top a%*k recommended content from the sorted first recommendation result;

所述融合模块从所述第四推荐结果中选择(1-a%)*k个推荐内容,具体为:The fusion module selects (1-a%)*k recommended content from the fourth recommendation result, specifically:

根据推荐内容的得分对所述第四推荐结果中的推荐内容进行排序,从排序后的所述第四推荐结果中选择(1-a%)*k个推荐内容。The recommended content in the fourth recommended result is sorted according to the score of the recommended content, and (1-a%)*k recommended content is selected from the sorted fourth recommended result.

结合第四方面的第七种至第九种可能的实现方式中的任一一种,在第四方面的第十种可能的实现方式中,所述融合模块从所述第二推荐结果中删除所述共同的推荐内容之后,还用于:With reference to any one of the seventh to ninth possible implementations of the fourth aspect, in a tenth possible implementation of the fourth aspect, the fusion module deletes Following the common recommended content, it is also used to:

提高所述第一推荐结果中包括的所述共同的推荐内容的得分。The score of the common recommended content included in the first recommendation result is increased.

结合第四方面、第四方面的第一种至第二种可能的实现方式中的任一一种,在第四方面的第十一种可能的实现方式中,所述推荐系统还包括:In combination with the fourth aspect, any one of the first to second possible implementations of the fourth aspect, in the eleventh possible implementation of the fourth aspect, the recommendation system further includes:

推荐热度生成模块,用于根据所述全体内容库中的全体内容的推荐情况生成推荐热度库,所述推荐热度库中包括所述全体内容库中的全体内容在预设时间内的推荐热度;A recommendation popularity generation module, configured to generate a recommendation popularity library according to the recommendation situation of all contents in the entire content library, the recommendation popularity library including the recommendation popularity of all the contents in the entire content library within a preset time;

所述发送模块,还用于将推荐热度库中的所有内容发送给所述CDN。The sending module is further configured to send all the content in the recommended popularity library to the CDN.

结合第四方面的第十一种可能的实现方式,在第四方面的第十二种可能的实现方式中,所述融合模块根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果之后,所述推荐热度生成模块还用于:With reference to the eleventh possible implementation manner of the fourth aspect, in a twelfth possible implementation manner of the fourth aspect, the fusion module performs the calculation of the first recommendation result and the second recommendation result according to a preset fusion algorithm. The two recommendation results are fused, and after the target recommendation result is obtained, the recommendation heat generation module is also used for:

根据所述目标推荐结果更新所述推荐热度库。The recommendation popularity database is updated according to the target recommendation result.

结合第四方面、第四方面的第一种至第十二种可能的实现方式中的任一一种,在第四方面的第十三种可能的实现方式中,所述CDN发送的缓存内容为所述缓存内容队列的前P%的内容,或者,为所述缓存内容队列的前P%的内容相对于上次发送的内容的增量数据,其中,P为大于0小于100。In combination with the fourth aspect and any one of the first to twelfth possible implementations of the fourth aspect, in the thirteenth possible implementation of the fourth aspect, the cached content sent by the CDN It is the content of the top P% of the cache content queue, or the incremental data of the content of the top P% of the cache content queue relative to the content sent last time, where P is greater than 0 and less than 100.

本发明第五方面提供一种内容分发网络CDN边缘服务器,包括:A fifth aspect of the present invention provides a content distribution network CDN edge server, including:

获取模块,用于获取缓存内容队列中的缓存内容的推荐热度和访问热度;An acquisition module, configured to acquire recommendation popularity and access popularity of cached content in the cached content queue;

缓存替换模块,用于根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换。A cache replacement module, configured to perform cache replacement on the cache content queue according to the access popularity and recommendation popularity of the cache content in the cache content queue.

结合第五方面,在第五方面的第一种可能的实现方式中,所述缓存替换模块具体用于:With reference to the fifth aspect, in a first possible implementation manner of the fifth aspect, the cache replacement module is specifically configured to:

若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则确定对所述缓存内容队列的队尾访问热度较小的缓存内容进行淘汰;If the size of the cached content in the cached content queue is greater than or equal to the first threshold, it is determined to eliminate the cached content at the end of the cached content queue with less popular access;

比较所述缓存内容队列的队尾具有相同访问热度的缓存内容的推荐热度,淘汰所述具有相同访问热度的缓存内容中推荐热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于或等于所述第一阈值。Comparing the recommendation heat of the cache content with the same access heat at the queue tail of the cache content queue, eliminating the cache content with the lower recommendation heat among the cache content with the same access heat until the cache content in the cache content queue reaches If the size is smaller than a second threshold, stop eliminating the cached content queue, and the second threshold is smaller than or equal to the first threshold.

结合第五方面,在第五方面的第二种可能的实现方式中,所述缓存替换模块具体用于:With reference to the fifth aspect, in a second possible implementation manner of the fifth aspect, the cache replacement module is specifically configured to:

若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则确定对所述缓存内容队列的队尾的访问热度较小的缓存内容进行淘汰;If the size of the cached content in the cached content queue is greater than or equal to the first threshold, it is determined to eliminate the cached content at the queue tail of the cached content queue with less popular access;

根据所述缓存内容队列的队尾的缓存内容的访问热度和推荐热度,计算所述缓存内容队列的队尾中缓存内容的综合热度;According to the access heat and recommendation heat of the cache content at the queue tail of the cache content queue, calculate the comprehensive heat of the cache content in the queue tail of the cache content queue;

淘汰所述缓存内容队列的队尾中综合热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于等于所述第一阈值。Eliminate the cache content with less comprehensive heat in the queue tail of the cache content queue until the size of the cache content in the cache content queue is less than a second threshold, then stop eliminating the cache content queue, the second The threshold is less than or equal to the first threshold.

结合第五方面,在第五方面的第三种可能的实现方式中,所述获取模块具体用于:With reference to the fifth aspect, in a third possible implementation manner of the fifth aspect, the obtaining module is specifically configured to:

根据所述缓存内容队列中的缓存内容的历史访问情况生成所述缓存内容队列中的缓存内容的访问热度;generating the access heat of the cached content in the cached content queue according to the historical access conditions of the cached content in the cached content queue;

接收推荐系统发送的所述缓存内容队列中的缓存内容的推荐热度,所述缓存内容队列中的缓存内容的推荐热度是所述推荐系统根据所述缓存内容队列中的缓存内容的推荐情况生成的。receiving the recommendation heat of the cache content in the cache content queue sent by the recommendation system, the recommendation heat of the cache content in the cache content queue is generated by the recommendation system according to the recommendation situation of the cache content in the cache content queue .

结合第五方面、第五方面的第一种至第三种可能的实现方式中任一一种,在第五方面的第四种可能的实现方式中,所述获取模块还用于:In combination with the fifth aspect and any one of the first to third possible implementations of the fifth aspect, in the fourth possible implementation of the fifth aspect, the acquisition module is further configured to:

获取候选内容队列中的候选内容的推荐热度和访问热度;Obtain the recommendation popularity and access popularity of the candidate content in the candidate content queue;

所述缓存替换模块,还用于:根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换。The cache replacement module is further configured to: perform cache replacement on the candidate content queue according to the recommendation popularity and access popularity of the candidate content in the candidate content queue.

结合第五方面的第四种可能的实现方式,在第五方面的第五种可能的实现方式中,所述缓存替换模块具体用于:With reference to the fourth possible implementation of the fifth aspect, in the fifth possible implementation of the fifth aspect, the cache replacement module is specifically configured to:

若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;If the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, it is determined to eliminate the candidate content at the tail of the candidate content queue that has less popular access;

比较所述候选内容队列中具有相同访问热度的候选内容的推荐热度,淘汰所述具有相同访问热度的候选内容中推荐热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。Comparing the recommendation popularity of the candidate content with the same access popularity in the candidate content queue, eliminating the candidate content with the lower recommendation popularity among the candidate contents with the same access popularity, until the size of the candidate content in the candidate content queue is less than the fourth threshold, stop eliminating the candidate content queue, and the fourth threshold is less than or equal to the third threshold.

结合第五方面的第四种可能的实现方式,在第五方面的第六种可能的实现方式中,所述缓存替换模块具体用于:With reference to the fourth possible implementation of the fifth aspect, in a sixth possible implementation of the fifth aspect, the cache replacement module is specifically configured to:

若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;If the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, it is determined to eliminate the candidate content at the tail of the candidate content queue that has less popular access;

根据所述候选内容队列的队尾中候选内容的访问热度和推荐热度,计算所述候选内容队列的队尾中候选内容的综合热度;calculating the comprehensive popularity of the candidate content in the tail of the candidate content queue according to the access popularity and recommendation popularity of the candidate content in the queue tail of the candidate content queue;

淘汰所述候选内容队列的队尾中候选内容的综合热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。Eliminate the candidate content with less comprehensive popularity of the candidate content in the queue tail of the candidate content queue, until the size of the candidate content in the candidate content queue is less than the fourth threshold, then stop eliminating the candidate content queue, so The fourth threshold is less than or equal to the third threshold.

结合第五方面的第四种可能的实现方式,在第五方面的第七种可能的实现方式中,所述获取模块具体用于:With reference to the fourth possible implementation of the fifth aspect, in a seventh possible implementation of the fifth aspect, the acquiring module is specifically configured to:

根据所述候选内容队列中的候选内容的历史访问情况生成所述候选内容队列中的候选内容的访问热度;generating the access popularity of the candidate content in the candidate content queue according to the historical access conditions of the candidate content in the candidate content queue;

接收推荐系统发送的所述候选内容的推荐热度,所述候选内容的推荐热度是所述推荐系统根据所述候选内容的推荐情况生成的。The recommendation popularity of the candidate content sent by the recommendation system is received, and the recommendation popularity of the candidate content is generated by the recommendation system according to the recommendation situation of the candidate content.

本发明第六方面提供一种内容分发网络CDN的边缘服务器,包括:A sixth aspect of the present invention provides an edge server of a content distribution network CDN, including:

接收模块,用于接收客户端发送的内容获取请求,所述内容获取请求中包括待访问内容的标识信息;A receiving module, configured to receive a content acquisition request sent by the client, where the content acquisition request includes identification information of the content to be accessed;

处理模块,用于根据所述待访问内容的标识信息确定所述待访问内容是否在自己的缓存内容队列中,若所述待访问内容在所述缓存内容队列中,则向所述客户端返回所述待访问内容;A processing module, configured to determine whether the content to be accessed is in its own cache content queue according to the identification information of the content to be accessed, and return to the client if the content to be accessed is in the cache content queue The content to be accessed;

更新模块,用于更新所述待访问内容的访问热度,并根据所述待访问内容的访问热度和推荐热度计算所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述缓存内容队列;An update module, configured to update the access popularity of the content to be accessed, and calculate the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed, and update the Cache content queue;

缓存替换模块,用于当需要对所述缓存内容队列进行缓存替换时,根据所述缓存内容队列中缓存内容的热度信息,淘汰所述缓存内容队列中热度较小的缓存内容。The cache replacement module is configured to, when it is necessary to perform cache replacement on the cache content queue, eliminate less popular cache content in the cache content queue according to the popularity information of the cache content in the cache content queue.

结合第六方面,在第六方面的第一种可能的实现方式中,若所述待访问内容的标识信息不在所述缓存内容队列中,所述处理模块还用于:With reference to the sixth aspect, in the first possible implementation manner of the sixth aspect, if the identification information of the content to be accessed is not in the cached content queue, the processing module is further configured to:

根据所述待访问内容的标识信息确定所述待访问内容是否在所述CDN边缘服务器的候选内容队列中;determining whether the content to be accessed is in the candidate content queue of the CDN edge server according to the identification information of the content to be accessed;

若所述待访问内容在所述候选内容队列中,则更新所述待访问内容的访问热度,根据所述待访问内容的访问热度和推荐热度确定所述待访问内容的热度信息;If the content to be accessed is in the candidate content queue, update the access popularity of the content to be accessed, and determine the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed;

根据所述待访问内容的热度信息判断所述待访问内容的热度是否大于预设的热度阈值;judging whether the popularity of the content to be accessed is greater than a preset popularity threshold according to the popularity information of the content to be accessed;

若所述待访问内容的热度大于所述热度阈值,则将所述待访问内容添加到所述缓存内容队列中,并从所述候选内容队列中删除所述待访问内容;If the popularity of the content to be accessed is greater than the popularity threshold, adding the content to be accessed to the cache content queue, and deleting the content to be accessed from the candidate content queue;

向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。Returning to the client the IP address of the original server where the content server to be accessed is located.

结合第六方面,在第六方面的第二种可能的实现方式中,若所述待访问内容不在所述候选内容队列中,所述处理模块还用于:With reference to the sixth aspect, in a second possible implementation manner of the sixth aspect, if the content to be accessed is not in the candidate content queue, the processing module is further configured to:

将所述待访问内容添加到所述候选内容队列中;adding the content to be accessed to the candidate content queue;

更新所述待访问内容的访问热度,根据所述待访问内容的热度和所述待访问内容的推荐热度确定所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述候选内容队列;Update the access popularity of the content to be accessed, determine the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed, and update the candidate according to the popularity information of the content to be accessed content queue;

向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。Returning to the client the IP address of the original server where the content server to be accessed is located.

结合第六方面,在第六方面的第三种可能的实现方式中,若所述待访问内容的热度小于或等于所述热度阈值,则所述处理模块还用于:With reference to the sixth aspect, in a third possible implementation manner of the sixth aspect, if the popularity of the content to be accessed is less than or equal to the popularity threshold, the processing module is further configured to:

根据所述待访问内容的热度信息更新所述候选内容队列;updating the candidate content queue according to the popularity information of the content to be accessed;

向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。Returning to the client the IP address of the original server where the content server to be accessed is located.

结合第六方面、以及第六方面的第一种至第三种可能的实现,在第六方面的第四种可能的实现方式中,所述缓存替换模块还用于:With reference to the sixth aspect and the first to third possible implementations of the sixth aspect, in a fourth possible implementation of the sixth aspect, the cache replacement module is further configured to:

当需要对所述候选内容队列进行缓存替换时,根据所述候选内容队列中候选内容的热度信息,淘汰所述候选内容队列中热度较小的候选内容。When it is necessary to cache and replace the candidate content queue, the less popular candidate content in the candidate content queue is eliminated according to the popularity information of the candidate content in the candidate content queue.

本发明实施例提供的网络内容的推荐、缓存替换方法和设备,CDN通过向推荐系统发送缓存内容队列中的缓存内容的标识,以便推荐系统在向用户推荐内容时,会根据CDN发送的缓存内容生成推荐结果,从而确保推荐系统推荐给用户的推荐结果尽可能的在CDN的缓存内容队列中,当用户向CDN请求推荐结果中包括的推荐内容时,CDN可以从缓存内容队列中获取到用户请求的内容,而不需要从用户请求的内容所在的原始服务器获取,减少了用户等待的时间,并且可以减少CDN的回源带宽的占用。推荐系统也会根据推荐结果生成全体内容的推荐热度,并将全体内容的推荐热度发送给CDN,以便于CDN在进行缓存替换时考虑到推荐热度,从而尽可能地把推荐热度高的内容保留在缓存中,使用户可以更快的获取推荐系统所推荐的内容。In the network content recommendation and cache replacement method and device provided by the embodiments of the present invention, the CDN sends the identifier of the cached content in the cached content queue to the recommender system, so that the recommender system will use the cached content sent by the CDN when recommending content to the user. Generate recommendation results to ensure that the recommendation results recommended by the recommendation system to users are in the cached content queue of the CDN as much as possible. When the user requests the recommended content included in the recommended results from the CDN, the CDN can obtain the user request from the cached content queue The content does not need to be obtained from the original server where the content requested by the user is located, which reduces the waiting time of the user and can reduce the bandwidth usage of the CDN back to the source. The recommendation system will also generate the recommendation heat of all content based on the recommendation results, and send the recommendation heat of all content to the CDN, so that the CDN can take the recommendation heat into consideration when performing cache replacement, and keep the content with high recommendation heat in the CDN as much as possible. In the cache, users can get the content recommended by the recommendation system faster.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings on the premise of not paying creative efforts.

图1为一种现有的视频推荐过程的示意图;Fig. 1 is a schematic diagram of an existing video recommendation process;

图2为本发明实施例一提供的网络内容的推荐方法的流程图;FIG. 2 is a flowchart of a method for recommending network content provided by Embodiment 1 of the present invention;

图3为本发明实施例二提供的CDN和推荐系统的结构示意图;FIG. 3 is a schematic structural diagram of a CDN and a recommendation system provided by Embodiment 2 of the present invention;

图4为本发明实施例二提供的CDN向推荐系统发送缓存内容的标识的流程图;4 is a flow chart of the CDN sending the identifier of cached content to the recommendation system provided by Embodiment 2 of the present invention;

图5为本发明实施例三提供的推荐系统向CDN发送全体内容库的推荐热度的流程图;FIG. 5 is a flow chart of sending the recommendation popularity of the entire content library to the CDN by the recommendation system provided by Embodiment 3 of the present invention;

图6为本发明实施例四提供的网络内容的推荐方法的业务流程的示意图;FIG. 6 is a schematic diagram of a business process of a method for recommending network content provided in Embodiment 4 of the present invention;

图7为本发明实施例四提供的网络内容的推荐方法的流程图;FIG. 7 is a flowchart of a method for recommending network content provided in Embodiment 4 of the present invention;

图8为本发明实施例五提供的网络内容的推荐方法的流程图;FIG. 8 is a flowchart of a method for recommending network content provided in Embodiment 5 of the present invention;

图9为CDN边缘服务器的缓存内容队列和候选内容队列的结构示意图;9 is a schematic structural diagram of a cache content queue and a candidate content queue of a CDN edge server;

图10为本发明实施例六提供的网络内容的缓存替换方法的流程图;FIG. 10 is a flowchart of a cache replacement method for network content provided in Embodiment 6 of the present invention;

图11为本发明实施例七提供的网络内容的缓存替换方法的流程图;FIG. 11 is a flow chart of a cache replacement method for network content provided by Embodiment 7 of the present invention;

图12为本发明实施例八提供的网络内容的缓存替换方法的流程图;FIG. 12 is a flowchart of a cache replacement method for network content provided in Embodiment 8 of the present invention;

图13为本发明实施例九提供的网络内容的缓存替换方法的流程图;FIG. 13 is a flowchart of a cache replacement method for network content provided by Embodiment 9 of the present invention;

图14为本发明实施例十提供的一种推荐系统的结构示意图;FIG. 14 is a schematic structural diagram of a recommendation system provided by Embodiment 10 of the present invention;

图15为本发明实施例十一提供的一种CDN边缘服务器的结构示意图;FIG. 15 is a schematic structural diagram of a CDN edge server provided by Embodiment 11 of the present invention;

图16为本发明实施例十三提供的一种CDN的边缘服务器的结构示意图;FIG. 16 is a schematic structural diagram of a CDN edge server provided by Embodiment 13 of the present invention;

图17为本发明实施例十四提供的CDN边缘服务器的结构示意图;FIG. 17 is a schematic structural diagram of a CDN edge server provided by Embodiment 14 of the present invention;

图18为本发明实施例十五提供的CDN边缘服务器的结构示意图;FIG. 18 is a schematic structural diagram of a CDN edge server provided by Embodiment 15 of the present invention;

图19为本发明实施例十六提供的推荐系统的结构示意图。FIG. 19 is a schematic structural diagram of a recommendation system provided by Embodiment 16 of the present invention.

具体实施方式detailed description

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

目前,很多网络应用系统同时包括CDN和推荐系统两个部分,如网络协议电视(Internet Protocol Television,简称IPTV)、视频点播(Video On Demand,简称VoD)、视频网站(如Netflix、YouTube、优酷和乐视等)、电子商务(Electronic Commerce)网站(如淘宝、京东和亚马逊等)、移动应用程序和游戏商店(如苹果公司的App Store)等。At present, many network application systems include both CDN and recommendation system, such as Internet Protocol Television (IPTV for short), Video On Demand (VoD for short), video websites (such as Netflix, YouTube, Youku and LeTV, etc.), e-commerce (Electronic Commerce) websites (such as Taobao, Jingdong and Amazon, etc.), mobile application and game stores (such as Apple's App Store), etc.

推荐系统根据推荐算法可以分为三类:基于内容的推荐系统、基于协同的推荐系统和混合推荐系统。基于内容的推荐系统获取用户兴趣特征向量和内容的特征向量,通过计算用户兴趣特征向量和内容的特征向量之间的相似性为用户推荐物品。基于协同的推荐系统不依赖于对用户和内容本身进行推荐,而是基于其他用户所购买的物品为目标用户推荐物品。混合推荐系统会综合采用基于内容的推荐方法和基于协同的推荐方法。总体而言,推荐的目的就是在海量的内容库中选择对用户最有用的物品并展现给用户,从而避免用户迷失在品目繁多的选择之中,节约用户的时间,并提高目标商品的曝光程度。需要说明的是,以下实施例中提到的内容也称为网络内容,网络内容具体可以是视频、音乐、商品、应用(APP)、游戏等。Recommendation systems can be divided into three categories according to recommendation algorithms: content-based recommendation systems, collaboration-based recommendation systems, and hybrid recommendation systems. The content-based recommendation system obtains user interest feature vectors and content feature vectors, and recommends items for users by calculating the similarity between user interest feature vectors and content feature vectors. Collaboration-based recommendation systems do not rely on recommending users and content itself, but recommend items for target users based on items purchased by other users. A hybrid recommender system uses both content-based and collaboration-based recommendations. In general, the purpose of recommendation is to select the most useful items for users from the massive content library and present them to users, so as to prevent users from getting lost in a wide variety of choices, save users' time, and increase the exposure of target products . It should be noted that the content mentioned in the following embodiments is also referred to as network content, and the network content may specifically be videos, music, commodities, applications (APPs), games, and the like.

CDN包括多个网络集群,CDN包括的网络集群可以分为中心集群和边缘集群,中心集群包括一个或多个CDN中心服务器,边缘集群包括一个或多个CDN边缘服务器。中心集群一般会缓存需要分发的所有网络内容,而边缘集群仅仅缓存需要分发的网络内容的一部分。当用户访问某一内容时,用户通过客户端向域名系统(Domain Name System,简称DNS)发送地址解析请求,DNS会把用户的访问分配到离用户最近的边缘集群上,如果该边缘集群存储有用户所访问的内容,那么该边缘集群中存储有用户所访问的内容的CDN边缘服务器会将用户请求的内容直接返回给用户。如果用户访问的边缘集群没有存储用户所访问的内容,那么边缘集群就向访问内容所在的原始服务器获取该访问内容,然后再返回给用户。在后一种情况下,对于用户来说,用户往往需要等待较长时间才能获得边缘集群的响应,影响用户体验,对于运营商来说,CDN从访问内容所在的原始服务器获取访问内容,会占用回源带宽,导致网络资源浪费,回源带宽即CDN和内容的原始服务器之间的带宽。The CDN includes multiple network clusters. The network clusters included in the CDN can be divided into central clusters and edge clusters. The central cluster includes one or more CDN central servers, and the edge cluster includes one or more CDN edge servers. The central cluster generally caches all network content that needs to be distributed, while the edge cluster only caches a part of the network content that needs to be distributed. When a user accesses a certain content, the user sends an address resolution request to the Domain Name System (DNS) through the client, and the DNS will assign the user's access to the edge cluster closest to the user. The content accessed by the user, then the CDN edge server storing the content accessed by the user in the edge cluster will directly return the content requested by the user to the user. If the edge cluster accessed by the user does not store the content accessed by the user, the edge cluster will obtain the accessed content from the original server where the accessed content is located, and then return it to the user. In the latter case, for users, users often need to wait for a long time to get a response from the edge cluster, which affects user experience. Back-to-origin bandwidth leads to a waste of network resources. The back-to-origin bandwidth is the bandwidth between the CDN and the original server of the content.

以视频推荐为例,图1为一种现有的视频推荐过程的示意图,如图1所示,视频推荐过程可以包括如下步骤:Taking video recommendation as an example, FIG. 1 is a schematic diagram of an existing video recommendation process. As shown in FIG. 1 , the video recommendation process may include the following steps:

步骤101、客户端向网页服务器(Web Server)发送视频推荐请求消息。Step 101, the client sends a video recommendation request message to a web server (Web Server).

在视频推荐中,客户端具体可以为浏览器或播放器,该过程一般由用户触发,例如,用于打开优酷播放器,点击播放器首页中的电影选项,优酷播放器就会自动向网页服务器发送视频推荐请求消息。In video recommendation, the client can be a browser or a player. This process is generally triggered by the user. For example, to open the Youku player, click the movie option on the home page of the player, and the Youku player will automatically send the video to the web server. Send a video recommendation request message.

步骤102、网页服务器向推荐系统发送查询请求消息。Step 102, the web server sends a query request message to the recommendation system.

查询请求用于获取查询推荐列表,推荐系统收到网页服务器发送的视频推荐请求后消息,获取用户兴趣特征,根据预设的推荐算法和用户兴趣特征从视频内容库中得到推荐结果。其中,用户兴趣特征主要根据以下两种信息生成:一种信息为用户在登录网页服务器时提供的信息,包括:用户的性别、年龄、地域、学历、个人兴趣等,另一种信息为用户的历史访问记录。推荐系统可以与网页服务器位于同一个硬件设备中,也可以位于单独的硬件设备中。The query request is used to obtain the query recommendation list. The recommendation system receives the message after the video recommendation request sent by the web server, obtains user interest characteristics, and obtains recommendation results from the video content library according to the preset recommendation algorithm and user interest characteristics. Among them, the user interest characteristics are mainly generated based on the following two types of information: one type of information is the information provided by the user when logging into the web server, including: the user's gender, age, region, education background, personal interests, etc., and the other type of information is the user's Historical access records. The recommendation system can be located in the same hardware device as the web server, or in a separate hardware device.

步骤103、推荐系统向网页服务器返回视频推荐列表。Step 103, the recommendation system returns a video recommendation list to the web server.

推荐系统在获取到推荐结果后,可以根据视频的得分对推荐结果中包括的视频进行排序得到视频推荐列表,将视频推荐列表返回给网页服务器。After obtaining the recommendation result, the recommendation system can sort the videos included in the recommendation result according to the video scores to obtain a video recommendation list, and return the video recommendation list to the web server.

步骤104、网页服务器向客户端返回视频推荐列表。Step 104, the web server returns a video recommendation list to the client.

步骤105、客户端向CDN边缘服务器请求某个视频内容。Step 105, the client requests a certain video content from the CDN edge server.

该操作一般是由用户点击(或观看)视频推荐列表中的某个视频触发的。This operation is generally triggered by the user clicking (or watching) a certain video in the recommended video list.

步骤106、CDN边缘服务器向客户端返回请求的视频内容。Step 106, the CDN edge server returns the requested video content to the client.

客户端请求的视频可能缓存在CDN边缘服务器中,也可能没有缓存在CDN边缘服务器中,当客户端请求的视频在CDN边缘服务器上时,CDN边缘服务器直接将客户端请求的视频发送给客户端,若客户端请求的视频不在CDN边缘服务器上,CDN边缘服务器会向该视频所在的原始服务器请求该视频,将该视频缓存在CDN边缘服务器中,然后,CDN边缘服务器在向客户端返回该视频。The video requested by the client may or may not be cached in the CDN edge server. When the video requested by the client is on the CDN edge server, the CDN edge server will directly send the video requested by the client to the client. , if the video requested by the client is not on the CDN edge server, the CDN edge server will request the video from the original server where the video is located, cache the video in the CDN edge server, and then the CDN edge server will return the video to the client .

通过上述例子可知,当推荐系统向用户推荐的内容不在CDN中时,CDN需要回源获取网络内容,CDN回源获取网络内容会导致用户等待时间长、占用CDN回源带宽等。From the above examples, we can see that when the content recommended by the recommendation system to the user is not in the CDN, the CDN needs to go back to the source to obtain the network content, which will cause the user to wait for a long time and occupy the CDN back-to-source bandwidth.

为了解决现有技术的问题,本发明实施例一提供一种网络内容的推荐方法,推荐系统在向用户推荐内容时,会考虑CDN中缓存的内容,尽可能的保证向用户推荐的内容存储在CDN中。图2为本发明实施例一提供的网络内容的推荐方法的流程图,如图2所示,本实施例提供的方法可以包括以下步骤:In order to solve the problems of the prior art, Embodiment 1 of the present invention provides a method for recommending network content. When the recommendation system recommends content to users, it will consider the content cached in the CDN, and ensure that the content recommended to users is stored in the CDN. FIG. 2 is a flowchart of a method for recommending network content provided in Embodiment 1 of the present invention. As shown in FIG. 2 , the method provided in this embodiment may include the following steps:

步骤201、推荐系统接收CDN发送的缓存内容队列中的缓存内容的标识,根据缓存内容的标识和全体内容库获取缓存内容的信息,将缓存内容的标识和缓存内容的信息添加到缓存内容库。Step 201: The recommendation system receives the identifier of the cached content in the cached content queue sent by the CDN, obtains the information of the cached content according to the identifier of the cached content and the entire content library, and adds the identifier of the cached content and the information of the cached content to the cached content library.

CDN在触发信号的触发下向推荐系统发送缓存内容队列中存储的缓存内容的标识,缓存内容的标识可以为缓存内容的统一资源定位符(uniform/universal resource locator,简称url,或缓存内容的url的哈希值(HASH)。CDN的缓存内容队列用于存储缓存在CDN中的缓存内容,CDN向推荐系统发送缓存内容的标识时,可以将缓存内容队列中的所有缓存内容的标识都发送给推荐系统,也可以只发送缓存队列中的部分缓存内容。主要是因为,CDN缓存内容队列中的缓存内容是按照热度的顺序排列的,排在缓存内容队列的缓存内容当缓存内容队列容量满时会被淘汰出缓存内容队列,如果推荐系统将缓存内容队列中可能被淘汰的缓存内容发送给了推荐系统,并且推荐系统将该缓存内容推荐给了用户,当用户访问该缓存内容时,该缓存内容可能已经被淘汰了,这时,CDN还是需要向存储该缓存内容的原始服务器获取该缓存内容。The CDN sends the identifier of the cached content stored in the cached content queue to the recommendation system under the trigger of the trigger signal. The cached content’s identifier can be a uniform/universal resource locator (url for short, or url of the cached content) of the cached content. The hash value (HASH). The cache content queue of CDN is used to store the cache content cached in the CDN. When the CDN sends the identifier of the cache content to the recommendation system, the identifiers of all the cache content in the cache content queue can be sent to The recommendation system can also only send part of the cached content in the cache queue. The main reason is that the cached content in the CDN cached content queue is arranged in the order of popularity, and the cached content in the cached content queue is when the cached content queue is full. Will be eliminated from the cache content queue, if the recommender system sends the cached content that may be eliminated in the cached content queue to the recommender system, and the recommender system recommends the cached content to the user, when the user accesses the cached content, the cached The content may have been eliminated. At this time, the CDN still needs to obtain the cached content from the original server that stores the cached content.

为了确保推荐系统所推荐的缓存内容队列中的缓存内容在用户访问时依然位于缓存内容队列中,本实施例中,CDN发送的缓存内容为缓存内容队列的前P%的内容,或者,为缓存内容队列的前P%的内容相对于上次发送的内容的增量数据、其中,P为大于0小于100。In order to ensure that the cached content in the cached content queue recommended by the recommendation system is still in the cached content queue when the user accesses it, in this embodiment, the cached content sent by the CDN is the content of the top P% of the cached content queue, or the cached Incremental data of the content of the top P% of the content queue relative to the content sent last time, where P is greater than 0 and less than 100.

推荐系统收到缓存内容的标识后,根据缓存内容标识和全体内容库生成缓存内容库,全体内容库中包括推荐系统中的所有内容的信息:每个内容的信息包括:内容的标识、内容的元数据、内容的得分等信息,以视频内容为例,视频内容的元数据包括内容的属性标签,内容的属性标签包括标题、作者、演员、风格、拍摄时间等,以商品内容为例,商品内容的属性标签包括商品名称、价格、商铺名称、颜色、风格等。CDN只向推荐系统发送缓存内容的标识后,推荐系统根据缓存内容的标识从全体内容库中找到缓存内容的信息,将缓存内容的信息和缓存内容的标识添加到缓存内容库,缓存内容库为全体内容库的一个子集。After the recommendation system receives the identifier of the cached content, it generates a cached content library according to the cached content ID and the entire content library. Metadata, content score and other information, taking video content as an example, the metadata of video content includes content attribute tags, and content attribute tags include title, author, actor, style, shooting time, etc. Taking product content as an example, product The attribute tags of content include commodity name, price, store name, color, style, etc. After the CDN only sends the identifier of the cached content to the recommendation system, the recommendation system finds the information of the cached content from the entire content library according to the identifier of the cached content, and adds the information of the cached content and the identifier of the cached content to the cached content library. The cached content library is A subset of the overall content library.

步骤202、当推荐系统接收到客户端发送的推荐请求消息时,推荐系统根据预先获取的用户兴趣特征和全体内容库,采用第一推荐算法计算得到第一推荐结果。Step 202. When the recommendation system receives the recommendation request message sent by the client, the recommendation system uses the first recommendation algorithm to calculate the first recommendation result according to the pre-acquired user interest characteristics and the entire content library.

第一推荐结果中所有推荐内容都属于全体内容库,在推荐过程中,推荐系统会根据全体内容库生成全体内容库的特征,根据用户兴趣特征和全体内容库的特征生成第一推荐结果。All recommended content in the first recommendation result belongs to the entire content library. During the recommendation process, the recommendation system will generate the characteristics of the entire content library according to the characteristics of the entire content library, and generate the first recommendation result according to the user interest characteristics and the characteristics of the entire content library.

步骤203、推荐系统根据缓存内容库获取第二推荐结果。Step 203, the recommendation system obtains the second recommendation result according to the cached content library.

一种实现方式中,推荐系统根据用户兴趣特征和所述缓存内容库,采用第二推荐算法计算得到二推荐结果。另一种实现方式中,推荐系统从第一推荐结果选择属于缓存内容库的推荐内容,将所选择的推荐内容作为第二推荐结果。在前一种实现方式中,推荐系统会根据缓存内容库生成缓存内容库的特征,根据用户兴趣特征和缓存内容库的特征生成第二推荐结果。在后一种实现方式中,推荐系统首先从第一推荐结果中确定哪些推荐内容属于缓存内容库,然后,从第一推荐结果中获取属于缓存内容库的推荐内容,将所选择的推荐内容作为第二推荐结果。In an implementation manner, the recommendation system uses a second recommendation algorithm to calculate and obtain a second recommendation result according to user interest characteristics and the cached content library. In another implementation manner, the recommendation system selects recommended content belonging to the cached content library from the first recommendation result, and takes the selected recommended content as the second recommendation result. In the former implementation manner, the recommendation system generates the characteristics of the cached content library according to the cached content library, and generates the second recommendation result according to the user interest characteristics and the characteristics of the cached content library. In the latter implementation, the recommendation system first determines which recommended content belongs to the cache content library from the first recommendation result, and then obtains the recommended content belonging to the cache content library from the first recommendation result, and uses the selected recommended content as The second recommended result.

本实施例以及下述实施例中,提到的用户兴趣特征、全体内容库的特征以及缓存内容库的特征都是指特征向量。In this embodiment and the following embodiments, the features of user interests, features of the entire content library, and features of the cached content library mentioned are feature vectors.

本实施例中,第一推荐算法和第二推荐算法均可以包括一种或多种推荐算法,推荐算法可以采用现有的任意一种算法,例如,基于内容的算法、基于协同的算法、基于内容和协同的混合算法。且本实施例中,第一推荐算法和第二推荐算法可以相同也可以不同。In this embodiment, both the first recommendation algorithm and the second recommendation algorithm may include one or more recommendation algorithms, and the recommendation algorithm may adopt any existing algorithm, for example, a content-based algorithm, a collaboration-based algorithm, a A hybrid algorithm of content and collaboration. And in this embodiment, the first recommendation algorithm and the second recommendation algorithm may be the same or different.

本实施例中,第一推荐结果和第二推荐结果均包括至少一个推荐内容,第一推荐结果和第二推荐结果可以以列表的形式表示。需说明的是,步骤202和步骤203在执行时并没有先后顺序,也可以同时执行。In this embodiment, both the first recommendation result and the second recommendation result include at least one recommendation content, and the first recommendation result and the second recommendation result may be represented in a list form. It should be noted that step 202 and step 203 are executed in no sequence, and may also be executed simultaneously.

步骤204、推荐系统根据预设的融合算法对第一推荐结果和第二推荐结果进行融合,得到目标推荐结果。Step 204, the recommendation system fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result.

具体可以通过如下几种方式对第一推荐结果和第二推荐结果进行融合:Specifically, the first recommendation result and the second recommendation result can be fused in the following ways:

第一种方式,首先,推荐系统确定第一推荐结果和第二推荐结果中共同的推荐内容。其次,推荐系统从第一推荐结果中删除共同的推荐内容,得到第三推荐结果;然后,推荐系统根据推荐内容的得分,对第二推荐结果和第三推荐结果中的推荐内容统一进行排序;最后,推荐系统将排序后的推荐内容作为目标推荐结果,或者,推荐系统按照预设的算法从排序后的推荐内容中选择部分推荐内容作为目标推荐结果,例如,推荐系统共需要返回K个推荐内容,则推荐系统从排序后的推荐内容中选择排序在前的K个内容作为目标推荐结果。In the first way, first, the recommendation system determines the common recommendation content in the first recommendation result and the second recommendation result. Secondly, the recommendation system deletes the common recommendation content from the first recommendation result to obtain the third recommendation result; then, the recommendation system uniformly sorts the recommendation content in the second recommendation result and the third recommendation result according to the score of the recommendation content; Finally, the recommendation system takes the sorted recommendation content as the target recommendation result, or, the recommendation system selects part of the recommendation content from the sorted recommendation content according to the preset algorithm as the target recommendation result. For example, the recommendation system needs to return a total of K recommendations content, the recommendation system selects the top K content from the sorted recommended content as the target recommendation result.

第一推荐结果和第二推荐结果中均包括多个推荐内容,第一推荐结果中包括的推荐内容和第二推荐结果中包括的推荐内容可能会有部分相同,推荐系统通过比较第一推荐结果和第二推荐结果确定二者中共同的推荐内容。Both the first recommendation result and the second recommendation result include multiple recommended contents, and the recommended contents included in the first recommendation result and the second recommendation result may be partly the same. The recommendation system compares the first recommendation result and the second recommendation result determine the common recommended content in both.

第二种方式,首先,推荐系统确定第一推荐结果和第二推荐结果中共同的推荐内容,从第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果。其次,推荐系统从第三推荐结果中选择a%*k个推荐内容,其中,K为目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100,从第二推荐结果中选择(1-a%)*k个推荐内容。最后,推荐系统根据推荐内容的得分,对从第三推荐结果中选择的推荐内容和从第二推荐结果中选择的推荐内容进行统一排序,将统一排序后的推荐内容作为目标推荐结果。In the second way, first, the recommendation system determines the common recommendation content in the first recommendation result and the second recommendation result, deletes the common recommendation content from the first recommendation result, and obtains the third recommendation result. Secondly, the recommendation system selects a%*k recommended content from the third recommendation result, where K is the number of recommended content included in the target recommendation result, a is greater than or equal to 0 and less than or equal to 100, and selects from the second recommendation result (1-a%)*k recommended content. Finally, the recommendation system uniformly sorts the recommended content selected from the third recommendation result and the recommended content selected from the second recommendation result according to the scores of the recommended content, and takes the unified ranked recommended content as the target recommendation result.

推荐系统从第三推荐结果中选择a%*k个推荐内容具体可以为:推荐系统根据推荐内容的得分对第三推荐结果中的推荐内容进行排序,从排序后的第三推荐结果中选择排序在前的a%*k个推荐内容,排序在前的a%*k个推荐内容为得分较高的推荐内容,或者,推荐系统按照预设的原则(例如,等比例原则)从排序后的第三推荐结果中选择a%*k个推荐内容。同理,推荐系统从第二推荐结果中选择(1-a%)*k个推荐内容时,也可以根据推荐内容的得分对第二推荐结果的推荐内容进行排序,从排序后的第二推荐结果中选择排序在前的(1-a%)*k个推荐内容,或者,推荐系统按照预设的原则从排序后的第二推荐结果中选择(1-a%)*k个推荐内容。当然,推荐系统在从第三推荐结果和第二推荐结果中选择推荐内容时也可以不排序,或者按照其他参数进行排序,本发明实施例并不对此进行限制。The recommendation system selects a%*k recommended content from the third recommendation result. Specifically, the recommendation system sorts the recommended content in the third recommendation result according to the score of the recommended content, and selects and sorts from the sorted third recommendation result The top a%*k recommended content, the top a%*k recommended content is the recommended content with a higher score, or the recommendation system selects from the sorted A%*k recommended content is selected from the third recommendation result. Similarly, when the recommendation system selects (1-a%)*k recommended content from the second recommendation result, it can also sort the recommended content of the second recommendation result according to the score of the recommended content, and then recommend The top (1-a%)*k recommended content is selected from the results, or the recommendation system selects (1-a%)*k recommended content from the second sorted recommendation result according to a preset principle. Certainly, when the recommendation system selects the recommended content from the third recommendation result and the second recommendation result, it may not sort, or sort according to other parameters, which is not limited in this embodiment of the present invention.

可选的,在第一种方式和第二种方式中,推荐系统从第一推荐结果中删除共同的推荐内容之后,推荐系统提高第二推荐结果中包括的共同的推荐内容的得分,相应的,推荐系统在根据得分对第二推荐结果中的推荐内容排序时,是根据提高后的得分进行排序。Optionally, in the first way and the second way, after the recommendation system deletes the common recommendation content from the first recommendation result, the recommendation system increases the score of the common recommendation content included in the second recommendation result, correspondingly , when the recommendation system sorts the recommended content in the second recommendation result according to the score, it sorts according to the improved score.

第三种方式,首先,推荐系统确定第一推荐结果和第二推荐结果中共同的推荐内容;其次,推荐系统从第二推荐结果中删除共同的推荐内容,得到第四推荐结果;然后,推荐系统根据推荐内容的得分,对第一推荐结果和第四推荐结果中的推荐内容统一进行排序;最后,推荐系统将排序后的推荐内容作为目标推荐结果,或者,推荐系统按照预设的算法从序后的推荐内容中选择部分推荐内容作为目标推荐结果。In the third way, firstly, the recommendation system determines the common recommendation content in the first recommendation result and the second recommendation result; secondly, the recommendation system deletes the common recommendation content from the second recommendation result to obtain the fourth recommendation result; then, recommends According to the score of the recommended content, the system ranks the recommended content in the first recommendation result and the fourth recommendation result uniformly; finally, the recommendation system takes the sorted recommended content as the target recommendation result, or the recommendation system uses the preset algorithm from Select part of the recommended content from the sequenced recommended content as the target recommendation result.

第四种方式,首先,推荐系统确定第一推荐结果和第二推荐结果中共同的推荐内容,从第二推荐结果中删除共同的推荐内容,得到第四推荐结果;然后,推荐系统从第一推荐结果中选择(1-a%)*k个推荐内容,从第四推荐结果中选择(1-a%)*k个推荐内容;最后,推荐系统根据推荐内容的得分,对从第一推荐结果中选择的推荐内容和从第四推荐结果中选择的推荐内容进行统一排序,并将统一排序后的推荐内容作为目标推荐结果。In the fourth way, first, the recommendation system determines the common recommendation content in the first recommendation result and the second recommendation result, deletes the common recommendation content from the second recommendation result, and obtains the fourth recommendation result; then, the recommendation system determines the common recommendation content from the first recommendation result Select (1-a%)*k recommended content from the recommended results, and select (1-a%)*k recommended content from the fourth recommended result; finally, the recommendation system selects the recommended content from the first The recommended content selected from the results and the recommended content selected from the fourth recommended result are uniformly sorted, and the uniformly sorted recommended content is used as the target recommendation result.

其中,推荐系统从第一推荐结果中选择(1-a%)*k个推荐内容,具体为:推荐系统根据推荐内容的得分对第一推荐结果中的推荐内容进行排序,从排序后的第一推荐结果中选择排序在前的a%*k个推荐内容;或者,推荐系统按照预设的原则从排序后的第一推荐结果中选择a%*k个推荐内容。同理,推荐系统从第四推荐结果中选择(1-a%)*k个推荐内容时,也可以根据推荐内容的得分对第四推荐结果中的推荐内容进行排序,从排序后的第四推荐结果中选择(1-a%)*k个推荐内容,或者,按照预设的原则从排序后的第四推荐结果中选择(1-a%)*k个推荐内容。当然,推荐系统在从第一推荐结果和第四推荐结果中选择推荐内容时也可以不排序,或者按照其他参数进行排序,本发明实施例并不对此进行限制。Among them, the recommendation system selects (1-a%)*k recommended content from the first recommendation result, specifically: the recommendation system sorts the recommended content in the first recommendation result according to the score of the recommended content, and selects the first recommended content from the sorted Selecting the top a%*k recommended content from a recommendation result; or, the recommendation system selects a%*k recommended content from the first sorted recommendation result according to a preset principle. Similarly, when the recommendation system selects (1-a%)*k recommended content from the fourth recommendation result, it can also sort the recommended content in the fourth recommendation result according to the score of the recommended content, and start from the sorted fourth Select (1-a%)*k recommended content from the recommended results, or select (1-a%)*k recommended content from the fourth sorted recommendation result according to a preset principle. Of course, when the recommendation system selects the recommended content from the first recommendation result and the fourth recommendation result, it may not sort, or sort according to other parameters, which is not limited in this embodiment of the present invention.

可选的,在第三种方式和第四种方式中,推荐系统从第二推荐结果中删除共同的推荐内容之后,推荐系统提高第一推荐结果中包括的共同的推荐内容的得分,相应的,推荐系统在根据得分对第一推荐结果中的推荐内容排序时,是根据提高后的得分进行排序。Optionally, in the third mode and the fourth mode, after the recommendation system deletes the common recommendation content from the second recommendation result, the recommendation system increases the score of the common recommendation content included in the first recommendation result, correspondingly , when the recommendation system sorts the recommended content in the first recommendation result according to the score, it sorts according to the improved score.

步骤205、推荐系统将目标推荐结果推送给目标用户。Step 205, the recommendation system pushes the target recommendation result to the target user.

本实施例中,推荐系统通过接收CDN发送的缓存内容队列中的缓存内容的标识,根据缓存内容的标识和全体内容库生成缓存内容库,后续当推荐系统接收到客户端发送的推荐请求消息时,不仅根据用户兴趣特征和预设的推荐算法,从全体内容库中获取第一推荐结果,还根据用户兴趣特征和推荐算法,从缓存内容库中获取第二推荐结果,然后,根据预设的融合算法对第一推荐结果和第二推荐结果进行融合,得到目标推荐结果,最后,将目标推荐结果推送给目标用户。所述方法中,第二推荐结果中的所有推荐内容都在CDN的缓存内容队列中,从而确保推荐系统推荐给用户的推荐结果尽可能的在CDN的缓存内容队列中,当用户向CDN请求推荐结果中包括的推荐内容时,CDN可以从缓存内容队列中获取到用户请求的内容,而不需要从用户请求的内容所在的原始服务器获取,减少了用户等待的时间,并且可以减少CDN的回源带宽的占用。In this embodiment, the recommender system generates a cached content library according to the cached content ID and the entire content library by receiving the cached content identifier in the cached content queue sent by the CDN, and subsequently when the recommender system receives the recommendation request message sent by the client , not only obtain the first recommendation result from the entire content library according to the user interest characteristics and the preset recommendation algorithm, but also obtain the second recommendation result from the cached content library according to the user interest characteristics and the recommendation algorithm, and then, according to the preset The fusion algorithm fuses the first recommendation result and the second recommendation result to obtain the target recommendation result, and finally pushes the target recommendation result to the target user. In the method, all recommended content in the second recommendation result is in the cached content queue of the CDN, thereby ensuring that the recommendation results recommended by the recommendation system to the user are in the cached content queue of the CDN as much as possible. When the user requests a recommendation from the CDN When the recommended content is included in the results, the CDN can obtain the content requested by the user from the cache content queue instead of the original server where the content requested by the user is located, reducing the waiting time of the user and reducing the CDN back-to-source Bandwidth usage.

以下将通过几个具体实施例,对实施例一的方法进行详细说明。The method of Embodiment 1 will be described in detail below through several specific examples.

本发明实施例二具体说明CDN如何向推荐系统发送缓存内容队列中的缓存内容的标识,图3为本发明实施例二提供的CDN和推荐系统的结构示意图,如图3所示,推荐系统包括:缓存内容队列接收器、缓存内容库、推荐结果、全体内容推荐热度库、推荐热度发送器、推送触发器。CDN包括:推荐热度接收器、推荐热度列表、推送触发器、缓存内容队列发送器和缓存内容队列。CDN的缓存内容队列中的缓存内容的标识在CDN的推送触发器控制下,由缓存内容队列发送器发送给推荐系统的缓存内容队列接收器,推荐系统根据缓存内容队列接收器接收到的缓存内容的标识和全体内容库(图3中未示出)获取缓存内容的信息,将缓存内容的标识和缓存内容的信息添加到缓存内容库,推荐系统可以建立多个缓存内容库。Embodiment 2 of the present invention specifically illustrates how the CDN sends the identifier of the cached content in the cached content queue to the recommendation system. FIG. 3 is a schematic structural diagram of the CDN and the recommendation system provided by Embodiment 2 of the invention. As shown in FIG. : Cache content queue receiver, cache content library, recommendation result, all content recommendation popularity library, recommendation popularity sender, push trigger. CDN includes: recommended heat receiver, recommended heat list, push trigger, cached content queue sender, and cached content queue. The identifier of the cached content in the cached content queue of the CDN is sent by the cached content queue sender to the cached content queue receiver of the recommendation system under the control of the push trigger of the CDN, and the recommendation system receives the cached content according to the cached content queue receiver The identifier and the entire content library (not shown in FIG. 3 ) obtain the cached content information, and add the cached content ID and the cached content information to the cached content library, and the recommendation system can establish multiple cached content libraries.

本发明实施例中,为了进一步保证推荐系统推荐给用户的推荐结果在CDN的缓存内容队列中,推荐系统还用于根据推荐结果生成全体内容库中的全体内容的推荐热度,全体内容的推荐热度保存在全体内容推荐热度库中,在推荐系统的推送触发器的控制下荐热度发送器将全体内容推荐热度库中的数据发送给CDN的推荐热度接收器,推荐热度接收器将接收到的全体内容的推荐热度保存在推荐热度列表中。本发明实施例中引入了内容的推荐热度,内容的推荐热度表示内容未来被访问的可能性,内容的推荐热度越大表示内容未来被访问的可能性越大,推荐热度具体可以为内容的推荐次数。In the embodiment of the present invention, in order to further ensure that the recommendation result recommended by the recommendation system to the user is in the cached content queue of the CDN, the recommendation system is also used to generate the recommendation popularity of all content in the entire content library according to the recommendation result, and the recommendation popularity of the entire content Stored in the recommended popularity library of all content, under the control of the push trigger of the recommendation system, the recommended heat sender sends the data in the recommended heat library of all content to the recommended heat receiver of CDN, and the recommended heat receiver will receive all the data The recommendation popularity of the content is saved in the recommendation popularity list. The embodiment of the present invention introduces the recommendation popularity of the content. The recommendation popularity of the content indicates the possibility that the content will be accessed in the future. The greater the recommendation popularity of the content, the greater the possibility of the content being accessed in the future. frequency.

图4为本发明实施例二提供的CDN向推荐系统发送缓存内容的标识的流程图,如图4所示,本实施例提供的方法可以包括以下步骤:FIG. 4 is a flow chart of the CDN sending the identifier of cached content to the recommendation system provided by Embodiment 2 of the present invention. As shown in FIG. 4, the method provided by this embodiment may include the following steps:

步骤301、CDN的推送触发器向缓存内容队列发送器发送触发信号。Step 301, the push trigger of the CDN sends a trigger signal to the cache content queue sender.

本实施例中,CDN的推送触发器可以采用周期性的方式向缓存内容队列发送器发送触发信号,以触发缓存内容队列发送器向推荐系统发送缓存内容的标识。触发信号分为两种,全量触发信号和增量触发信号。缓存内容队列发送器在接收到全量触发信号时,会把所有缓存内容队列前p%缓存内容的url或url的哈希值(根据推荐系统的推荐粒度不同,缓存内容的url可以为对应的url或分片的url)发送给推荐系统。缓存内容队列发送器在接收到增量触发信号时,会把缓存内容队列的前P%的内容相对于上次发送内容的增量数据的url发送给推荐系统,该增量数据为缓存队列内容的全量数据与上次发送时缓存队列内容的全量数据不同的数据,该增量数据一般远小于全量数据。举例来说,假设在t1时刻缓存内容队列中保存的内容是“a,b,c,d,e”,CDN将这些内容的url以全量数据的方式发送给推荐系统,在t2时刻缓存内容队列中保存的内容是“b,c,d,e,f”,此时相对于t1时刻的增量数据为“a,f”,CDN把增量数据的url发送给推荐系统。推荐系统在接收到增量数据后,对比缓存内容库中t1时刻保存的内容信息“a,b,c,d,e”,发现“a”在t1时刻已经存在了,那么就删除掉“a”;发现“f”在t1时刻不存在,那么就把“f”的内容添加到缓存内容库中。In this embodiment, the push trigger of the CDN may send a trigger signal to the cache content queue sender in a periodic manner, so as to trigger the cache content queue sender to send the identifier of the cache content to the recommendation system. There are two types of trigger signals, full trigger signal and incremental trigger signal. When the cache content queue sender receives the full trigger signal, it will put the url or url hash value of p% cache content in front of all cache content queues (according to the recommendation granularity of the recommendation system, the url of the cache content can be the corresponding url or shard url) to the recommendation system. When the cache content queue sender receives the incremental trigger signal, it will send the url of the incremental data of the content of the first P% of the cache content queue relative to the last sent content to the recommendation system. The incremental data is the content of the cache queue The full amount of data is different from the full amount of data in the cache queue content when it was sent last time, and the incremental data is generally much smaller than the full amount of data. For example, assuming that the content stored in the cached content queue at time t1 is "a, b, c, d, e", the CDN sends the urls of these contents to the recommendation system in the form of full data, and the content queue is cached at time t2 The content saved in is "b, c, d, e, f". At this time, the incremental data relative to the time t1 is "a, f", and the CDN sends the url of the incremental data to the recommendation system. After receiving the incremental data, the recommendation system compares the content information "a, b, c, d, e" saved in the cache content library at time t1, and finds that "a" already exists at time t1, then deletes "a" "; find that "f" does not exist at time t1, then add the content of "f" to the cache content library.

本实施例中,全量触发信号采用事件触发和周期性触发两种方式产生。事件触发是指在CDN带宽空闲的时候产生的触发信号;周期性触发是指每隔一个周期T0(如24小时)产生的触发信号。这两种方式可以单独使用,也可以结合使用,两者结合使用的一个示例如:在CND带宽空闲的时候产生事件性触发信号;如果在周期T0的时间内没有产生事件性触发信号,则产生周期性触发信号。In this embodiment, the full trigger signal is generated in two ways: event trigger and periodic trigger. Event trigger refers to the trigger signal generated when the CDN bandwidth is idle; periodic trigger refers to the trigger signal generated every other period T0 (such as 24 hours). These two methods can be used alone or in combination. An example of the combined use of the two is to generate an event trigger signal when the CND bandwidth is idle; if no event trigger signal is generated within the period T0, then generate Periodic trigger signal.

增量触发信号采用周期性的方式产生。一般情况下,增量触发信号的产生周期T1要小于全量触发信号的事件触发时间周期T0。全量触发和增量触发也可以采用结合使用,全量触发和增量触发相结合可以最大限度地保证推荐系统以较小的网络流量代价获得准确缓存内容队列的缓存内容。在某些情况下,如内容库数量较小或者CDN的空闲带宽很充裕的情况下,可以只采用全量触发模式。Incremental trigger signals are generated periodically. Generally, the generation period T1 of the incremental trigger signal is shorter than the event trigger time period T0 of the full trigger signal. Full triggering and incremental triggering can also be used in combination. The combination of full triggering and incremental triggering can ensure that the recommendation system obtains the cached content of the accurate cached content queue at a small cost of network traffic. In some cases, such as when the number of content libraries is small or the idle bandwidth of the CDN is abundant, only the full trigger mode can be used.

步骤302、缓存内容队列发送器判断触发信号是否为全量触发信号。Step 302, the cache content queue sender judges whether the trigger signal is a full amount trigger signal.

若是,即触发信号为全量触发信号,则执行步骤303,若否,即触发信号为增量触发信号,则执行步骤304。If yes, that is, the trigger signal is a full trigger signal, then execute step 303; if not, that is, the trigger signal is an incremental trigger signal, then execute step 304.

步骤303、CDN获取缓存内容队列的前p%的数据。Step 303, the CDN acquires the top p% data of the cached content queue.

CDN可能具有多个缓存内容队列,缓存内容队列中一般是按照缓存内容的热度的顺序排列的,现有技术中,缓存内容的热度为缓存内容的访问热度,本发明实施例中,缓存内容的热度包括缓存内容的访问热度和推荐热度。排列在缓存内容队列尾部的缓存内容队列容量满时会被淘汰出缓存内容队列。所以本实施例中不能选择缓存内容队列的全部缓存内容发送给推荐系统,以避免推荐结果中包含即将被淘汰的内容。因此,CDN在向推荐系统发送缓存内容队列的数据时只选择缓存内容队列中前p%的部分,从而确保推荐系统所推荐的缓存队列内容中的缓存内容在用户访问时依然位于CDN的缓存内容队列中,避免由于推荐内容被淘汰而造成的用户等待时间延长。这里p%的选择可以定义一个时间间隔t(如0.5小时),根据CDN缓存的历史数据,计算历史数据中在时间间隔t中所淘汰的内容占缓存内容队列的平均百分比q%,则p%=1-q%,或者根据经验选择一个百分比,如80%或90%,或者根据其他参数调整的方法(如利用历史数据模拟)来获得p%。The CDN may have multiple cache content queues, and the cache content queues are generally arranged in the order of cache content popularity. In the prior art, the cache content popularity is the cache content access popularity. In the embodiment of the present invention, the cache content Popularity includes access popularity and recommendation popularity of cached content. When the cache content queue at the end of the cache content queue is full, it will be eliminated from the cache content queue. Therefore, in this embodiment, all cached content in the cached content queue cannot be selected to be sent to the recommendation system, so as to avoid content that is about to be eliminated in the recommendation result. Therefore, when the CDN sends the cached content queue data to the recommender system, it only selects the top p% of the cached content queue, so as to ensure that the cached content in the cached queue content recommended by the recommender system is still located in the cached content of the CDN when the user accesses it. In the queue, avoid the prolonged waiting time of users due to the elimination of recommended content. The choice of p% here can define a time interval t (such as 0.5 hours). According to the historical data cached by CDN, calculate the average percentage q% of the content eliminated in the time interval t in the historical data to the cache content queue, then p% =1-q%, or select a percentage based on experience, such as 80% or 90%, or obtain p% according to other parameter adjustment methods (such as using historical data simulation).

CDN的缓存内容队列中保存的内容可以是多媒体对象,多媒体对象基本上可以分为两类,一类是视频和音频等体积较大的多媒体对象,另一类是图片等体积较小的多媒体对象。视频和音频等体积较大的多媒体对象的特点是一个对象通常被划分为多个分片保存在缓存内容队列中,用户在通过浏览器或播放器等客户端访问某个视频和音频等体积较大的多媒体对象时,客户端会向CDN发送获取相关对象分片的请求;而图片等体积较小的多媒体对象通常是不进行分片的,用户在通过客户端访问某个图片等体积较小的多媒体对象时,客户端会向CDN发送获取该对象的请求。由于CDN的缓存内容队列中可能保存的是对象的分片信息,而推荐系统的缓存内容库中保存的是对象的信息,CDN在获得缓存内容队列前p%的分片后,还需要对这些分片进行解析获得该分片所属的对象的信息。The content stored in the cache content queue of CDN can be multimedia objects. Multimedia objects can basically be divided into two categories, one is large multimedia objects such as video and audio, and the other is small multimedia objects such as pictures. . Larger multimedia objects such as video and audio are characterized by the fact that an object is usually divided into multiple fragments and stored in the cache content queue. For large multimedia objects, the client will send a request to the CDN to obtain fragments of related objects; while multimedia objects with small size such as pictures are usually not fragmented, and users access certain pictures through the client. When the multimedia object is displayed, the client will send a request to the CDN to obtain the object. Since the cached content queue of the CDN may store fragmentation information of the object, and the cached content library of the recommendation system stores the information of the object, after the CDN obtains the first p% fragments of the cached content queue, it needs to The fragment is parsed to obtain the information of the object to which the fragment belongs.

如下所示例子中,“187.204.219.57--[09/Jul/2014:04:54:58+0000]"GEThttp://sscdn.clarovideo.com/multimediav81/plataforma_vod/ISM/201301/WMP4H01538MTSS_full/WMP4H01538MTSS_full.ism/QualityLevels(1200000)/Fragments(video=3563560000)HTTP/1.1"200 319213"-""Mozilla/5.0(WindowsNT 6.2;WOW64)AppleWebKit/537.36(KHTML,like Gecko)Chrome/37.0.2008.2 Safari/537.36""-"为用户请求某个视频和音频等体积较大的多媒体对象的分片时产生的CDN日志的一个示例,其中“http://sscdn.clarovideo.com/multimediav81/plataforma_vod/ISM/201301/WMP4H01538MTSS_full/WMP4H01538MTSS_full.ism”为该分片所属多媒体对象的url,QualityLevels(1200000)是该多媒体对象的码率信息,(video=3563560000)是该多媒体对象的类型以及所对应的时间戳。对于以多媒体对象为粒度的推荐系统而言(如推荐某个视频或音频),CDN需要先解析出缓存内容队列前p%分片所属的多媒体对象的url,当某个多媒体对象的分片数量大于一定的阈值(如该多媒体对象的所有分片数量的60%)时,CDN才会认为该多媒体对象保存在了CDN缓存内容队列中,之后CDN会将该多媒体对象的url发送给推荐系统。对于以分片为粒度的推荐系统而言(如推荐某个视频的高潮部分),CDN不需要解析缓存内容队列前p%分片所对应的多媒体对象的url,直接把所请求的分片的url发送给推荐系统即可。In the example shown below, "187.204.219.57--[09/Jul/2014:04:54:58+0000]" GEThttp://sscdn.clarovideo.com/multimediav81/plataforma_vod/ISM/201301/WMP4H01538MTSS_full/WMP4H01538MTSS_full. ism/QualityLevels(1200000)/Fragments(video=3563560000) HTTP/1.1 "200 319213"-""Mozilla/5.0 (WindowsNT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2008.2 Safari/537.36" "-" is an example of a CDN log generated when a user requests a segment of a large multimedia object such as video and audio, among which "http://sscdn.clarovideo.com/multimediav81/plataforma_vod/ISM/201301/ "WMP4H01538MTSS_full/WMP4H01538MTSS_full.ism" is the url of the multimedia object to which the segment belongs, QualityLevels (1200000) is the code rate information of the multimedia object, (video=3563560000) is the type of the multimedia object and the corresponding timestamp. For multimedia For object-based recommendation systems (such as recommending a certain video or audio), the CDN needs to first parse out the url of the multimedia object to which the p% fragments before the cached content queue belong. When the number of fragments of a multimedia object is greater than a certain threshold (such as 60% of the number of all fragments of the multimedia object), the CDN will consider that the multimedia object is stored in the CDN cache content queue, and then the CDN will send the url of the multimedia object to the recommendation system. For a recommender system with granularity (such as recommending the climax of a certain video), the CDN does not need to parse the urls of the multimedia objects corresponding to the p% fragments before the cached content queue, and directly sends the urls of the requested fragments to recommended system.

步骤304、CDN获取缓存内容队列的前p%的数据相对于上次发送的内容的增量数据。In step 304, the CDN acquires incremental data of the top p% data of the cached content queue relative to the content sent last time.

CDN在确定缓存内容队列的前p%的数据后,对比缓存内容队列的前p%的数据和上次发送的内容得到增量数据。After the CDN determines the top p% data of the cache content queue, it compares the top p% data of the cache content queue with the content sent last time to obtain incremental data.

步骤305、CDN将获取到的缓存内容队列的前p%的数据或增量数据的标识发送给推荐系统。In step 305, the CDN sends the identifiers of the acquired top p% data or incremental data of the cached content queue to the recommendation system.

需要注意的是,多媒体对象的url一般数据体积较大,需要进行压缩后才能发送给推荐系统,例如,将多媒体对象的url进行哈希运算后,将url的哈希值发送给推荐系统。It should be noted that the url of the multimedia object generally has a large data volume and needs to be compressed before being sent to the recommendation system. For example, after the url of the multimedia object is hashed, the hash value of the url is sent to the recommendation system.

步骤306、推荐系统根据接收到的缓存内容的标识和全体内容库获取缓存内容的信息,将缓存内容的信息添加到缓存内容库。Step 306 , the recommendation system acquires the information of the cached content according to the received identifier of the cached content and the entire content library, and adds the information of the cached content to the cached content library.

本步骤的具体实现方式可参照实施例一的相关描述,这里不再赘述。For the specific implementation manner of this step, reference may be made to the relevant description of Embodiment 1, which will not be repeated here.

本实施例中,CDN通过将缓存内容队列的前P%的缓存内容的标识,或者,将缓存内容队列的前P%的缓存内容的增量数据的标识发送给推荐系统,以保证推荐系统推荐给的用户推荐结果仍在CDN的缓存内容队列中,后续当用户访问推荐结果时,CDN能够从缓存内容队列中向用户返回请求的内容,从而减少了用户等待的时间。In this embodiment, the CDN sends the identification of the first P% of the cached content of the cached content queue, or the identification of the incremental data of the first P% of the cached content in the cached content queue, to the recommendation system to ensure that the recommendation system recommends The recommended result for the user is still in the CDN's cached content queue. When the user accesses the recommended result later, the CDN can return the requested content from the cached content queue to the user, thereby reducing the user's waiting time.

图5为本发明实施例三提供的推荐系统向CDN发送全体内容库的推荐热度的流程图,请参照图3和图5,本实施例提供的方法可以包括以下步骤:Fig. 5 is a flow chart of sending the recommendation heat of the entire content library to the CDN by the recommendation system provided by the third embodiment of the present invention. Please refer to Fig. 3 and Fig. 5, the method provided by this embodiment may include the following steps:

步骤401、推荐系统的推送触发器向推荐热度发送器发送触发信号。Step 401, the push trigger of the recommendation system sends a trigger signal to the recommendation popularity transmitter.

推荐系统向CDN发送推荐热度信息是在推送触发器的控制下进行的,推荐系统向CDN发送推荐热度时采用全量发送的方式。触发信号也采用事件触发和周期性触发两种方式产生,事件触发例如为:推送触发器在网络空闲带宽较大的时候产生触发信号,周期性触发例如为:推送触发器以一个固定的周期T产生触发信号。T的选择可以根据经验确定,如1小时。这两者触发方式单独使用,也可以组合使用。两者组合使用的一种示例是,以事件性触发信号为主,如果在周期T的时间内没有产生事件性触发信号,则产生周期性触发信号。The recommender system sends recommendation popularity information to the CDN under the control of push triggers, and the recommendation system sends the recommendation popularity information to the CDN in full. The trigger signal is also generated in two ways: event trigger and periodic trigger. Generate a trigger signal. The choice of T can be determined empirically, such as 1 hour. These two trigger methods can be used alone or in combination. An example of the combined use of the two is that the event trigger signal is the main one, and if no event trigger signal is generated within the period T, a periodic trigger signal is generated.

步骤402、推荐热度发送器把推荐热度库中的全体内容库的推荐热度发送给CDN的推荐热度接收器。Step 402, the recommendation popularity sender sends the recommendation popularity of all content libraries in the recommendation popularity database to the recommendation popularity receiver of the CDN.

推荐热度发送器在发送全体内容的推荐热度之前,推荐系统还会根据全体内容库中的全体内容的推荐情况生成推荐热度库,推荐热度库中包括全体内容库中的全体内容在预设时间内的推荐热度。Before sending the recommendation popularity of all content, the recommendation system will also generate a recommendation popularity library according to the recommendation situation of all content in the whole content library. The recommendation popularity library includes all the content in the whole content library within a preset time recommended heat.

本实施例中,推荐系统将全体内容的推荐热度发送给CDN,这样做的目的是使CDN在对缓存内容队列的尾部内容进行淘汰时,不但考虑内容的访问热度,也考虑内容的推荐热度,从而使得目前访问热度小,但未来更有可能被访问的内容不容易淘汰出缓存内容队列。当缓存内容队列中存储的是某个对象的分片时,该分片的推荐热度可以是其所属的对象的推荐热度,也可以是根据该分片在所属的对象中所处的位置进行加权得到的推荐热度,例如,位于对象头部的分片权重取值为0.8,中间高潮部分的权重取值为1.0,尾部的权重取值为0.7,在计算分片的推荐热度时,用分片所属的对象的推荐热度乘以分片的权重得到分片的推荐热度。In this embodiment, the recommendation system sends the recommendation popularity of all content to the CDN. The purpose of this is to make the CDN consider not only the access popularity of the content, but also the recommendation popularity of the content when eliminating the tail content of the cached content queue. As a result, content that is less popular at present but more likely to be accessed in the future is not easily eliminated from the cache content queue. When a fragment of an object is stored in the cache content queue, the recommendation popularity of the fragment can be the recommendation popularity of the object to which it belongs, or it can be weighted according to the position of the fragment in the object to which it belongs The obtained recommendation popularity, for example, the weight value of the slice at the head of the object is 0.8, the weight value of the middle climax part is 1.0, and the weight value of the tail is 0.7. When calculating the recommendation popularity of a slice, use the slice The recommendation popularity of the object to which it belongs is multiplied by the weight of the shard to obtain the recommendation popularity of the shard.

需要注意的是,推荐热度是具有很强的时效性的,所以,用于计算推荐热度的时间窗口W不能够太大,确定该时间窗口大小的方法之一是采用经验值获得,如12小时。推荐热度可以为推荐时间窗口内内容被推荐的次数,该推荐热度可以用一个字节表示,一个字节最多可以表示内容在推荐时间窗口内被推荐了2^8=1024次,推荐热度也可以用更少的比特位来表示,例如采用半个字节,半个字节最多可以表示内容在推荐时间窗口内被推荐了2^4=16次。本实施例中,即使推荐热度发生数据溢出也不会影响推荐热度对缓存内容队列的替换,因为被推荐次数越多的内容有很大的可能性是经常被访问的内容,这些内容可以比较稳定地存在于缓存内容队列中。因此,在对缓存内容队列的缓存内容替换时考虑推荐热度的主要目的是尽可能的让缓存内容队列末尾访问热度小,但是在未来更有可能被访问的内容不被淘汰出去。至于在缓存内容队列前面的内容,本发明不关注其排序的位置前后,因为缓存内容队列前面的内容不管靠前还是靠后,这些内容都可以比较稳定的保存在缓存内容队列中。It should be noted that the recommendation popularity is highly time-sensitive, so the time window W used to calculate the recommendation popularity cannot be too large. One of the methods to determine the size of the time window is to use empirical values, such as 12 hours . The recommendation popularity can be the number of times the content is recommended within the recommendation time window. The recommendation popularity can be represented by one byte. One byte can indicate that the content has been recommended 2^8=1024 times within the recommendation time window at most. The recommendation popularity can also be It is represented by fewer bits, for example, half a byte, and a half byte can at most indicate that the content has been recommended 2^4=16 times within the recommendation time window. In this embodiment, even if data overflow occurs in the recommendation popularity, it will not affect the replacement of the cached content queue by the recommendation popularity, because the content that is recommended more times is likely to be frequently accessed content, and these contents can be relatively stable exists in the cache content queue. Therefore, the main purpose of considering the recommendation popularity when replacing the cached content in the cached content queue is to make the end of the cached content queue less popular as much as possible, but the content that is more likely to be accessed in the future will not be eliminated. As for the content in front of the cache content queue, the present invention does not pay attention to its sorting position, because no matter whether the content in front of the cache content queue is at the front or behind, these contents can be stored in the cache content queue relatively stably.

步骤403、CDN的推荐热度接收器把接收到的全体内容的推荐热度发送给推荐热度列表。Step 403 , the recommendation heat receiver of the CDN sends the received recommendation heat of all content to the recommendation heat list.

本实施例中,推荐系统通过将全体内容库的中全体内容的推荐热度发送给CDN,以便于CDN在对缓存内容队列进行缓存替换时,能够根据缓存内容的推荐热度进行缓存替换,从而保证目前访问热度小,但是未来有可能被访问的内容不容易被淘汰出缓存内容队列,这样,当推荐系统将这部分内容推荐给用户后,用户在向CDN请求这部分内容时,CDN能够从缓存内容队列中向用户返回请求的内容,从而减少了用户等待的时间。In this embodiment, the recommendation system sends the recommendation popularity of all content in the entire content library to the CDN, so that when the CDN caches and replaces the cached content queue, it can perform cache replacement according to the recommendation popularity of the cached content, thereby ensuring the current The access popularity is small, but the content that may be accessed in the future is not easy to be eliminated from the cache content queue. In this way, after the recommendation system recommends this part of content to the user, when the user requests this part of content from the CDN, the CDN can retrieve the content from the cache. The content of the request is returned to the user in the queue, thereby reducing the waiting time of the user.

图6为本发明实施例四提供的网络内容的推荐方法的业务流程的示意图,如图6所示,推荐系统包括数据库和推荐引擎,数据库中包括:生成的用户兴趣特征、全体内容库和缓存内容库,推荐引擎包括核心推荐引擎和融合引擎。核心推荐引擎具有三个输入:用户兴趣特征、全体内容库和缓存内容库,在进行内容推荐时,核心推荐引擎首先根据用户兴趣特征和全体内容库得到第一推荐结果,然后,核心推荐引擎根据用户兴趣特征和缓存内容库得到第二推荐结果,第一推荐结果和第二推荐结果可以用列表的形式展现,例如,第一推荐结果用r_1,r_2,…,r_n表示,第二推荐结果用rq_1,rq_2,…,rq_m表示。最后,融合引擎根据预设的融合算法对第一推荐结果和第二推荐结果进行融合得到目标推荐结果,输出目标推荐结果给客户端。Figure 6 is a schematic diagram of the business process of the method for recommending network content provided by Embodiment 4 of the present invention. As shown in Figure 6, the recommendation system includes a database and a recommendation engine, and the database includes: generated user interest features, the entire content library, and cache Content library, recommendation engine includes core recommendation engine and fusion engine. The core recommendation engine has three inputs: user interest characteristics, the entire content library and the cache content library. When recommending content, the core recommendation engine first obtains the first recommendation result according to the user interest characteristics and the entire content library, and then the core recommendation engine according to The user interest characteristics and the cached content library get the second recommendation result. The first recommendation result and the second recommendation result can be displayed in the form of a list. For example, the first recommendation result is represented by r_1, r_2,..., r_n, and the second recommendation result is represented by rq_1, rq_2,..., rq_m represent. Finally, the fusion engine fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result, and outputs the target recommendation result to the client.

图7为本发明实施例四提供的网络内容的推荐方法的流程图,请参照图6和图7,本实施例提供的方法可以包括以下步骤:FIG. 7 is a flowchart of a method for recommending network content provided in Embodiment 4 of the present invention. Please refer to FIGS. 6 and 7. The method provided in this embodiment may include the following steps:

步骤501、用户A查看推荐页面。Step 501, user A views the recommended page.

步骤502、客户端向网页服务器发送推荐请求消息。Step 502, the client sends a recommendation request message to the web server.

推荐过程是由用户触发的,当用户访问推荐页面,或者浏览完某个对象(如音乐或视频)后,浏览器或播放器就会触发一个推荐过程,向网页服务器发送推荐请求消息。The recommendation process is triggered by the user. When the user visits the recommended page or browses a certain object (such as music or video), the browser or player will trigger a recommendation process and send a recommendation request message to the web server.

步骤503、网页服务器向推荐系统发送用于查询用户A的推荐列表的查询请求消息。Step 503, the webpage server sends a query request message for querying user A's recommendation list to the recommendation system.

步骤504、推荐系统的核心推荐引擎根据用户A的兴趣特征和全体内容库,采用第一推荐算法计算得到第一推荐结果。Step 504, the core recommendation engine of the recommendation system calculates the first recommendation result by using the first recommendation algorithm according to user A's interest characteristics and the entire content library.

步骤505、核心推荐引擎根据用户A的兴趣特征和缓存内容库,采用第二推荐算法计算得到第二推荐结果。Step 505 , the core recommendation engine calculates the second recommendation result by using the second recommendation algorithm according to user A's interest characteristics and cached content library.

缓存队列库中的缓存内容一般是按照更新的顺序排列的,即排列在缓存内容队列尾部的内容当缓存内容队列容量满时会被淘汰出缓存内容队列,核心推荐引擎根据缓存内容队列得到第二推荐结果时,不能选择缓存内容队列的全部缓存内容,以避免推荐结果中包含即将被淘汰的内容。解决方法是核心推荐引擎只选择缓存内容队列的p%的缓存内容,p值的选择方法与实施例二相同,此处不再赘述。The cache content in the cache queue library is generally arranged in the order of updating, that is, the content at the end of the cache content queue will be eliminated from the cache content queue when the cache content queue is full, and the core recommendation engine gets the second according to the cache content queue. When recommending results, you cannot select all cached content in the cached content queue to avoid content that is about to be eliminated in the recommended results. The solution is that the core recommendation engine only selects p% of the cached content in the cached content queue, and the selection method of the p value is the same as that in Embodiment 2, and will not be repeated here.

步骤506、融合引擎从第一推荐结果中删除与第二推荐结果共同的推荐内容得到第三推荐结果。Step 506, the fusion engine deletes the recommended content common to the second recommendation result from the first recommendation result to obtain the third recommendation result.

可选的,在步骤506之后,还可以提高第二推荐结果中共同的推荐内容的得分。Optionally, after step 506, the score of the common recommended content in the second recommendation result may also be increased.

步骤507、融合引擎根据推荐内容的得分对第三推荐结果和第二推荐结果中的推荐内容统一进行排序。Step 507, the fusion engine uniformly sorts the recommended content in the third recommendation result and the second recommendation result according to the scores of the recommended content.

步骤508、融合引擎从排序后的推荐内容中选择K个推荐内容作为目标推荐结果。Step 508, the fusion engine selects K recommended contents from the sorted recommended contents as target recommendation results.

步骤509、融合引擎根据目标推荐结果更新全体内容推荐热度库。Step 509, the fusion engine updates the entire content recommendation popularity database according to the target recommendation result.

如果推荐系统和CDN协同工作,并且CDN需要推荐系统发送的推荐热度进行缓存内容队列的更新,则融合引擎根据目标推荐结果重新确定目标推荐结果中的推荐内容的推荐热度,根据目标推荐结果中的推荐内容的推荐热度更新全体内容推荐热度库,否则,该步骤可省略。If the recommendation system and CDN work together, and the CDN needs the recommendation popularity sent by the recommendation system to update the cached content queue, the fusion engine will re-determine the recommendation popularity of the recommended content in the target recommendation result according to the target recommendation result, The recommended popularity of the recommended content updates the recommended popularity database of the entire content, otherwise, this step can be omitted.

步骤510、融合引擎将目标推荐结果发送给网页服务器。Step 510, the fusion engine sends the target recommendation result to the web server.

步骤511、网页服务器将目标推荐结果转发给客户端。Step 511, the web server forwards the target recommendation result to the client.

步骤512、客户端向用户展示目标推荐结果。Step 512, the client terminal presents the target recommendation result to the user.

图8为本发明实施例五提供的网络内容的推荐方法的流程图,如图8所示,本实施例提供的方法可以包括以下步骤:FIG. 8 is a flowchart of a method for recommending network content provided in Embodiment 5 of the present invention. As shown in FIG. 8, the method provided in this embodiment may include the following steps:

步骤601、用户A查看推荐页面。Step 601, user A views the recommended page.

步骤602、客户端向网页服务器发送推荐请求消息。Step 602, the client sends a recommendation request message to the web server.

步骤603、网页服务器向推荐系统发送用于查询用户A的推荐列表的查询请求消息。Step 603, the webpage server sends a query request message for querying user A's recommendation list to the recommendation system.

步骤604、推荐系统的核心推荐引擎根据用户A的兴趣特征和全体内容库,采用第一推荐算法计算得到第一推荐结果。Step 604 , the core recommendation engine of the recommendation system calculates the first recommendation result by using the first recommendation algorithm according to the user A's interest characteristics and the entire content library.

步骤605、核心推荐引擎从第一推荐结果中选择属于缓存内容库中推荐内容,将所选择的推荐内容作为第二推荐结果。Step 605, the core recommendation engine selects the recommended content belonging to the cached content library from the first recommendation result, and takes the selected recommended content as the second recommendation result.

步骤606、融合引擎从第一推荐结果中删除第二推荐结果,得到第三推荐结果。Step 606, the fusion engine deletes the second recommendation result from the first recommendation result to obtain a third recommendation result.

本实施例中,第二推荐结果中包括的所有推荐内容为第一推荐结果和第二推荐结果共同的推荐内容。可选的,在步骤606之后,还可以提高第二推荐结果中的推荐内容的得分。In this embodiment, all the recommended content included in the second recommended result is common recommended content of the first recommended result and the second recommended result. Optionally, after step 606, the score of the recommended content in the second recommendation result may also be increased.

步骤607、融合引擎从第三推荐结果中选择a%*k个推荐内容。Step 607, the fusion engine selects a%*k recommended content from the third recommended result.

a是一个协调第一推荐结果和第二推荐结果的参数:a=0,则目标推荐结果中的所有推荐内容都来源于缓存内容库;a=1,则目标推荐结果中的所有推荐内容都来源于全体内容库。通常情况下,a可作为一个参数通过历史数据进行模拟获得,或者采用机器学习的算法计算出一个最优值,或者采用在线实验的方法通过用户反馈获得一个最优值。对于CDN和推荐系统协同工作的系统而言,a的取值范围内(0,1),即a大于0且小于1。在确定a的具体取值时,对于偏重于让用户具有快速体验的应用,a的取值应该在不明显影响推荐效果(如精度和召回率等指标)的前提下尽可能的小,即让更多的推荐内容来源缓存内容库;对于偏重于让用户具有多样性体验的应用,a的取值应该在不明显影响用户获取速度的前提下尽可能的大,即让更多的推荐内容来源于全体内容库。a is a parameter to coordinate the first recommendation result and the second recommendation result: a=0, all recommended content in the target recommendation result comes from the cache content library; a=1, all recommended content in the target recommendation result comes from Sourced from the entire content library. Usually, a can be obtained as a parameter by simulating historical data, or using a machine learning algorithm to calculate an optimal value, or using an online experiment method to obtain an optimal value through user feedback. For a system in which the CDN and the recommendation system work together, the value of a is within the range of (0, 1), that is, a is greater than 0 and less than 1. When determining the specific value of a, for applications that focus on allowing users to have a fast experience, the value of a should be as small as possible without significantly affecting the recommendation effect (such as precision and recall). More recommended content sources cache the content library; for applications that focus on allowing users to have a diverse experience, the value of a should be as large as possible without significantly affecting the speed of user acquisition, that is, to allow more recommended content sources in the entire content library.

步骤608、融合引擎从第二推荐结果中选择(1-a%)*k个推荐内容。Step 608, the fusion engine selects (1-a%)*k recommended content from the second recommendation result.

步骤609、融合引擎根据推荐内容的得分,对从第三推荐结果和第二推荐结果中选择的K个推荐内容统一进行排序,得到目标推荐结果。Step 609 , the fusion engine uniformly sorts the K recommended contents selected from the third recommended result and the second recommended result according to the scores of the recommended contents, and obtains the target recommended result.

步骤610、融合引擎根据目标推荐结果更新全体内容推荐热度库。Step 610, the fusion engine updates the entire content recommendation popularity database according to the target recommendation result.

步骤611、融合引擎将目标推荐结果发送给网页服务器。Step 611, the fusion engine sends the target recommendation result to the web server.

步骤612、网页服务器将目标推荐结果转发给客户端。Step 612, the web server forwards the target recommendation result to the client.

步骤613、客户端向用户展示目标推荐结果。Step 613, the client terminal presents the target recommendation result to the user.

需要说明的是,本实施例中的步骤604-606可以和实施例四中步骤504-506互换,本实施例中步骤607-608可以和实施例四中步骤506-507互换。It should be noted that steps 604-606 in this embodiment may be interchanged with steps 504-506 in Embodiment 4, and steps 607-608 in this embodiment may be interchanged with steps 506-507 in Embodiment 4.

图9为CDN边缘服务器的缓存内容队列和候选内容队列的结构示意图,如图9所示,CDN边缘服务器在进行缓存替换时一般会维持两个队列:缓存内容队列和候选内容队列,在本发明各实施例中,缓存内容队列用于存储实际缓存在CDN中的内容,候选内容队列用于存储未来可能被访问的内容,候选内容队列中存储的候选内容并没有缓存在CDN中。CDN边缘服务器具有至少一个缓存内容队列,但是候选内容队列的个数可以是零个、一个或多个。CDN边缘服务器对缓存内容队列和候选内容队列的更新和缓存替换都是基于内容的访问热度和推荐热度,缓存内容和候选内容的访问热度都保存在访问热度列表中,缓存内容和候选内容的推荐热度都保存在推荐热度列表中。当然,缓存内容和候选内容的访问热度也可以分别保存在不同的访问热度列表中,缓存内容和候选内容的推荐热度也分别保存在不同的推荐热度列表中,本发明实施例并对此进行限制。Fig. 9 is a schematic structural diagram of a cache content queue and a candidate content queue of a CDN edge server. As shown in Fig. 9, a CDN edge server generally maintains two queues when performing cache replacement: a cache content queue and a candidate content queue. In each embodiment, the cached content queue is used to store content actually cached in the CDN, the candidate content queue is used to store content that may be accessed in the future, and the candidate content stored in the candidate content queue is not cached in the CDN. The CDN edge server has at least one cache content queue, but the number of candidate content queues can be zero, one or more. The update and cache replacement of the cached content queue and the candidate content queue by the CDN edge server are based on the content's access popularity and recommendation popularity. The access popularity of the cached content and candidate content is stored in the access popularity list, and the cached content and candidate content are recommended. The popularity is saved in the recommended popularity list. Of course, the access popularity of cached content and candidate content can also be stored in different access popularity lists, and the recommendation popularity of cached content and candidate content can also be stored in different recommendation popularity lists, which is not limited in the embodiments of the present invention. .

缓存内容队列用来存放热度较大的内容,缓存内容在缓存内容队列中的位置是按照热度大小进行排序的,内容的热度信息包括:访问热度、推荐热度、根据访问热度和推荐热度计算得到的综合热度、访问热度和推荐热度的组合。当候选内容队列里的某个内容的热度大于一个阈值时,CDN边缘服务器就把该内容加入到缓存内容队列中,并从候选内容队列中删除该内容,阈值的确定方法很多,例如可以是缓存内容队列中的最小热度值,也可以由经验估计等其他方法计算得到的。如果缓存内容队列的长度达到某个阈值(如缓存内容的总大小超过了硬盘容量的90%),则根据缓存替换算法淘汰缓存内容队列中热度最小的一部分内容,直到缓存内容队列的长度小于某个阈值(如缓存内容的总大小小于硬盘容量的85%),缓存内容队列中被淘汰的内容被添加到候选内容队列中。The cached content queue is used to store popular content. The position of the cached content in the cached content queue is sorted according to the popularity. The content's popularity information includes: access popularity, recommendation popularity, calculated based on access popularity and recommendation popularity A combination of comprehensive popularity, visit popularity and recommendation popularity. When the popularity of a certain content in the candidate content queue is greater than a threshold, the CDN edge server will add the content to the cache content queue and delete the content from the candidate content queue. There are many ways to determine the threshold, such as caching The minimum popularity value in the content queue can also be calculated by other methods such as empirical estimation. If the length of the cache content queue reaches a certain threshold (such as the total size of the cache content exceeds 90% of the hard disk capacity), then the least popular part of the cache content queue will be eliminated according to the cache replacement algorithm until the cache content queue The length is less than a certain threshold (such as the total size of the cache content is less than 85% of the hard disk capacity), the eliminated content in the cache content queue is added to the candidate content queue.

候选内容队列用来存放热度较小的内容,候选内容在候选内容队列中按照热度大小进行排序。当某个内容被访问时,如果该内容不在缓存内容队列中,则把该内容保存到候选内容队列中,计算其热度后按照热度进行排序;如果候选内容队列容量已满,则将候选内容队列末尾与候选内容队列新加入的内容总大小相同的内容淘汰出候选内容队列。候选内容队列的长度与缓存内容队列之间并没有固定的比例,并且由于候选内容队列中的内容并没有保存在CDN边缘服务器的硬盘中,所以不占用硬盘存储空间。往候选内容队列中添加新的内容时,如果候选内容队列已满,则淘汰候选内容队列中热度最小的内容,候选内容的热度的计算方法可以与缓存内容的热度计算方法相同,也可以不同。The candidate content queue is used to store less popular content, and the candidate content is sorted according to popularity in the candidate content queue. When a certain content is accessed, if the content is not in the cache content queue, save the content in the candidate content queue, calculate its popularity and sort according to the popularity; if the candidate content queue capacity is full, the candidate content queue The content whose end is the same as the total size of the newly added content in the candidate content queue is eliminated from the candidate content queue. There is no fixed ratio between the length of the candidate content queue and the cached content queue, and since the content in the candidate content queue is not stored in the hard disk of the CDN edge server, it does not occupy hard disk storage space. When adding new content to the candidate content queue, if the candidate content queue is full, then eliminate the content with the least popularity in the candidate content queue. The calculation method of the popularity of the candidate content can be the same as that of the cached content, or it can be different.

访问热度的计算方式很多,例如最不经常使用页置换算法(LeastFrequently Used,简称LFU)和近期最少使用算法(Least Recently Used,简称LRU),LFU中采用某个时间内内容的访问次数作为该内容的访问热度,LRU采用内容最近一次访问时间距离当前时间的时间差作为该内容的访问热度,此时该内容最近一次访问时间距离当前时刻的时间差越小,则该内容的访问热度越大。推荐热度的计算方式也很多,如可以采用内容在某个时间段内被推荐的次数作为该内容的访问热度。需要注意的是推荐系统在进行推荐时可能利用了更广义的信息,如某视频在热门视频排行榜中的位置、得分等信息,因此,推荐热度的计算也可能包含了这类信息。在发明各实施例中,推荐热度由推荐系统根据推荐情况获得的,推荐系统在推送触发器的控制下把全体内容的推荐热度发送给CDN。综合热度的计算方式可以有多种,例如可以对访问热度和推荐热度进行线性或非线性加权,其中加权的权重可以采用经验方式获得,也可以采用机器学习的方法获得最优值。访问热度和推荐热度的组合包括:以访问热度为主,在访问热度相同的情况下,推荐热度越大,则热度越大,也可以以推荐热度为主,在推荐热度相同的情况下,访问热度越大,则热度越大。There are many ways to calculate access popularity, such as the least frequently used page replacement algorithm (Least Frequently Used, referred to as LFU) and the least recently used algorithm (Least Recently Used, referred to as LRU). LRU uses the time difference between the last access time of the content and the current time as the access popularity of the content. At this time, the smaller the time difference between the last access time of the content and the current time, the greater the access popularity of the content. There are also many ways to calculate the recommendation popularity, for example, the number of times a content is recommended within a certain period of time can be used as the access popularity of the content. It should be noted that the recommendation system may use broader information when making recommendations, such as the position and score of a certain video in the popular video rankings. Therefore, the calculation of recommendation popularity may also include such information. In each embodiment of the invention, the recommendation popularity is obtained by the recommendation system according to the recommendation situation, and the recommendation system sends the recommendation popularity of all content to the CDN under the control of the push trigger. There are many ways to calculate the comprehensive popularity. For example, the access popularity and recommendation popularity can be linearly or non-linearly weighted, and the weighted weight can be obtained empirically, or the optimal value can be obtained by machine learning. The combination of visit popularity and recommendation popularity includes: mainly based on visit popularity. In the case of the same visit popularity, the greater the recommendation popularity, the greater the popularity. It can also be based on recommendation popularity. In the case of the same recommendation popularity, the visit The hotter it gets, the hotter it gets.

图10为本发明实施例六提供的网络内容的缓存替换方法的流程图,请参照图9和图10,本实施例提供的方法可以包括以下步骤:FIG. 10 is a flow chart of a cache replacement method for network content provided in Embodiment 6 of the present invention. Please refer to FIGS. 9 and 10. The method provided in this embodiment may include the following steps:

步骤701、CDN边缘服务器获取缓存内容队列中的缓存内容的推荐热度和访问热度。Step 701, the CDN edge server obtains the recommendation popularity and access popularity of the cached content in the cached content queue.

具体的,推荐系统根据缓存内容队列中的缓存内容的历史访问情况生成缓存内容队列中的缓存内容的访问热度。推荐系统根据接收推荐系统发送的缓存内容队列中的缓存内容的推荐热度,缓存内容队列中的缓存内容的推荐热度是推荐系统根据缓存内容队列中的缓存内容的推荐情况生成的,推荐系统在向CDN发送推荐热度时,会将全体内容库中的所有内容的推荐热度都发送给CDN边缘服务器。Specifically, the recommendation system generates the access popularity of the cached content in the cached content queue according to the historical access conditions of the cached content in the cached content queue. The recommendation system is based on the recommendation popularity of the cached content in the cached content queue sent by the recommendation system. When the CDN sends the recommendation heat, it will send the recommendation heat of all content in the entire content library to the CDN edge server.

步骤702、CDN边缘服务器根据缓存内容队列中的缓存内容的访问热度和推荐热度对缓存内容队列进行缓存替换。In step 702, the CDN edge server performs cache replacement on the cache content queue according to the access popularity and recommendation popularity of the cache content in the cache content queue.

CDN边缘服务器会定时检测自己的硬盘剩余空间的大小,如每隔十分钟检测一次。如果检测到硬盘存储的缓存内容的大小超过了第一阈值(如硬盘容量的90%),那么CDN边缘服务器就会启动缓存替换过程,直到硬盘存储的缓存内容的大小低于第二阈值(如硬盘容量的85%)。缓存内容队列的缓存替换过程一般是淘汰热度最小的缓存内容。The CDN edge server will periodically detect the size of the remaining space of its own hard disk, for example, every ten minutes. If it is detected that the size of the cache content stored on the hard disk exceeds the first threshold (such as 90% of the hard disk capacity), the CDN edge server will start the cache replacement process until the size of the cache content stored on the hard disk is lower than the second threshold (such as 85% of the hard disk capacity). The cache replacement process of the cache content queue is generally to eliminate the least popular cache content.

一种实现方式中,若缓存内容队列中的缓存内容的大小大于或等于第一阈值,则CDN边缘服务器确定对缓存内容队列的队尾热度较小的缓存内容进行淘汰,通常缓存内容队列中的缓存内容按照访问热度从高到低进行排序,缓存内容队列队尾的缓存内容的访问热度小,缓存内容队列的队尾需要淘汰的缓存内容中某些缓存内容的访问热度可能相同。对于访问热度相同的缓存内容,CDN边缘服务器可以进一步比较缓存内容的推荐热度。具体的,CDN边缘服务器比较缓存内容队列的队尾具有相同访问热度的缓存内容的推荐热度,淘汰具有相同访问热度的缓存内容中推荐热度较小的缓存内容,直到缓存内容队列中的缓存内容的大小小于第二阈值,停止对缓存内容队列进行淘汰,第二阈值小于或等于所述第一阈值。例如,CDN边缘服务器每次需要淘汰缓存内容队列队尾10个缓存内容,但是,缓存内容队列队尾有12个缓存内容的访问热度都相同,那么,CDN边缘服务器比较这12个缓存内容的推荐热度,从这12个缓存内容中淘汰推荐热度较小的10个缓存内容。In one implementation, if the size of the cached content in the cached content queue is greater than or equal to the first threshold, the CDN edge server determines to eliminate the cached content at the end of the cached content queue with less heat. Usually, the cached content in the cached content queue The cache content is sorted from high to low according to the access popularity. The cache content at the end of the cache content queue has a low access popularity. Some of the cache contents at the end of the cache content queue that need to be eliminated may have the same access popularity. For cached content with the same access popularity, the CDN edge server can further compare the recommendation popularity of the cached content. Specifically, the CDN edge server compares the recommended popularity of the cached content with the same access popularity at the end of the cache content queue, and eliminates the recommended cache content with the same access popularity. If the size is smaller than the second threshold, stop eliminating the cached content queue, and the second threshold is smaller than or equal to the first threshold. For example, the CDN edge server needs to eliminate 10 cached contents at the end of the cached content queue every time, but there are 12 cached contents at the end of the cached content queue with the same access heat, then the CDN edge server compares the recommendations of these 12 cached contents Popularity, out of the 12 cached contents, recommend 10 less popular cached contents.

另一种实现方式中,若缓存内容队列中的缓存内容的大小大于或等于第一阈值,则CDN边缘服务器确定对缓存内容队列的队尾的访问热度较小的缓存内容进行淘汰。然后,CDN边缘服务器根据缓存内容队列的队尾的缓存内容的访问热度和推荐热度,计算缓存内容队列的队尾中缓存内容的综合热度;CDN边缘服务器淘汰缓存内容队列的队尾中综合热度较小的缓存内容,直到缓存内容队列中的缓存内容的大小小于第二阈值,则停止对缓存内容队列进行淘汰。例如,CDN边缘服务器每次需要淘汰缓存内容队列队尾10个缓存内容,但是,缓存内容队列队尾有12个缓存内容的访问热度都相同,那么,CDN边缘服务器可以根据推荐热度和访问热度计算这12个缓存内容的综合热度,从这12个缓存内容中淘汰综合热度较小的10个缓存内容。In another implementation manner, if the size of the cached content in the cached content queue is greater than or equal to the first threshold, the CDN edge server determines to eliminate the cached content at the tail of the cached content queue with less popular access. Then, the CDN edge server calculates the comprehensive heat of the cache content in the tail of the cache content queue according to the access heat and recommendation heat of the cache content at the tail of the cache content queue; the CDN edge server eliminates the comprehensive heat of the cache content in the tail of the queue Small cache content, until the size of the cache content in the cache content queue is smaller than the second threshold, then stop eliminating the cache content queue. For example, the CDN edge server needs to eliminate 10 cached contents at the end of the cached content queue every time, but there are 12 cached contents at the end of the cached content queue with the same access heat, then the CDN edge server can calculate according to the recommendation heat and access heat Based on the comprehensive popularity of the 12 cached contents, 10 cached contents with lower comprehensive popularity are eliminated from the 12 cached contents.

本实施例中,CDN边缘服务器获取缓存内容队列中的缓存内容的推荐热度和访问热度,当需要对缓存内容队列进行缓存替换时,根据缓存内容队列中的缓存内容的访问热度和推荐热度对缓存内容队列进行缓存替换。所述方法中,在对缓存内容队列进行缓存替换时,不仅考虑了缓存内容的访问热度,还考虑缓存内容的推荐热度,从而尽可能地把推荐热度高的内容保留在缓存中,使用户可以更快的获取推荐系统所推荐的内容。In this embodiment, the CDN edge server obtains the recommendation popularity and access popularity of the cached content in the cached content queue, and when the cached content queue needs to be cached and replaced, the cache is updated according to the cached content's access popularity and recommended popularity in the cached content queue. The content queue does cache replacement. In the method, when performing cache replacement on the cached content queue, not only the access popularity of the cached content, but also the recommendation popularity of the cached content are considered, so that the content with high recommendation popularity is kept in the cache as much as possible, so that the user can Get the content recommended by the recommendation system faster.

图11为本发明实施例七提供的网络内容的缓存替换方法的流程图,本实施例的实施例六的区别在于:本实施例中,CDN边缘服务器即包括缓存内容队列又包括候选内容队列时,CDN边缘服务器在对候选内容队列进行缓存替换时,也根据候选内容的推荐热度对候选内容队列进行缓存替换。如图11所示,本实施例提供的方法可以包括以下步骤:Fig. 11 is a flow chart of the cache replacement method for network content provided by Embodiment 7 of the present invention. The difference between Embodiment 6 of this embodiment is that in this embodiment, when the CDN edge server includes both the cached content queue and the candidate content queue , when the CDN edge server caches and replaces the candidate content queue, it also caches and replaces the candidate content queue according to the recommendation popularity of the candidate content. As shown in Figure 11, the method provided in this embodiment may include the following steps:

步骤801、CDN边缘服务器获取缓存内容队列中的缓存内容的推荐热度和访问热度。Step 801, the CDN edge server obtains the recommendation popularity and access popularity of the cached content in the cached content queue.

步骤802、CDN边缘服务器根据缓存内容队列中的缓存内容的访问热度和推荐热度对缓存内容队列进行缓存替换。Step 802, the CDN edge server performs cache replacement on the cache content queue according to the cache content access popularity and recommendation popularity in the cache content queue.

步骤801和802的具体实现方式可参照实施例六的描述,这里不再赘述。For the specific implementation manner of steps 801 and 802, reference may be made to the description of Embodiment 6, and details are not repeated here.

步骤803、CDN边缘服务器获取候选内容队列中的候选内容的推荐热度和访问热度。Step 803, the CDN edge server obtains the recommendation popularity and access popularity of the candidate content in the candidate content queue.

具体的,CDN边缘服务器根据候选内容队列中的候选内容的历史访问情况生成该候选内容的访问热度,推荐系统接收推荐系统发送的该候选内容的推荐热度,该候选内容的推荐热度是推荐系统根据该候选内容的推荐情况生成的。Specifically, the CDN edge server generates the access popularity of the candidate content according to the historical access status of the candidate content in the candidate content queue, and the recommendation system receives the recommendation popularity of the candidate content sent by the recommendation system. generated by the recommendation of the candidate content.

步骤804、CDN边缘服务器根据候选内容队列中的候选内容的推荐热度和访问热度对候选内容队列进行缓存替换。Step 804, the CDN edge server caches and replaces the candidate content queue according to the recommendation popularity and access popularity of the candidate content in the candidate content queue.

一种实现方式中,若候选内容队列中的候选内容的大小大于或等于第三阈值,则CDN边缘服务器确定对候选内容队列的队尾的访问热度较小的候选内容进行淘汰。通常候选内容队列中的候选内容按照访问热度从高到低进行排序,候选内容队列队尾的候选内容的访问热度小,候选内容队列的队尾需要淘汰的候选内容中某些候选内容的访问热度可能相同。对于访问热度相同的候选内容,CDN边缘服务器可以进一步比较候选内容的推荐热度。具体的,CDN边缘服务器比较候选内容队列中具有相同访问热度的候选内容的推荐热度,淘汰具有相同访问热度的候选内容中推荐热度较小的候选内容,直到候选内容队列中的候选内容的大小小于第四阈值,则停止对候选内容队列进行淘汰,第四阈值小于或等于第三阈值。In an implementation manner, if the size of the candidate content in the candidate content queue is greater than or equal to the third threshold, the CDN edge server determines to eliminate the candidate content at the tail of the candidate content queue that has less popular access. Usually, the candidate content in the candidate content queue is sorted according to the access popularity from high to low. The access popularity of the candidate content at the tail of the candidate content queue is low, and the access popularity of some candidate content among the candidate content that needs to be eliminated at the tail of the candidate content queue Probably the same. For candidate content with the same access popularity, the CDN edge server can further compare the recommendation popularity of the candidate content. Specifically, the CDN edge server compares the recommendation popularity of the candidate content with the same access popularity in the candidate content queue, and eliminates the candidate content with the lower recommendation popularity among the candidate content with the same access popularity, until the size of the candidate content in the candidate content queue is less than the fourth threshold, stop eliminating the candidate content queue, and the fourth threshold is less than or equal to the third threshold.

另一种实现方式中,若候选内容队列中的候选内容的大小大于或等于第三阈值,则CDN边缘服务器确定对候选内容队列的队尾的访问热度较小的候选内容进行淘汰;然后,CDN边缘服务器根据候选内容队列的队尾中候选内容的访问热度和推荐热度,计算候选内容队列的队尾中候选内容的综合热度;最后,比较候选内容队列的队尾中候选内容的综合热度,淘汰候选内容队列的队尾中候选内容的综合热度较小的候选内容,直到候选内容队列中的候选内容的大小小于第四阈值,则停止对候选内容队列进行淘汰,第四阈值小于或等于第三阈值。In another implementation, if the size of the candidate content in the candidate content queue is greater than or equal to the third threshold, the CDN edge server determines to eliminate the candidate content with less popular access at the tail of the candidate content queue; then, the CDN The edge server calculates the comprehensive popularity of the candidate content in the tail of the candidate content queue according to the access popularity and recommendation popularity of the candidate content in the queue tail of the candidate content queue; finally, compares the comprehensive popularity of the candidate content in the queue tail of the candidate content queue, and eliminates In the tail of the candidate content queue, the candidate content whose comprehensive popularity is small, until the size of the candidate content in the candidate content queue is less than the fourth threshold, then stop eliminating the candidate content queue. The fourth threshold is less than or equal to the third threshold. threshold.

本实施例中,在对缓存内容队列和候选内容队列进行缓存替换时,不仅考虑了缓存内容和候选内容的访问热度,还考虑缓存内容和候选内容的推荐热度,从而尽可能地把推荐热度高的内容保留在缓存中,使用户可以更快的获取推荐系统所推荐的内容。In this embodiment, when cache replacement is performed on the cached content queue and the candidate content queue, not only the access popularity of the cached content and the candidate content is considered, but also the recommendation popularity of the cached content and the candidate content is considered, so as to make the recommendation popularity as high as possible. The content is kept in the cache, so that users can get the content recommended by the recommendation system faster.

CDN把推荐热度用于缓存替换时,一种方法是对整个缓存内容队列的更新和淘汰都考虑推荐热度;另一种方法是仅仅在对缓存内容队列的队尾进行淘汰时才考虑推荐热度,比如,在淘汰访问热度较小的缓存内容队列队尾数据时,优先淘汰访问热度相同但推荐热度较小的内容,这两种方式也可以应用在候选内容队列的缓存替换中。实施例六和实施例七的方法中,将推荐热度应用在对缓存内容队列和候选内容队列的队尾进行淘汰的过程中,以下两个实施例中,CDN将推荐热度应用在对整个缓存内容队列的更新和淘汰过程中。When CDN uses recommendation heat for cache replacement, one method is to consider recommendation heat for updating and eliminating the entire cache content queue; another method is to consider recommendation heat only when eliminating the tail of the cache content queue. For example, when eliminating the tail data of the cache content queue with less access popularity, priority is given to eliminating content with the same access popularity but less recommendation popularity. These two methods can also be applied to the cache replacement of the candidate content queue. In the methods of Embodiment 6 and Embodiment 7, the recommendation heat is applied to the process of eliminating the tail of the cache content queue and the candidate content queue. In the following two embodiments, the CDN applies the recommendation heat to the entire cache content Queues are in the process of being updated and eliminated.

图12为本发明实施例八提供的网络内容的缓存替换方法的流程图,如图12所示,本实施例的方法可以包括以下步骤:FIG. 12 is a flow chart of a cache replacement method for network content provided in Embodiment 8 of the present invention. As shown in FIG. 12 , the method in this embodiment may include the following steps:

步骤901、CDN边缘服务器接收客户端发送的内容获取请求,内容获取请求中包括待访问内容的标识信息。In step 901, the CDN edge server receives the content acquisition request sent by the client, and the content acquisition request includes identification information of the content to be accessed.

CDN的缓存替换过程由用户的访问触发,当用户点击推荐页面的推荐结果或者终端应用上的某个内容时,就触发一个缓存替换过程,客户端会向CDN边缘服务器发送一个内容获取请求。The CDN’s cache replacement process is triggered by user access. When a user clicks on a recommendation result on a recommended page or a certain content on a terminal application, a cache replacement process is triggered, and the client sends a content acquisition request to the CDN edge server.

需要说明的是,客户端并不是直接向CDN边缘服务器发送内容获取请求,客户端首先向CDN的DNS服务器发送地址解析请求,地址解析请求中包括待访问内容的标识信息,DNS服务器根据待访问内容的标识确定距离用户最近的边缘集群,该距离用户最近的边缘集群中包括至少一个CDN边缘服务器,当该距离用户最近的边缘集群中包括一个CDN边缘服务器时,DNS直接将该CDN边缘服务器的IP地址返回给客户端,客户端向该CDN边缘服务器发送内容获取请求。当该距离用户最近的边缘集群中包括多个CDN边缘服务器时,每个CDN边缘服务器都具有独立的IP地址,并仅保存一部分缓存内容,缓存内容在集群中按照一定的方式进行分配,例如,可以对缓存内容的url的值进行Hash计算获得缓存内容的Hash值,不同的CDN边缘服务器保存不同的Hash值范围对应的缓存内容,这样,边缘集群中的每个CDN边缘服务器根据一个内容的url的Hash值就可以确定该内容在哪个CDN边缘服务器中。若DNS知道距离用户最近的边缘集群中的每个CDN边缘服务器所存储的缓存内容的Hash值的范围,那么DNS服务器根据待访问内容的url计算得到待访问内容的url的Hash值,根据待访问内容的url的Hash值从该多个CDN边缘服务器中找到待访问内容所在的CDN边缘服务器,将待访问内容所在的CDN边缘服务器的IP地址返回给客户端,客户端向待访问内容所在的CDN边缘服务器发送内容获取请求。若DNS知道距离用户最近的边缘集群中的每个CDN边缘服务器所存储的缓存内容的Hash值的范围,那么DNS服务器从距离用户最近的边缘集群中找到负载最小的CDN边缘服务器,向CDN边缘服务器发送内容获取请求,该负载最小的CDN边缘服务器通过计算待访问内容的url的Hash值,找到待访问内容所在的CDN边缘服务器,并将待访问内容所在的CDN边缘服务器的IP地址返回给DNS服务器,DNS服务器将待访问内容所在的CDN边缘服务器的IP地址转发给客户端,客户端根据待访问内容所在的CDN边缘服务器的IP地址,向待访问内容所在的CDN边缘服务器的IP地址发送内容获取请求。It should be noted that the client does not directly send a content acquisition request to the CDN edge server. The client first sends an address resolution request to the DNS server of the CDN. The address resolution request includes the identification information of the content to be accessed. Identify the edge cluster closest to the user. The edge cluster closest to the user includes at least one CDN edge server. When the edge cluster closest to the user includes a CDN edge server, the DNS directly uses the IP address of the CDN edge server. The address is returned to the client, and the client sends a content acquisition request to the CDN edge server. When the edge cluster closest to the user includes multiple CDN edge servers, each CDN edge server has an independent IP address, and only saves a part of the cache content, and the cache content is distributed in a certain way in the cluster, for example, Hash calculation can be performed on the url value of the cached content to obtain the Hash value of the cached content. Different CDN edge servers store cached content corresponding to different Hash value ranges. In this way, each CDN edge server in the edge cluster according to the url of a content Hash value can determine which CDN edge server the content is in. If the DNS knows the range of the hash value of the cached content stored in each CDN edge server in the edge cluster closest to the user, then the DNS server calculates the hash value of the url of the content to be accessed according to the url of the content to be accessed, and according to the The Hash value of the url of the content finds the CDN edge server where the content to be accessed is located from the multiple CDN edge servers, and returns the IP address of the CDN edge server where the content to be accessed is located to the client, and the client sends the request to the CDN where the content to be accessed is located. The edge server sends a content acquisition request. If the DNS knows the range of the hash value of the cached content stored by each CDN edge server in the edge cluster closest to the user, then the DNS server finds the CDN edge server with the least load from the edge cluster closest to the user, and sends the request to the CDN edge server Send a content acquisition request, the CDN edge server with the smallest load finds the CDN edge server where the content to be accessed is located by calculating the Hash value of the url of the content to be accessed, and returns the IP address of the CDN edge server where the content to be accessed is located to the DNS server , the DNS server forwards the IP address of the CDN edge server where the content to be accessed is located to the client, and the client sends content acquisition to the IP address of the CDN edge server where the content to be accessed is based on the IP address of the CDN edge server where the content to be accessed is located ask.

步骤902、CDN边缘服务器根据待访问内容的标识信息确定待访问内容是否在自己的缓存内容队列中。Step 902, the CDN edge server determines whether the content to be accessed is in its cache content queue according to the identification information of the content to be accessed.

若待访问内容的标识信息为待访问内容的url时CDN边缘服务器可以判断待访问内容的url的Hash值是否在自己的Hash值范围内,若待访问内容的url的Hash值在自己的Hash值范围内,则确定待访问内容在自己的缓存内容队列中,若待访问内容的url的Hash值不在自己的Hash值范围内,则确定待访问内容不在自己的缓存内容队列中。CDN边缘服务器也可以直接判断待访问内容的url是否在自己的缓存内容队列中。If the identification information of the content to be accessed is the url of the content to be accessed, the CDN edge server can judge whether the hash value of the url of the content to be accessed is within its own hash value range, if the hash value of the url of the content to be accessed is within its own hash value If the hash value of the url of the content to be accessed is not within the range of the hash value, it is determined that the content to be accessed is not in the cached content queue. The CDN edge server can also directly determine whether the url of the content to be accessed is in its own cache content queue.

步骤903、若待访问内容在缓存内容队列中,则CDN边缘服务器向客户端返回待访问内容。Step 903: If the content to be accessed is in the cached content queue, the CDN edge server returns the content to be accessed to the client.

步骤904、CDN边缘服务器更新待访问内容的访问热度,并根据待访问内容的访问热度和待访问内容的推荐热度计算待访问内容的热度信息,根据待访问内容的热度信息更新缓存内容队列。Step 904: The CDN edge server updates the access popularity of the content to be accessed, calculates the popularity information of the content to be accessed according to the access popularity of the content to be accessed and the recommendation popularity of the content to be accessed, and updates the cached content queue according to the popularity information of the content to be accessed.

这里的待访问内容的热度信息可以为待访问内容的综合热度,也可以为待访问内容的访问热度和推荐热度的组合。缓存内容队列中的缓存内容都是根据热度信息排序的,这里根据待访问内容的热度信息更新缓存内容队列,即根据待访问内容的热度信息调整缓存内容队列中缓存内容的排序。Here, the popularity information of the content to be accessed may be the comprehensive popularity of the content to be accessed, or a combination of the popularity of the content to be accessed and the popularity of recommendation. The cached content in the cached content queue is sorted according to the heat information. Here, the cached content queue is updated according to the heat information of the content to be accessed, that is, the order of the cached content in the cached content queue is adjusted according to the heat information of the content to be accessed.

若缓存内容队列中的缓存内容根据综合热度进行排序,那么,根据待访问内容的访问热度和待访问内容的推荐热度计算待访问内容的热度信息,根据待访问内容的热度信息更新缓存内容队列,具体为:CDN边缘服务器对待访问内容的访问热度和推荐热度采用线性加权或非线性加权的方式计算得到待访问内容的综合热度,然后,CDN边缘服务器根据待访问内容的综合热度调整缓存内容队列中的缓存内容的排序。If the cached content in the cached content queue is sorted according to the comprehensive heat, then, calculate the heat information of the content to be accessed according to the heat of the content to be accessed and the recommended heat of the content to be accessed, and update the cached content queue according to the heat information of the content to be accessed, Specifically: the CDN edge server calculates the access popularity and recommendation popularity of the content to be accessed in a linear or non-linear weighted manner to obtain the comprehensive popularity of the content to be accessed, and then, the CDN edge server adjusts the cache content queue according to the comprehensive popularity of the content to be accessed The ordering of the cached content.

若缓存内容队列中的缓存内容以访问热度为主进行排序,当两个缓存内容的访问热度相同时,则比较这两个缓存内容的推荐热度,推荐热度大的缓存内容的热度大,排序时顺序在推荐热度小的缓存内容之前。那么,根据待访问内容的访问热度和待访问内容的推荐热度计算待访问内容的热度信息,根据待访问内容的热度信息更新缓存内容队列,具体为:CDN边缘服务器比较待访问内容和缓存内容队列中其他缓存内容的访问热度的大小,若待访问内容的访问热度没有和其他缓存内容的访问热度相同,则CDN边缘服务器直接更新缓存内容队列,若待访问内容的访问热度和某个缓存内容的访问热度相同,则CDN边缘服务器比较待访问内容的推荐热度和该具有相同访问热度的缓存内容的推荐热度,若较待访问内容的推荐热度大于该具有相同访问热度的缓存内容的推荐热度,则待访问内容的顺序在该具有相同访问热度的缓存内容之前,若较待访问内容的推荐热度小于该具有相同访问热度的缓存内容的推荐热度,则待访问内容的顺序在该具有相同访问热度的缓存内容之后,若较待访问内容的推荐热度等于该具有相同访问热度的缓存内容的推荐热度,则待访问内容的顺序在该具有相同访问热度的缓存内容的顺序之前或之后都可以。If the cache content in the cache content queue is sorted based on the access popularity, when the access popularity of the two cache contents is the same, the recommendation popularity of the two cache contents is compared, and the cache content with the higher recommendation popularity is more popular. The order is before recommending less popular cached content. Then, calculate the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed, and update the cache content queue according to the popularity information of the content to be accessed, specifically: the CDN edge server compares the content to be accessed with the cache content queue The access popularity of other cached content in the CDN, if the access popularity of the content to be accessed is not the same as that of other cached content, the CDN edge server directly updates the queue of cached content, if the access popularity of the content to be accessed is the same as that of a certain cached content If the access popularity is the same, the CDN edge server compares the recommendation popularity of the content to be accessed with the recommendation popularity of the cached content with the same access popularity. If the recommendation popularity of the content to be accessed is greater than the recommendation popularity of the cached content with the same access popularity, then The order of the content to be accessed is before the cached content with the same access popularity. If the recommendation popularity of the content to be accessed is lower than the recommendation popularity of the cached content with the same access popularity, the order of the content to be accessed is before the cached content with the same access popularity. After caching the content, if the recommendation popularity of the content to be accessed is equal to the recommendation popularity of the cached content with the same access popularity, the order of the content to be accessed can be before or after the sequence of the cached content with the same access popularity.

若缓存内容队列中的缓存内容以推荐热度为主进行排序,当两个缓存内容的推荐热度相同时,则比较这两个缓存内容的访问热度,访问热度大的缓存内容的热度大,排序时顺序在访问热度小的缓存内容之前。那么,根据待访问内容的访问热度和待访问内容的推荐热度计算待访问内容的热度信息,根据待访问内容的热度信息更新缓存内容队列,具体为:CDN边缘服务器比较待访问内容和缓存内容队列中其他缓存内容的推荐热度的大小,若待访问内容的推荐热度没有和其他缓存内容的推荐热度相同,则CDN边缘服务器直接更新缓存内容队列,若待访问内容的推荐热度和某个缓存内容的推荐热度相同,则CDN边缘服务器比较待访问内容的访问热度和该具有相同访问推荐的缓存内容的访问热度,若较待访问内容的访问热度大于该具有相同推荐热度的缓存内容的访问热度,则待访问内容的顺序在该具有相同推荐热度的缓存内容之前,若较待访问内容的访问热度小于该具有相同推荐热度的缓存内容的访问热度,则待访问内容的顺序在该具有相同推荐热度的缓存内容之后,若较待访问内容的访问热度等于该具有相同缓存热度的缓存内容的访问热度,则待访问内容的顺序在该具有相同推荐热度的缓存内容的顺序之前或之后都可以。If the cache content in the cache content queue is sorted based on recommendation popularity, when the recommendation popularity of two cache contents is the same, the access popularity of the two cache contents is compared, and the cache content with higher access popularity is more popular, when sorting Sequence before accessing less popular cached content. Then, calculate the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed, and update the cache content queue according to the popularity information of the content to be accessed, specifically: the CDN edge server compares the content to be accessed with the cache content queue If the recommended popularity of the content to be accessed is not the same as that of other cached content, the CDN edge server will directly update the queue of cached content. If the recommendation popularity is the same, the CDN edge server compares the access popularity of the content to be accessed with the cache content with the same recommendation. If the access popularity of the content to be accessed is greater than that of the cached content with the same recommendation popularity, then The order of the content to be accessed is before the cached content with the same recommendation popularity. After caching the content, if the access popularity of the content to be accessed is equal to the access popularity of the cached content with the same cache popularity, the order of the content to be accessed can be before or after the order of the cached content with the same recommendation popularity.

步骤905、当需要对缓存内容队列进行缓存替换时,CDN边缘服务器根据缓存内容队列中缓存内容的热度信息,淘汰缓存内容队列中热度较小的缓存内容。Step 905: When it is necessary to perform cache replacement on the cached content queue, the CDN edge server eliminates less popular cached content in the cached content queue according to the popularity information of the cached content in the cached content queue.

本实施例中,CDN边缘在对缓存内容队列进行更新时,根据缓存内容的访问热度和推荐热度进行更新,因此,缓存内容队列中的所有缓存内容的顺序都是根据访问热度和推荐热度排序的,这样后续在对缓存内容队列进行缓存替换时,直接淘汰缓存内容队列的队尾热度较小的缓存内容,而不再不需要根据缓存内容的访问热度和推荐热度计算队尾的缓存内容的热度信息,根据计算得到的热度信息进行排序。In this embodiment, when the CDN edge updates the cache content queue, it updates according to the access popularity and recommendation popularity of the cache content. Therefore, the order of all cache content in the cache content queue is sorted according to the access popularity and recommendation popularity. , so that when performing cache replacement on the cache content queue in the future, the cache content with lower popularity at the tail of the cache content queue will be directly eliminated, and it is no longer necessary to calculate the heat information of the cache content at the tail of the queue based on the access heat and recommendation heat of the cache content , sorted according to the calculated popularity information.

本实施例中,CDN边缘服务器通过根据待访问内容的访问热度和待访问内容的推荐热度更新缓存内容队列,以便于在对缓存内容进行缓存替换时,能够保证当前时刻访问热度小,但是未来访问可能性大的缓存内容不容易被淘汰出缓存内容队列,后续当用户访问推荐结果时,CDN能够从缓存内容队列中向用户返回请求的内容,从而减少了用户等待的时间。In this embodiment, the CDN edge server updates the cache content queue according to the access popularity of the content to be accessed and the recommendation popularity of the content to be accessed, so that when the cache content is cached and replaced, it can ensure that the current access popularity is small, but future access The cached content with high probability is not easy to be eliminated from the cached content queue. When the user accesses the recommendation result later, the CDN can return the requested content from the cached content queue to the user, thereby reducing the waiting time of the user.

图13为本发明实施例九提供的网络内容的缓存替换方法的流程图,本实施例和实施例八的区别在于:本实施例中,CDN边缘服务器即包括缓存内容队列又包括候选内容队列时,CDN边缘服务器在对候选内容队列进行更新时,也根据候选内容的推荐热度和访问热度对候选内容队列进行更新。本实施例的方法由CDN边缘服务器执行,如图13所示,本实施例的方法可以包括以下步骤:Fig. 13 is a flow chart of the cache replacement method for network content provided by Embodiment 9 of the present invention. The difference between this embodiment and Embodiment 8 is that in this embodiment, when the CDN edge server includes both cached content queues and candidate content queues , when the CDN edge server updates the candidate content queue, it also updates the candidate content queue according to the recommendation popularity and access popularity of the candidate content. The method of this embodiment is executed by the CDN edge server, as shown in Figure 13, the method of this embodiment may include the following steps:

步骤1001、接收客户端发送的内容获取请求,内容获取请求中包括待访问内容的标识信息。Step 1001: Receive a content acquisition request sent by a client, where the content acquisition request includes identification information of the content to be accessed.

步骤1002、根据待访问内容的标识信息确定待访问内容是否在缓存内容队列中。Step 1002: Determine whether the content to be accessed is in the cached content queue according to the identification information of the content to be accessed.

若待访问内容在CDN边缘服务器的缓存内容队列中,则执行步骤1003,若待访问内容不在CDN边缘服务器的缓存内容队列中,则执行步骤1005。If the content to be accessed is in the cached content queue of the CDN edge server, then step 1003 is performed; if the content to be accessed is not in the cached content queue of the CDN edge server, then step 1005 is performed.

步骤1003、更新待访问内容的访问热度,并根据待访问内容的访问热度和待访问内容的推荐热度确定待访问内容的热度信息,根据待访问内容的热度信息更新缓存内容队列。Step 1003: Update the popularity of the content to be accessed, determine the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed, and update the cached content queue according to the popularity information of the content to be accessed.

步骤1003执行完之后,执行步骤1004。After step 1003 is executed, step 1004 is executed.

步骤1004、向客户端返回待访问内容。Step 1004, return the content to be accessed to the client.

步骤1001-1004的具体实现方式,可参照实施例八的相关描述,这里不再赘述。For the specific implementation manner of steps 1001-1004, reference may be made to the relevant description of Embodiment 8, which will not be repeated here.

步骤1005、根据待访问内容的标识信息确定待访问内容是否在候选内容队列中。Step 1005. Determine whether the content to be accessed is in the candidate content queue according to the identification information of the content to be accessed.

若待访问内容在候选内容队列中,则执行步骤1006,若待访问内容不在后续内容队列中,则执行步骤1011。CDN边缘服务器根据待访问内容的标识信息确定待访问内容是否在候选内容队列中的具体方法,与CDN边缘服务器确定缓存内容是否在缓存内容队列中类似,这里不再赘述。If the content to be accessed is in the candidate content queue, execute step 1006, and if the content to be accessed is not in the subsequent content queue, execute step 1011. The specific method for the CDN edge server to determine whether the content to be accessed is in the candidate content queue according to the identification information of the content to be accessed is similar to the method for the CDN edge server to determine whether the cached content is in the cached content queue, and will not be repeated here.

步骤1006、更新待访问内容的访问热度,根据待访问内容的访问热度和推荐热度确定待访问内容的热度信息。Step 1006: Update the access popularity of the content to be accessed, and determine the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed.

步骤1007、根据待访问内容的热度信息判断待访问内容的热度是否大于预设的热度阈值。Step 1007, judging whether the popularity of the content to be accessed is greater than a preset popularity threshold according to the popularity information of the content to be accessed.

若待访问内容的热度大于热度阈值,则执行步骤1008,若待访问内容的热度小于或等于热度阈值,则执行步骤1010。If the popularity of the content to be accessed is greater than the popularity threshold, step 1008 is performed; if the popularity of the content to be accessed is less than or equal to the popularity threshold, step 1010 is performed.

步骤1008、将待访问内容添加到缓存内容队列中,并从候选内容队列中删除待访问内容。Step 1008, adding the content to be accessed to the cached content queue, and deleting the content to be accessed from the candidate content queue.

步骤1009、向客户端返回待访问内容服务器所在的原始服务器的IP地址。Step 1009, returning the IP address of the original server where the content server to be accessed is located to the client.

步骤1010、根据待访问内容的热度信息更新候选内容队列。Step 1010, updating the candidate content queue according to the popularity information of the content to be accessed.

步骤1010执行完之后,执行步骤1009。After step 1010 is executed, step 1009 is executed.

步骤1011、将待访问内容添加到候选内容队列中,更新待访问内容的访问热度,根据待访问内容的热度和待访问内容的推荐热度计算待访问内容的热度信息。Step 1011: Add the content to be accessed to the candidate content queue, update the access popularity of the content to be accessed, and calculate the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed.

步骤1011执行完之后,执行步骤1010。After step 1011 is executed, step 1010 is executed.

若CDN边缘服务器向客户端返回的信息为待访问内容所在的原始服务器的IP地址,那么客户端根据该原始服务器的IP地址,向该原始服务器请求待访问内容,并在获得待访问内容之后,将待访问内容展示给用户。If the information returned by the CDN edge server to the client is the IP address of the original server where the content to be accessed is located, then the client requests the content to be accessed from the original server according to the IP address of the original server, and after obtaining the content to be accessed, Display the content to be accessed to the user.

图14为本发明实施例十提供的一种推荐系统的结构示意图,如图14所示,本实施例提供的推荐系统包括:接收模块11、推荐模块12、融合模块13和发送模块14。FIG. 14 is a schematic structural diagram of a recommendation system provided by Embodiment 10 of the present invention. As shown in FIG.

接收模块11,用于接收CDN发送的缓存内容队列中的缓存内容的标识,根据所述缓存内容的标识和全体内容库获取所述缓存内容的信息,将所述缓存内容的标识和所述缓存内容的信息添加到缓存内容库;The receiving module 11 is configured to receive the identifier of the cached content in the cached content queue sent by the CDN, obtain the information of the cached content according to the identifier of the cached content and the entire content library, and combine the identifier of the cached content with the cached content Content information is added to the cache content library;

推荐模块12,用于当所述推荐系统接收到客户端发送的推荐请求消息时,根据预先获取的用户兴趣特征和所述全体内容库,采用第一推荐算法计算得到第一推荐结果;The recommendation module 12 is configured to use a first recommendation algorithm to calculate and obtain a first recommendation result according to the pre-acquired user interest characteristics and the entire content library when the recommendation system receives the recommendation request message sent by the client;

所述推荐模块12,还用于根据所述缓存内容库获取第二推荐结果;The recommendation module 12 is further configured to obtain a second recommendation result according to the cached content library;

融合模块13,用于根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果;A fusion module 13, configured to fuse the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result;

发送模块14,用于将所述目标推荐结果推送给目标用户。The sending module 14 is configured to push the target recommendation result to the target user.

一种实现方式中,所述推荐模块根据所述缓存内容库获取第二推荐结果,具体为:根据所述用户兴趣特征和所述缓存内容库,采用第二推荐算法计算得到所述第二推荐结果。另一种实现方式中,所述推荐模块根据所述缓存内容库获取第二推荐结果,具体为:从所述第一推荐结果选择属于所述缓存内容库的推荐内容,将所选择的推荐内容作为所述第二推荐结果。In an implementation manner, the recommendation module acquires a second recommendation result according to the cached content library, specifically: according to the user interest characteristics and the cached content library, the second recommendation algorithm is used to calculate and obtain the second recommendation result. In another implementation manner, the recommendation module acquires a second recommendation result according to the cached content library, specifically: select recommended content belonging to the cached content library from the first recommendation result, and store the selected recommended content As the second recommendation result.

可选的,所述融合模块13具体用于:确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;根据推荐内容的得分,对所述第二推荐结果和所述第三推荐结果中的推荐内容统一进行排序;将排序后的推荐内容作为所述目标推荐结果,或者,按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。Optionally, the fusion module 13 is specifically configured to: determine the common recommendation content in the first recommendation result and the second recommendation result; delete the common recommendation content from the first recommendation result to obtain The third recommendation result; according to the score of the recommended content, uniformly sort the recommended content in the second recommended result and the third recommended result; use the sorted recommended content as the target recommended result, or, according to the preset The established algorithm selects part of the recommended content from the sorted recommended content as the target recommendation result.

可选的,所述融合模块13具体用于:确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;从所述第三推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;从所述第二推荐结果中选择(1-a%)*k个推荐内容;根据推荐内容的得分,对从所述第三推荐结果中选择的推荐内容和从所述第二推荐结果中选择的推荐内容进行统一排序,将统一排序后的推荐内容作为所述目标推荐结果。Optionally, the fusion module 13 is specifically configured to: determine the common recommendation content in the first recommendation result and the second recommendation result; delete the common recommendation content from the first recommendation result to obtain The third recommendation result; select a%*k recommended content from the third recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100; Select (1-a%)*k recommended content from the second recommended result; according to the score of the recommended content, recommend the recommended content selected from the third recommended result and the recommended content selected from the second recommended result The content is sorted uniformly, and the recommended content after the unified sorting is used as the target recommendation result.

其中,所述融合模块13从所述第三推荐结果中选择a%*k个推荐内容,具体为:根据推荐内容的得分对所述第三推荐结果中的推荐内容进行排序,从排序后的所述第三推荐结果中选择排序在前的a%*k个推荐内容。所述融合模块13从所述第二推荐结果中选择(1-a%)*k个推荐内容,具体为:根据推荐内容的得分对所述第二推荐结果中的推荐内容进行排序,从排序后的所述第二推荐结果中选择排序在前的(1-a%)*k个推荐内容。Wherein, the fusion module 13 selects a%*k recommended content from the third recommended result, specifically: sorting the recommended content in the third recommended result according to the scores of the recommended content, and sorting the recommended content from the sorted The top a%*k recommended content is selected from the third recommendation result. The fusion module 13 selects (1-a%)*k recommended content from the second recommended result, specifically: sorting the recommended content in the second recommended result according to the scores of the recommended content, from the sorted Select the top (1-a%)*k recommended content in the second recommendation result.

可选的,所述融合模块13从所述第一推荐结果中删除所述共同的推荐内容之后,还用于:提高所述第二推荐结果中包括的所述共同的推荐内容的得分。Optionally, after the fusion module 13 deletes the common recommended content from the first recommendation result, it is further configured to: increase the score of the common recommended content included in the second recommendation result.

可选的,所述融合模块13具体用于:确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;根据推荐内容的得分,对所述第一推荐结果和所述第四推荐结果中的推荐内容统一进行排序;将排序后的推荐内容作为所述目标推荐结果,或者,按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。Optionally, the fusion module 13 is specifically configured to: determine the common recommendation content in the first recommendation result and the second recommendation result; delete the common recommendation content from the second recommendation result to obtain The fourth recommendation result: according to the score of the recommended content, uniformly sort the recommended content in the first recommended result and the fourth recommended result; use the sorted recommended content as the target recommended result, or, according to the preset The established algorithm selects part of the recommended content from the sorted recommended content as the target recommendation result.

可选的,所述融合模块13具体用于:确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;从所述第一推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;从所述第四推荐结果中选择(1-a%)*k个推荐内容;根据推荐内容的得分,对从所述第一推荐结果中选择的推荐内容和从所述第四推荐结果中选择的推荐内容进行统一排序,并将统一排序后的推荐内容作为所述目标推荐结果。Optionally, the fusion module 13 is specifically configured to: determine the common recommendation content in the first recommendation result and the second recommendation result; delete the common recommendation content from the second recommendation result to obtain The fourth recommendation result: select a%*k recommended content from the first recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100; from the Select (1-a%)*k recommended content from the fourth recommended result; according to the score of the recommended content, recommend the recommended content selected from the first recommended result and the recommended content selected from the fourth recommended result The content is sorted uniformly, and the recommended content after the unified sorting is used as the target recommendation result.

其中,所述融合模块13从所述第一推荐结果中选择a%*k个推荐内容,具体为:根据推荐内容的得分对所述第一推荐结果中的推荐内容进行排序,从排序后的所述第一推荐结果中选择排序在前的a%*k个推荐内容。所述融合模块13从所述第四推荐结果中选择(1-a%)*k个推荐内容,具体为:根据推荐内容的得分对所述第四推荐结果中的推荐内容进行排序,从排序后的所述第四推荐结果中选择(1-a%)*k个推荐内容。Wherein, the fusion module 13 selects a%*k recommended content from the first recommendation result, specifically: sorting the recommended content in the first recommendation result according to the scores of the recommended content, and sorting the recommended content from the sorted Select the top a%*k recommended content in the first recommendation result. The fusion module 13 selects (1-a%)*k recommended content from the fourth recommended result, specifically: sorting the recommended content in the fourth recommended result according to the scores of the recommended content, from the sorted (1-a%)*k recommended contents are selected from the fourth recommended result after that.

可选的,所述融合模块13从所述第二推荐结果中删除所述共同的推荐内容之后,还用于:提高所述第一推荐结果中包括的所述共同的推荐内容的得分。Optionally, after the fusion module 13 deletes the common recommended content from the second recommendation result, it is further configured to: increase the score of the common recommended content included in the first recommendation result.

可选的,所述推荐系统还包括:推荐热度生成模块,用于根据所述全体内容库中的全体内容的推荐情况生成推荐热度库,所述推荐热度库中包括所述全体内容库中的全体内容在预设时间内的推荐热度;所述发送模块14,还用于将推荐热度库中的所有内容发送给所述CDN。相应的,所述融合模块13根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果之后,所述推荐热度生成模块还用于:根据所述目标推荐结果更新所述推荐热度库。Optionally, the recommendation system further includes: a recommendation popularity generating module, configured to generate a recommendation popularity library according to the recommendation situation of all contents in the entire content library, and the recommendation popularity library includes the recommendation popularity library in the entire content library The recommended popularity of all content within a preset time; the sending module 14 is also configured to send all the content in the recommended popularity library to the CDN. Correspondingly, the fusion module 13 fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm, and after obtaining the target recommendation result, the recommendation popularity generation module is further used to: according to the The target recommendation result updates the recommendation popularity library.

可选地,本实施例中,所述CDN发送的缓存内容为所述缓存内容队列的前P%的内容,或者,为所述缓存内容队列的前P%的内容相对于上次发送的内容的增量数据,其中,P为大于0小于100。Optionally, in this embodiment, the cache content sent by the CDN is the content of the top P% of the cache content queue, or the content of the top P% of the cache content queue relative to the content sent last time Incremental data, where P is greater than 0 and less than 100.

本实施例的推荐系统可用于执行实施例一至实施例五的方法,具体实现方式和技术效果类似,这里不再赘述。The recommendation system of this embodiment can be used to implement the methods of Embodiment 1 to Embodiment 5, and the specific implementation manner and technical effect are similar, and will not be repeated here.

图15为本发明实施例十一提供的一种CDN边缘服务器的结构示意图,如图15所示,本实施例提供的CDN边缘服务器包括:获取模块21和缓存替换模块22。FIG. 15 is a schematic structural diagram of a CDN edge server provided by Embodiment 11 of the present invention. As shown in FIG. 15 , the CDN edge server provided by this embodiment includes: an acquisition module 21 and a cache replacement module 22 .

获取模块21,用于获取缓存内容队列中的缓存内容的推荐热度和访问热度;An acquisition module 21, configured to acquire recommendation popularity and access popularity of cached content in the cached content queue;

缓存替换模块22,用于根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换。The cache replacement module 22 is configured to perform cache replacement on the cache content queue according to the access popularity and recommendation popularity of the cache content in the cache content queue.

可选的,所述缓存替换模块22具体用于:若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则确定对所述缓存内容队列的队尾访问热度较小的缓存内容进行淘汰;比较所述缓存内容队列的队尾具有相同访问热度的缓存内容的推荐热度,淘汰所述具有相同访问热度的缓存内容中推荐热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于或等于所述第一阈值。Optionally, the cache replacement module 22 is specifically configured to: if the size of the cached content in the cached content queue is greater than or equal to a first threshold, determine a cache with less popularity for accessing the tail of the cached content queue The content is eliminated; compare the recommendation heat of the cache content with the same access heat at the tail of the cache content queue, and eliminate the less recommended cache content in the cache content with the same access heat, until the cache content in the cache content queue If the size of the cached content is smaller than a second threshold, the elimination of the cached content queue is stopped, and the second threshold is smaller than or equal to the first threshold.

可选的,所述缓存替换模块22具体用于:若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则确定对所述缓存内容队列的队尾的访问热度较小的缓存内容进行淘汰;根据所述缓存内容队列的队尾的缓存内容的访问热度和推荐热度,计算所述缓存内容队列的队尾中缓存内容的综合热度;淘汰所述缓存内容队列的队尾中综合热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于等于所述第一阈值。Optionally, the cache replacement module 22 is specifically configured to: if the size of the cached content in the cached content queue is greater than or equal to a first threshold, determine that the access to the tail of the cached content queue is less popular The cache content is eliminated; according to the access heat and recommendation heat of the cache content at the tail of the cache content queue, calculate the comprehensive heat of the cache content in the tail of the cache content queue; eliminate the cache content at the tail of the cache content queue Combining less popular cached content until the size of the cached content in the cached content queue is less than a second threshold, stop eliminating the cached content queue, the second threshold being less than or equal to the first threshold.

本实施例中,所述获取模块21具体用于:根据所述缓存内容队列中的缓存内容的历史访问情况生成所述缓存内容队列中的缓存内容的访问热度;接收推荐系统发送的所述缓存内容队列中的缓存内容的推荐热度,所述缓存内容队列中的缓存内容的推荐热度是所述推荐系统根据所述缓存内容队列中的缓存内容的推荐情况生成的。In this embodiment, the acquisition module 21 is specifically configured to: generate the access heat of the cached content in the cached content queue according to the historical access conditions of the cached content in the cached content queue; receive the cached content sent by the recommendation system The recommendation popularity of the cached content in the content queue, the recommendation popularity of the cached content in the cached content queue is generated by the recommendation system according to the recommendation of the cached content in the cached content queue.

本实施例提供的CDN边缘服务器,可用于执行实施例六的方法,具体实现方式和技术效果类似,这里不再赘述。The CDN edge server provided in this embodiment can be used to implement the method in Embodiment 6, and the specific implementation manner and technical effect are similar, and will not be repeated here.

本发明实施例十二提供一种CDN边缘服务器,本实施例提供的CDN边缘服务器的结构与图15所示的CDN边缘服务器相同,请参照图15,本实施例中,所述获取模块21还用于:获取候选内容队列中的候选内容的推荐热度和访问热度;所述缓存替换模块22,还用于:根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换。Embodiment 12 of the present invention provides a CDN edge server. The structure of the CDN edge server provided in this embodiment is the same as that shown in FIG. 15. Please refer to FIG. 15. In this embodiment, the acquisition module 21 also It is used to: obtain the recommendation popularity and access popularity of the candidate content in the candidate content queue; the cache replacement module 22 is also used to: according to the recommendation popularity and access popularity of the candidate content in the candidate content queue Queue for cache replacement.

可选的,所述缓存替换模块22具体用于:若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;比较所述候选内容队列中具有相同访问热度的候选内容的推荐热度,淘汰所述具有相同访问热度的候选内容中推荐热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。Optionally, the cache replacement module 22 is specifically configured to: if the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, determine that the access to the tail of the candidate content queue is less popular The candidate content is eliminated; comparing the recommendation heat of the candidate content with the same access heat in the candidate content queue, eliminating the candidate content with the lower recommendation heat among the candidate content with the same access heat, until the candidate content in the candidate content queue If the size of the candidate content is smaller than a fourth threshold, the elimination of the candidate content queue is stopped, and the fourth threshold is smaller than or equal to the third threshold.

可选的,所述缓存替换模块22具体用于:若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;根据所述候选内容队列的队尾中候选内容的访问热度和推荐热度,计算所述候选内容队列的队尾中候选内容的综合热度;淘汰所述候选内容队列的队尾中候选内容的综合热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。Optionally, the cache replacement module 22 is specifically configured to: if the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, determine that the access to the tail of the candidate content queue is less popular Candidate content is eliminated; According to the access popularity and recommendation popularity of the candidate content in the queue tail of the candidate content queue, the comprehensive popularity of the candidate content in the queue tail of the candidate content queue is calculated; the candidate content queue is eliminated. Candidate content whose comprehensive popularity is less, stop eliminating the candidate content queue until the size of the candidate content in the candidate content queue is less than the fourth threshold, and the fourth threshold is less than or equal to the first Three thresholds.

本实施例中,所述获取模块21具体用于:根据所述候选内容队列中的候选内容的历史访问情况生成所述候选内容队列中的候选内容的访问热度;接收推荐系统发送的所述候选内容的推荐热度,所述候选内容的推荐热度是所述推荐系统根据所述候选内容的推荐情况生成的。In this embodiment, the acquisition module 21 is specifically configured to: generate the access popularity of the candidate content in the candidate content queue according to the historical access conditions of the candidate content in the candidate content queue; receive the candidate content sent by the recommendation system. The recommendation popularity of the content, the recommendation popularity of the candidate content is generated by the recommendation system according to the recommendation situation of the candidate content.

本实施例提供的CDN边缘服务器,可用于执行实施例七的方法,具体实现方式和技术效果类似,这里不再赘述。The CDN edge server provided in this embodiment can be used to implement the method in Embodiment 7, and the specific implementation manner and technical effect are similar, and will not be repeated here.

图16为本发明实施例十三提供的一种CDN的边缘服务器的结构示意图,如图16所示,本实施例提供的CDN边缘服务器包括:接收模块31、处理模块32、更新模块33和缓存替换模块34。FIG. 16 is a schematic structural diagram of a CDN edge server provided by Embodiment 13 of the present invention. As shown in FIG. 16 , the CDN edge server provided by this embodiment includes: a receiving module 31, a processing module 32, an update module 33 and a cache Replace module 34.

接收模块31,用于接收客户端发送的内容获取请求,所述内容获取请求中包括待访问内容的标识信息;A receiving module 31, configured to receive a content acquisition request sent by the client, where the content acquisition request includes identification information of the content to be accessed;

处理模块32,用于根据所述待访问内容的标识信息确定所述待访问内容是否在自己的缓存内容队列中,若所述待访问内容在所述缓存内容队列中,则向所述客户端返回所述待访问内容;The processing module 32 is configured to determine whether the content to be accessed is in its own cache content queue according to the identification information of the content to be accessed, and if the content to be accessed is in the cache content queue, send the return the content to be accessed;

更新模块33,用于更新所述待访问内容的访问热度,并根据所述待访问内容的访问热度和推荐热度计算所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述缓存内容队列;An update module 33, configured to update the access popularity of the content to be accessed, and calculate the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed, and update the content according to the popularity information of the content to be accessed The above cache content queue;

缓存替换模块34,用于当需要对所述缓存内容队列进行缓存替换时,根据所述缓存内容队列中缓存内容的热度信息,淘汰所述缓存内容队列中热度较小的缓存内容。The cache replacement module 34 is configured to, when it is necessary to perform cache replacement on the cache content queue, eliminate less popular cache content in the cache content queue according to the popularity information of the cache content in the cache content queue.

若所述待访问内容的标识信息不在所述缓存内容队列中,所述处理模块32还用于:根据所述待访问内容的标识信息确定所述待访问内容是否在所述CDN边缘服务器的候选内容队列中;若所述待访问内容在所述候选内容队列中,则更新所述待访问内容的访问热度,根据所述待访问内容的访问热度和推荐热度确定所述待访问内容的热度信息;根据所述待访问内容的热度信息判断所述待访问内容的热度是否大于预设的热度阈值;若所述待访问内容的热度大于所述热度阈值,则将所述待访问内容添加到所述缓存内容队列中,并从所述候选内容队列中删除所述待访问内容;向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。If the identification information of the content to be accessed is not in the cached content queue, the processing module 32 is further configured to: determine whether the content to be accessed is a candidate for the CDN edge server according to the identification information of the content to be accessed In the content queue; if the content to be accessed is in the candidate content queue, update the access popularity of the content to be accessed, and determine the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed ; Judging whether the popularity of the content to be accessed is greater than a preset popularity threshold according to the popularity information of the content to be accessed; if the popularity of the content to be accessed is greater than the popularity threshold, adding the content to be accessed to the and delete the to-be-accessed content from the candidate content queue; and return the IP address of the original server where the to-be-accessed content server is located to the client.

若所述待访问内容不在所述候选内容队列中,所述处理模块32还用于:将所述待访问内容添加到所述候选内容队列中;更新所述待访问内容的访问热度,根据所述待访问内容的热度和所述待访问内容的推荐热度确定所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述候选内容队列;向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。If the content to be accessed is not in the candidate content queue, the processing module 32 is further configured to: add the content to be accessed to the candidate content queue; update the access popularity of the content to be accessed, according to the Determine the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed, update the queue of candidate content according to the popularity information of the content to be accessed; return the content to be accessed to the client Access the IP address of the origin server where the content server is located.

若所述待访问内容的热度小于或等于所述热度阈值,则所述处理模块32还用于:根据所述待访问内容的热度信息更新所述候选内容队列;向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。If the popularity of the content to be accessed is less than or equal to the popularity threshold, the processing module 32 is further configured to: update the candidate content queue according to the popularity information of the content to be accessed; return the IP address of the original server where the content server to be accessed is located.

可选的,所述缓存替换模块34还用于:当需要对所述候选内容队列进行缓存替换时,根据所述候选内容队列中候选内容的热度信息,淘汰所述候选内容队列中热度较小的候选内容。Optionally, the cache replacement module 34 is further configured to: when it is necessary to perform cache replacement on the candidate content queue, according to the popularity information of the candidate content in the candidate content queue, eliminate the candidates with less popularity in the candidate content queue candidate content.

本实施例提供的CDN边缘服务器,可用于执行实施例八和实施例九的方法,具体实现方式和技术效果类似,这里不再赘述。The CDN edge server provided in this embodiment can be used to implement the methods of Embodiment 8 and Embodiment 9, and the specific implementation manner and technical effect are similar, and will not be repeated here.

图17为本发明实施例十四提供的CDN边缘服务器的结构示意图,如图17所示,本实施例提供的CDN边缘服务器400包括:处理器41、存储器42、通信接口43和系统总线44,所述存储器42和所述通信接口43通过所述系统总线44与所述处理器41连接并通信;所述存储器42,用于存储计算机执行指令;所述通信接口43用于和其他设备进行通信,所述处理器41,用于运行所述计算机执行指令,执行下所述的方法:FIG. 17 is a schematic structural diagram of a CDN edge server provided in Embodiment 14 of the present invention. As shown in FIG. 17 , the CDN edge server 400 provided in this embodiment includes: a processor 41, a memory 42, a communication interface 43, and a system bus 44. The memory 42 and the communication interface 43 are connected and communicate with the processor 41 through the system bus 44; the memory 42 is used to store computer execution instructions; the communication interface 43 is used to communicate with other devices , the processor 41 is configured to run the computer to execute instructions and perform the following method:

获取缓存内容队列中的缓存内容的推荐热度和访问热度;Obtain the recommendation popularity and access popularity of the cached content in the cached content queue;

根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换。Perform cache replacement on the cache content queue according to the access popularity and recommendation popularity of the cache content in the cache content queue.

可选的,所述处理器41根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换,具体为:若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则确定对所述缓存内容队列的队尾访问热度较小的缓存内容进行淘汰;然后,比较所述缓存内容队列的队尾具有相同访问热度的缓存内容的推荐热度,淘汰所述具有相同访问热度的缓存内容中推荐热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于或等于所述第一阈值。Optionally, the processor 41 performs cache replacement on the cache content queue according to the cache content access and recommendation popularity in the cache content queue, specifically: if the size of the cache content in the cache content queue is greater than or equal to the first threshold, it is determined to eliminate the cache content with less access heat at the tail of the cache content queue; then, compare the recommendation heat of the cache content with the same access heat at the tail of the cache content queue, Eliminate cached content with less recommended popularity among the cached content with the same access popularity, until the size of the cached content in the cached content queue is smaller than a second threshold, then stop eliminating the cached content queue, the first The second threshold is less than or equal to the first threshold.

可选的,所述处理器41根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换,具体为:若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则确定对所述缓存内容队列的队尾的访问热度较小的缓存内容进行淘汰;然后,根据所述缓存内容队列的队尾的缓存内容的访问热度和推荐热度,计算所述缓存内容队列的队尾中缓存内容的综合热度;最后,淘汰所述缓存内容队列的队尾中综合热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于等于所述第一阈值。Optionally, the processor 41 performs cache replacement on the cache content queue according to the cache content access and recommendation popularity in the cache content queue, specifically: if the size of the cache content in the cache content queue is If it is greater than or equal to the first threshold, it is determined to eliminate the cached content with less popular access at the tail of the cache content queue; then, according to the access popularity and recommendation popularity of the cached content at the tail of the cache content queue, Calculate the comprehensive heat of the cache content in the queue tail of the cache content queue; finally, eliminate the cache content with less comprehensive heat in the queue tail of the cache content queue until the size of the cache content in the cache content queue is less than the first If the second threshold is lower than or equal to the first threshold, the elimination of the cached content queue is stopped.

本实施例中,所述处理器41获取缓存内容队列中的缓存内容的推荐热度和访问热度,具体为:根据所述缓存内容队列中的缓存内容的历史访问情况生成所述缓存内容队列中的缓存内容的访问热度;接收推荐系统发送的所述缓存内容队列中的缓存内容的推荐热度,所述缓存内容队列中的缓存内容的推荐热度是所述推荐系统根据所述缓存内容队列中的缓存内容的推荐情况生成的。In this embodiment, the processor 41 acquires the recommendation popularity and access popularity of the cached content in the cached content queue, specifically: generating the cached content in the cached content queue according to the historical access status of the cached content in the cached content queue The access heat of cached content; receiving the recommended heat of cached content in the cached content queue sent by the recommender system, the recommended heat of cached content in the cached content queue is the recommendation system according to the cached content in the cached content queue Content recommendations are generated.

所述处理器41还用于:获取候选内容队列中的候选内容的推荐热度和访问热度;根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换。The processor 41 is further configured to: acquire recommendation popularity and access popularity of candidate content in the candidate content queue; perform cache replacement on the candidate content queue according to the recommendation popularity and access popularity of candidate content in the candidate content queue.

可选的,所述处理器41根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换,具体为:若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;然后,比较所述候选内容队列中具有相同访问热度的候选内容的推荐热度,淘汰所述具有相同访问热度的候选内容中推荐热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。Optionally, the processor 41 caches and replaces the candidate content queue according to the recommendation popularity and access popularity of the candidate content in the candidate content queue, specifically: if the size of the candidate content in the candidate content queue is greater than or equal to the third threshold, then it is determined that the candidate content with less access popularity at the tail of the candidate content queue is eliminated; then, compare the recommendation popularity of the candidate content with the same access popularity in the candidate content queue, and eliminate Recommend less popular candidate content among the candidate contents with the same access popularity, and stop eliminating the candidate content queue until the size of the candidate content in the candidate content queue is smaller than a fourth threshold, and the fourth The threshold is less than or equal to the third threshold.

可选的,所述处理器41根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换,具体为:若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;然后,根据所述候选内容队列的队尾中候选内容的访问热度和推荐热度,计算所述候选内容队列的队尾中候选内容的综合热度;最后,淘汰所述候选内容队列的队尾中候选内容的综合热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。Optionally, the processor 41 caches and replaces the candidate content queue according to the recommendation popularity and access popularity of the candidate content in the candidate content queue, specifically: if the size of the candidate content in the candidate content queue is greater than or equal to the third threshold, it is determined to eliminate the candidate content with less popular access at the tail of the candidate content queue; then, according to the access popularity and recommendation popularity of the candidate content at the tail of the candidate content queue, Calculate the comprehensive heat of the candidate content in the queue tail of the candidate content queue; finally, eliminate the candidate content with less comprehensive heat of the candidate content in the queue tail of the candidate content queue until the candidate content in the candidate content queue If the size is smaller than a fourth threshold, stop eliminating the candidate content queue, and the fourth threshold is smaller than or equal to the third threshold.

本实施例中,所述处理器41获取候选内容队列中的候选内容的推荐热度和访问热度,具体为:根据所述候选内容队列中的候选内容的历史访问情况生成所述候选内容队列中的候选内容的访问热度;接收推荐系统发送的所述候选内容的推荐热度,所述候选内容的推荐热度是所述推荐系统根据所述候选内容的推荐情况生成的。In this embodiment, the processor 41 obtains the recommendation popularity and access popularity of the candidate content in the candidate content queue, specifically: generating the candidate content in the candidate content queue according to the historical access status of the candidate content in the candidate content queue The access popularity of the candidate content: receiving the recommendation popularity of the candidate content sent by the recommendation system, the recommendation popularity of the candidate content is generated by the recommendation system according to the recommendation situation of the candidate content.

本实施例的CDN边缘服务器,可用于执行实施例六和实施例七的方法,具体实现方式和技术效果类似,这里不再赘述。The CDN edge server of this embodiment can be used to execute the methods of Embodiment 6 and Embodiment 7, and the specific implementation manner and technical effect are similar, and will not be repeated here.

图18为本发明实施例十五提供的CDN边缘服务器的结构示意图,如图18所示,本实施例提供的CDN边缘服务器500包括:处理器51、存储器52、通信接口53和系统总线54,所述存储器52和所述通信接口53通过所述系统总线54与所述处理器51连接并通信;所述存储器52,用于存储计算机执行指令;所述通信接口53用于和其他设备进行通信,所述处理器51,用于运行所述计算机执行指令,执行下所述的方法:FIG. 18 is a schematic structural diagram of a CDN edge server provided in Embodiment 15 of the present invention. As shown in FIG. 18 , the CDN edge server 500 provided in this embodiment includes: a processor 51, a memory 52, a communication interface 53, and a system bus 54. The memory 52 and the communication interface 53 are connected and communicate with the processor 51 through the system bus 54; the memory 52 is used to store computer execution instructions; the communication interface 53 is used to communicate with other devices , the processor 51 is configured to run the computer to execute instructions and execute the method described below:

接收客户端发送的内容获取请求,所述内容获取请求中包括待访问内容的标识信息;receiving a content acquisition request sent by the client, where the content acquisition request includes identification information of the content to be accessed;

根据所述待访问内容的标识信息确定所述待访问内容是否在自己的缓存内容队列中;Determine whether the content to be accessed is in its own cache content queue according to the identification information of the content to be accessed;

若所述待访问内容在所述缓存内容队列中,则向所述客户端返回所述待访问内容;If the content to be accessed is in the cached content queue, return the content to be accessed to the client;

更新所述待访问内容的访问热度,并根据所述待访问内容的访问热度和推荐热度计算所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述缓存内容队列;updating the access popularity of the content to be accessed, and calculating the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed, and updating the cached content queue according to the popularity information of the content to be accessed;

当需要对所述缓存内容队列进行缓存替换时,根据所述缓存内容队列中缓存内容的热度信息,淘汰所述缓存内容队列中热度较小的缓存内容。When it is necessary to perform cache replacement on the cache content queue, the cache content with less popularity in the cache content queue is eliminated according to the popularity information of the cache content in the cache content queue.

若所述待访问内容的标识信息不在所述缓存内容队列中,所述处理器51还用于:根据所述待访问内容的标识信息确定所述待访问内容是否在所述CDN边缘服务器的候选内容队列中;若所述待访问内容在所述候选内容队列中,则更新所述待访问内容的访问热度,根据所述待访问内容的访问热度和推荐热度确定所述待访问内容的热度信息;根据所述待访问内容的热度信息判断所述待访问内容的热度是否大于预设的热度阈值;若所述待访问内容的热度大于所述热度阈值,则将所述待访问内容添加到所述缓存内容队列中,并从所述候选内容队列中删除所述待访问内容;向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。If the identification information of the content to be accessed is not in the cached content queue, the processor 51 is further configured to: determine whether the content to be accessed is a candidate for the CDN edge server according to the identification information of the content to be accessed In the content queue; if the content to be accessed is in the candidate content queue, update the access popularity of the content to be accessed, and determine the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed ; Judging whether the popularity of the content to be accessed is greater than a preset popularity threshold according to the popularity information of the content to be accessed; if the popularity of the content to be accessed is greater than the popularity threshold, adding the content to be accessed to the and delete the to-be-accessed content from the candidate content queue; and return the IP address of the original server where the to-be-accessed content server is located to the client.

若所述待访问内容不在所述候选内容队列中,所述处理器51还用于:将所述待访问内容添加到所述候选内容队列中;更新所述待访问内容的访问热度,根据所述待访问内容的热度和所述待访问内容的推荐热度确定所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述候选内容队列;向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。If the content to be accessed is not in the candidate content queue, the processor 51 is further configured to: add the content to be accessed to the candidate content queue; update the access popularity of the content to be accessed, according to the Determine the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed, update the queue of candidate content according to the popularity information of the content to be accessed; return the content to be accessed to the client Access the IP address of the origin server where the content server is located.

若所述待访问内容的热度小于或等于所述热度阈值,则所述处理器51还用于:根据所述待访问内容的热度信息更新所述候选内容队列;向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。If the popularity of the content to be accessed is less than or equal to the popularity threshold, the processor 51 is further configured to: update the candidate content queue according to the popularity information of the content to be accessed; return the IP address of the original server where the content server to be accessed is located.

所述处理器51还用于:当需要对所述候选内容队列进行缓存替换时,根据所述候选内容队列中候选内容的热度信息,淘汰所述候选内容队列中热度较小的候选内容。The processor 51 is further configured to: when it is necessary to cache and replace the candidate content queue, eliminate less popular candidate content in the candidate content queue according to popularity information of the candidate content in the candidate content queue.

图19为本发明实施例十六提供的推荐系统的结构示意图,如图19所示,本实施例提供的推荐系统600包括:处理器61、存储器62、通信接口63和系统总线64,所述存储器62和所述通信接口63通过所述系统总线64与所述处理器61连接并通信;所述存储器62,用于存储计算机执行指令;所述通信接口63用于和其他设备进行通信,所述处理器61,用于运行所述计算机执行指令,执行下所述的方法:FIG. 19 is a schematic structural diagram of a recommendation system provided by Embodiment 16 of the present invention. As shown in FIG. 19 , the recommendation system 600 provided by this embodiment includes: a processor 61, a memory 62, a communication interface 63, and a system bus 64. The memory 62 and the communication interface 63 are connected and communicate with the processor 61 through the system bus 64; the memory 62 is used to store computer execution instructions; the communication interface 63 is used to communicate with other devices, so The processor 61 is configured to run the computer to execute instructions and perform the following methods:

接收CDN发送的缓存内容队列中的缓存内容的标识,根据所述缓存内容的标识和全体内容库获取所述缓存内容的信息,将所述缓存内容的标识和所述缓存内容的信息添加到缓存内容库;Receive the identifier of the cached content in the cached content queue sent by the CDN, obtain the information of the cached content according to the identifier of the cached content and the entire content library, and add the identifier of the cached content and the information of the cached content to the cache content library;

当所述推荐系统接收到客户端发送的推荐请求消息时,根据预先获取的用户兴趣特征和所述全体内容库,采用第一推荐算法计算得到第一推荐结果;When the recommendation system receives the recommendation request message sent by the client, according to the pre-acquired user interest characteristics and the entire content library, the first recommendation algorithm is used to calculate and obtain the first recommendation result;

根据所述缓存内容库获取第二推荐结果;Obtaining a second recommendation result according to the cached content library;

根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果;merging the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result;

将所述目标推荐结果推送给目标用户。Pushing the target recommendation result to the target user.

可选的,所述处理器61根据所述缓存内容库获取第二推荐结果,具体为:根据所述用户兴趣特征和所述缓存内容库,采用第二推荐算法计算得到所述第二推荐结果。Optionally, the processor 61 obtains the second recommendation result according to the cached content library, specifically: according to the user interest characteristics and the cached content library, calculate the second recommendation result by using a second recommendation algorithm .

可选的,所述处理器61根据所述缓存内容库获取第二推荐结果,具体为:从所述第一推荐结果选择属于所述缓存内容库的推荐内容,将所选择的推荐内容作为所述第二推荐结果。Optionally, the processor 61 acquires the second recommendation result according to the cached content library, specifically: selecting recommended content belonging to the cached content library from the first recommendation result, and using the selected recommended content as the selected Describe the results of the second recommendation.

可选的,所述处理器61根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,具体为:确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;根据推荐内容的得分,对所述第二推荐结果和所述第三推荐结果中的推荐内容统一进行排序;将排序后的推荐内容作为所述目标推荐结果,或者,按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。Optionally, the processor 61 fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result, specifically: determining the first recommendation result and the common recommendation content in the second recommendation result; delete the common recommendation content from the first recommendation result to obtain a third recommendation result; The recommended content in the recommendation results is uniformly sorted; the sorted recommended content is used as the target recommendation result, or part of the recommended content is selected from the sorted recommended content according to a preset algorithm as the target recommendation result.

可选的,所述处理器61根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,具体为:确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;从所述第三推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;从所述第二推荐结果中选择(1-a%)*k个推荐内容;根据推荐内容的得分,对从所述第三推荐结果中选择的推荐内容和从所述第二推荐结果中选择的推荐内容进行统一排序,将统一排序后的推荐内容作为所述目标推荐结果。Optionally, the processor 61 fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result, specifically: determining the first recommendation result and the Common recommended content in the second recommended result; delete the common recommended content from the first recommended result to obtain a third recommended result; select a%*k recommended content from the third recommended result, wherein , k is the number of recommended content included in the target recommendation result, a is greater than or equal to 0 and less than or equal to 100; select (1-a%)*k recommended content from the second recommended result; according to the recommended content Scoring, performing unified ranking on the recommended content selected from the third recommended result and the recommended content selected from the second recommended result, and using the unified ranked recommended content as the target recommended result.

其中,所述处理器61从所述第三推荐结果中选择a%*k个推荐内容,具体为:根据推荐内容的得分对所述第三推荐结果中的推荐内容进行排序,从排序后的所述第三推荐结果中选择排序在前的a%*k个推荐内容。所述处理器61从所述第二推荐结果中选择(1-a%)*k个推荐内容,具体为:根据推荐内容的得分对所述第二推荐结果中的推荐内容进行排序,从排序后的所述第二推荐结果中选择排序在前的(1-a%)*k个推荐内容。Wherein, the processor 61 selects a%*k recommended content from the third recommendation result, specifically: sorting the recommended content in the third recommendation result according to the scores of the recommended content, and sorting The top a%*k recommended content is selected from the third recommendation result. The processor 61 selects (1-a%)*k recommended content from the second recommendation result, specifically: sorting the recommended content in the second recommendation result according to the scores of the recommended content, and sorting Select the top (1-a%)*k recommended content in the second recommendation result.

可选的,所述处理器61从所述第一推荐结果中删除所述共同的推荐内容之后,还用于:提高所述第二推荐结果中包括的所述共同的推荐内容的得分。Optionally, after the processor 61 deletes the common recommended content from the first recommendation result, it is further configured to: increase the score of the common recommended content included in the second recommendation result.

可选的,所述处理器61根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,具体为:确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;根据推荐内容的得分,对所述第一推荐结果和所述第四推荐结果中的推荐内容统一进行排序;将排序后的推荐内容作为所述目标推荐结果,或者,按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。Optionally, the processor 61 fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result, specifically: determining the first recommendation result and the common recommendation content in the second recommendation result; delete the common recommendation content from the second recommendation result to obtain a fourth recommendation result; The recommended content in the recommendation results is uniformly sorted; the sorted recommended content is used as the target recommendation result, or part of the recommended content is selected from the sorted recommended content according to a preset algorithm as the target recommendation result.

可选的,所述处理器61根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,具体为:确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;从所述第一推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;从所述第四推荐结果中选择(1-a%)*k个推荐内容;根据推荐内容的得分,对从所述第一推荐结果中选择的推荐内容和从所述第四推荐结果中选择的推荐内容进行统一排序,并将统一排序后的推荐内容作为所述目标推荐结果。Optionally, the processor 61 fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result, specifically: determining the first recommendation result and the Common recommendation content in the second recommendation result; delete the common recommendation content from the second recommendation result to obtain the fourth recommendation result; select a%*k recommendation content from the first recommendation result, wherein , k is the number of recommended content included in the target recommendation result, a is greater than or equal to 0 and less than or equal to 100; select (1-a%)*k recommended content from the fourth recommended result; according to the recommended content Scoring, performing unified ranking on the recommended content selected from the first recommended result and the recommended content selected from the fourth recommended result, and using the unified ranked recommended content as the target recommended result.

其中,所述处理器61从所述第一推荐结果中选择a%*k个推荐内容,具体为:根据推荐内容的得分对所述第一推荐结果中的推荐内容进行排序,从排序后的所述第一推荐结果中选择排序在前的a%*k个推荐内容。所述处理器61从所述第四推荐结果中选择(1-a%)*k个推荐内容,具体为:根据推荐内容的得分对所述第四推荐结果中的推荐内容进行排序,从排序后的所述第四推荐结果中选择(1-a%)*k个推荐内容。Wherein, the processor 61 selects a%*k recommended content from the first recommendation result, specifically: sorting the recommended content in the first recommendation result according to the scores of the recommended content, and sorting Select the top a%*k recommended content in the first recommendation result. The processor 61 selects (1-a%)*k recommended content from the fourth recommendation result, specifically: sorting the recommended content in the fourth recommendation result according to the scores of the recommended content, and sorting (1-a%)*k recommended contents are selected from the fourth recommended result after that.

可选的,所述处理器61从所述第二推荐结果中删除所述共同的推荐内容之后,还用于:提高所述第一推荐结果中包括的所述共同的推荐内容的得分。Optionally, after the processor 61 deletes the common recommended content from the second recommendation result, it is further configured to: increase the score of the common recommended content included in the first recommendation result.

可选的,所述处理器61还用于:根据所述全体内容库中的全体内容的推荐情况生成推荐热度库,所述推荐热度库中包括所述全体内容库中的全体内容在预设时间内的推荐热度;将推荐热度库中的所有内容发送给所述CDN。相应的,所述处理器61根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果之后,还用于:根据所述目标推荐结果更新所述推荐热度库。Optionally, the processor 61 is further configured to: generate a recommendation popularity library according to the recommendation situation of all the contents in the entire content library, and the recommendation popularity library includes all the contents in the entire content library in the preset The recommended popularity within a certain period of time; sending all the content in the recommended popularity library to the CDN. Correspondingly, the processor 61 fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm, and after obtaining a target recommendation result, is further configured to: update the Recommended heat library.

本实施例中,所述CDN发送的缓存内容为所述缓存内容队列的前P%的内容,或者,为所述缓存内容队列的前P%的内容相对于上次发送的内容的增量数据,其中,P为大于0小于100。In this embodiment, the cache content sent by the CDN is the content of the top P% of the cache content queue, or the incremental data of the top P% content of the cache content queue relative to the content sent last time , where P is greater than 0 and less than 100.

本实施例提供的推荐系统,可用于执行实施例一至实施例五的方法,具体实现方式和技术效果类似,这里不再赘述。The recommendation system provided in this embodiment can be used to implement the methods of Embodiment 1 to Embodiment 5, and the specific implementation manner and technical effect are similar, and will not be repeated here.

本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by program instructions and related hardware. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.

Claims (54)

1.一种网络内容的推荐方法,其特征在于,包括:1. A method for recommending network content, comprising: 推荐系统接收内容分发网络CDN发送的缓存内容队列中的缓存内容的标识,根据所述缓存内容的标识和全体内容库获取所述缓存内容的信息,将所述缓存内容的标识和所述缓存内容的信息添加到缓存内容库;The recommendation system receives the identifier of the cached content in the cached content queue sent by the content distribution network CDN, obtains the information of the cached content according to the identifier of the cached content and the entire content library, and combines the identifier of the cached content with the cached content The information added to the cache content library; 当所述推荐系统接收到客户端发送的推荐请求消息时,所述推荐系统根据预先获取的用户兴趣特征和所述全体内容库,采用第一推荐算法计算得到第一推荐结果;When the recommendation system receives the recommendation request message sent by the client, the recommendation system uses the first recommendation algorithm to calculate the first recommendation result according to the pre-acquired user interest characteristics and the entire content library; 所述推荐系统根据所述缓存内容库获取第二推荐结果;The recommendation system acquires a second recommendation result according to the cached content library; 所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果;The recommendation system fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result; 所述推荐系统将所述目标推荐结果推送给目标用户。The recommendation system pushes the target recommendation result to the target user. 2.根据权利要求1所述的方法,其特征在于,所述推荐系统根据所述缓存内容库获取第二推荐结果,包括:2. The method according to claim 1, wherein the recommendation system obtains a second recommendation result according to the cached content library, comprising: 所述推荐系统根据所述用户兴趣特征和所述缓存内容库,采用第二推荐算法计算得到所述第二推荐结果。The recommendation system calculates the second recommendation result by using a second recommendation algorithm according to the user interest characteristics and the cached content library. 3.根据权利要求1所述的方法,其特征在于,所述推荐系统根据所述缓存内容库获取第二推荐结果,包括:3. The method according to claim 1, wherein the recommendation system obtains a second recommendation result according to the cached content library, comprising: 所述推荐系统从所述第一推荐结果选择属于所述缓存内容库的推荐内容,将所选择的推荐内容作为所述第二推荐结果。The recommendation system selects recommended content belonging to the cached content library from the first recommendation result, and takes the selected recommended content as the second recommendation result. 4.根据权利要求1-3中任一项所述的方法,其特征在于,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,包括:4. The method according to any one of claims 1-3, wherein the recommendation system fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain the target Recommended results, including: 所述推荐系统确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;The recommendation system determines common recommendation content in the first recommendation result and the second recommendation result; 所述推荐系统从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;The recommendation system deletes the common recommendation content from the first recommendation result to obtain a third recommendation result; 所述推荐系统根据推荐内容的得分,对所述第二推荐结果和所述第三推荐结果中的推荐内容统一进行排序;The recommendation system uniformly sorts the recommended content in the second recommendation result and the third recommendation result according to the score of the recommended content; 所述推荐系统将排序后的推荐内容作为所述目标推荐结果,或者,所述推荐系统按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。The recommendation system takes the sorted recommended content as the target recommendation result, or the recommendation system selects part of the recommended content from the sorted recommended content according to a preset algorithm as the target recommendation result. 5.根据权利要求1-3中任一项所述的方法,其特征在于,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,包括:5. The method according to any one of claims 1-3, wherein the recommendation system fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain the target Recommended results, including: 所述推荐系统确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;The recommendation system determines common recommendation content in the first recommendation result and the second recommendation result; 所述推荐系统从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;The recommendation system deletes the common recommendation content from the first recommendation result to obtain a third recommendation result; 所述推荐系统从所述第三推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;The recommendation system selects a%*k recommended content from the third recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100; 所述推荐系统从所述第二推荐结果中选择(1-a%)*k个推荐内容;The recommendation system selects (1-a%)*k recommended content from the second recommendation result; 所述推荐系统根据推荐内容的得分,对从所述第三推荐结果中选择的推荐内容和从所述第二推荐结果中选择的推荐内容进行统一排序,将统一排序后的推荐内容作为所述目标推荐结果。The recommendation system uniformly sorts the recommended content selected from the third recommendation result and the recommended content selected from the second recommendation result according to the scores of the recommended content, and uses the unified sorted recommended content as the Target recommendation results. 6.根据权利要求5所述的方法,其特征在于,所述推荐系统从所述第三推荐结果中选择a%*k个推荐内容,包括:6. The method according to claim 5, wherein the recommendation system selects a%*k recommended content from the third recommendation result, including: 所述推荐系统根据推荐内容的得分对所述第三推荐结果中的推荐内容进行排序,从排序后的所述第三推荐结果中选择排序在前的a%*k个推荐内容;The recommendation system sorts the recommended content in the third recommendation result according to the score of the recommended content, and selects the top a%*k recommended content from the sorted third recommendation result; 所述推荐系统从所述第二推荐结果中选择(1-a%)*k个推荐内容,包括:The recommendation system selects (1-a%)*k recommended content from the second recommendation result, including: 所述推荐系统根据推荐内容的得分对所述第二推荐结果中的推荐内容进行排序,从排序后的所述第二推荐结果中选择排序在前的(1-a%)*k个推荐内容。The recommendation system sorts the recommended content in the second recommendation result according to the score of the recommended content, and selects the top (1-a%)*k recommended content from the sorted second recommendation result . 7.根据权利要求4-6中任一项所述的方法,其特征在于,所述推荐系统从所述第一推荐结果中删除所述共同的推荐内容之后,所述方法还包括:7. The method according to any one of claims 4-6, wherein after the recommendation system deletes the common recommendation content from the first recommendation result, the method further comprises: 所述推荐系统提高所述第二推荐结果中包括的所述共同的推荐内容的得分。The recommendation system increases the score of the common recommended content included in the second recommendation result. 8.根据权利要求1-3中任一项所述的方法,其特征在于,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,包括:8. The method according to any one of claims 1-3, wherein the recommendation system fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain the target Recommended results, including: 所述推荐系统确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;The recommendation system determines common recommendation content in the first recommendation result and the second recommendation result; 所述推荐系统从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;The recommendation system deletes the common recommendation content from the second recommendation result to obtain a fourth recommendation result; 所述推荐系统根据推荐内容的得分,对所述第一推荐结果和所述第四推荐结果中的推荐内容统一进行排序;The recommendation system uniformly sorts the recommended content in the first recommendation result and the fourth recommendation result according to the score of the recommended content; 所述推荐系统将排序后的推荐内容作为所述目标推荐结果,或者,所述推荐系统按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。The recommendation system takes the sorted recommended content as the target recommendation result, or, the recommendation system selects part of the recommended content from the sorted recommended content according to a preset algorithm as the target recommendation result. 9.根据权利要求1-3中任一项所述的方法,其特征在于,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果,包括:9. The method according to any one of claims 1-3, wherein the recommendation system fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain the target Recommended results, including: 所述推荐系统确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;The recommendation system determines common recommendation content in the first recommendation result and the second recommendation result; 所述推荐系统从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;The recommendation system deletes the common recommendation content from the second recommendation result to obtain a fourth recommendation result; 所述推荐系统从所述第一推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;The recommendation system selects a%*k recommended content from the first recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100; 所述推荐系统从所述第四推荐结果中选择(1-a%)*k个推荐内容;The recommendation system selects (1-a%)*k recommended content from the fourth recommendation result; 所述推荐系统根据推荐内容的得分,对从所述第一推荐结果中选择的推荐内容和从所述第四推荐结果中选择的推荐内容进行统一排序,并将统一排序后的推荐内容作为所述目标推荐结果。The recommendation system uniformly sorts the recommended content selected from the first recommendation result and the recommended content selected from the fourth recommendation result according to the scores of the recommended content, and uses the unified sorted recommended content as the recommended content. The target recommendation results. 10.根据权利要求9所述的方法,其特征在于,所述推荐系统从所述第一推荐结果中选择a%*k个推荐内容,包括:10. The method according to claim 9, wherein the recommendation system selects a%*k recommended content from the first recommendation result, including: 所述推荐系统根据推荐内容的得分对所述第一推荐结果中的推荐内容进行排序,从排序后的所述第一推荐结果中选择排序在前的a%*k个推荐内容;The recommendation system sorts the recommended content in the first recommendation result according to the score of the recommended content, and selects the top a%*k recommended content from the sorted first recommendation result; 所述推荐系统从所述第四推荐结果中选择(1-a%)*k个推荐内容,包括:The recommendation system selects (1-a%)*k recommended content from the fourth recommendation result, including: 所述推荐系统根据推荐内容的得分对所述第四推荐结果中的推荐内容进行排序,从排序后的所述第四推荐结果中选择(1-a%)*k个推荐内容。The recommendation system sorts the recommended content in the fourth recommendation result according to the score of the recommended content, and selects (1-a%)*k recommended content from the sorted fourth recommendation result. 11.根据权利要求7-10中任一项所述的方法,其特征在于,所述推荐系统从所述第二推荐结果中删除所述共同的推荐内容之后,所述方法还包括:11. The method according to any one of claims 7-10, wherein after the recommendation system deletes the common recommendation content from the second recommendation result, the method further comprises: 所述推荐系统提高所述第一推荐结果中包括的所述共同的推荐内容的得分。The recommendation system increases the score of the common recommended content included in the first recommendation result. 12.根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:12. The method according to any one of claims 1-3, further comprising: 所述推荐系统根据所述全体内容库中的全体内容的推荐情况生成推荐热度库,所述推荐热度库中包括所述全体内容库中的全体内容在预设时间内的推荐热度;The recommendation system generates a recommendation popularity library according to the recommendation situation of all the contents in the entire content library, and the recommendation popularity library includes the recommendation popularity of all the contents in the entire content library within a preset time; 所述推荐系统将推荐热度库中的所有内容发送给所述CDN。The recommendation system sends all the content in the recommended popularity library to the CDN. 13.根据权利要求12所述的方法,其特征在于,所述推荐系统根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果之后,所述方法还包括:13. The method according to claim 12, wherein the recommendation system fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm, and after obtaining the target recommendation result, the Methods also include: 所述推荐系统根据所述目标推荐结果更新所述推荐热度库。The recommendation system updates the recommendation popularity library according to the target recommendation result. 14.根据权利要求1-13中任一项所述的方法,其特征在于,所述CDN发送的缓存内容为所述缓存内容队列的前P%的内容,或者,为所述缓存内容队列的前P%的内容相对于上次发送的内容的增量数据,其中,P为大于0小于100。14. The method according to any one of claims 1-13, wherein the cache content sent by the CDN is the content of the top P% of the cache content queue, or is the content of the cache content queue Incremental data of the content of the top P% relative to the content sent last time, where P is greater than 0 and less than 100. 15.一种网络内容的缓存替换方法,其特征在于,包括:15. A cache replacement method for network content, comprising: 内容分发网络CDN边缘服务器获取缓存内容队列中的缓存内容的推荐热度和访问热度;The content distribution network CDN edge server obtains the recommendation popularity and access popularity of the cached content in the cached content queue; 所述CDN边缘服务器根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换。The CDN edge server performs cache replacement on the cache content queue according to the access popularity and recommendation popularity of the cache content in the cache content queue. 16.根据权利要求15所述的方法,其特征在于,所述CDN边缘服务器根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换,包括:16. The method according to claim 15, wherein the CDN edge server caches and replaces the cached content queue according to the access popularity and recommendation popularity of the cached content in the cached content queue, comprising: 若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则所述CDN边缘服务器确定对所述缓存内容队列的队尾访问热度较小的缓存内容进行淘汰;If the size of the cached content in the cached content queue is greater than or equal to the first threshold, the CDN edge server determines to eliminate the cached content at the end of the cached content queue with less popular access; 所述CDN边缘服务器比较所述缓存内容队列的队尾具有相同访问热度的缓存内容的推荐热度,淘汰所述具有相同访问热度的缓存内容中推荐热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于或等于所述第一阈值。The CDN edge server compares the recommended popularity of the cached content with the same access popularity at the tail of the cache content queue, and eliminates the cache content with the lower recommended popularity among the cache contents with the same access popularity, until the cache content queue If the size of the cached content in the queue is smaller than a second threshold, the elimination of the cached content queue is stopped, and the second threshold is smaller than or equal to the first threshold. 17.根据权利要求15所述的方法,其特征在于,所述CDN边缘服务器根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换,包括:17. The method according to claim 15, wherein the CDN edge server caches and replaces the cached content queue according to the access popularity and recommendation popularity of the cached content in the cached content queue, comprising: 若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则所述CDN边缘服务器确定对所述缓存内容队列的队尾的访问热度较小的缓存内容进行淘汰;If the size of the cached content in the cached content queue is greater than or equal to the first threshold, the CDN edge server determines to eliminate the cached content at the queue tail of the cached content queue with less popular access; 所述CDN边缘服务器根据所述缓存内容队列的队尾的缓存内容的访问热度和推荐热度,计算所述缓存内容队列的队尾中缓存内容的综合热度;The CDN edge server calculates the comprehensive popularity of the cache content at the tail of the cache content queue according to the access popularity and recommendation popularity of the cache content at the tail of the cache content queue; 所述CDN边缘服务器淘汰所述缓存内容队列的队尾中综合热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于等于所述第一阈值。The CDN edge server eliminates cached content with low overall popularity in the tail of the cached content queue until the size of the cached content in the cached content queue is smaller than a second threshold, then stops eliminating the cached content queue , the second threshold is less than or equal to the first threshold. 18.根据权利要求15所述的方法,其特征在于,所述CDN边缘服务器获取缓存内容队列中的缓存内容的推荐热度和访问热度,包括:18. The method according to claim 15, wherein the CDN edge server acquires recommendation popularity and access popularity of cached content in the cached content queue, comprising: 所述CDN边缘服务器根据所述缓存内容队列中的缓存内容的历史访问情况生成所述缓存内容队列中的缓存内容的访问热度;The CDN edge server generates the access heat of the cached content in the cached content queue according to the historical access conditions of the cached content in the cached content queue; 所述CDN边缘服务器接收推荐系统发送的所述缓存内容队列中的缓存内容的推荐热度,所述缓存内容队列中的缓存内容的推荐热度是所述推荐系统根据所述缓存内容队列中的缓存内容的推荐情况生成的。The CDN edge server receives the recommendation heat of the cache content in the cache content queue sent by the recommendation system, and the recommendation heat of the cache content in the cache content queue is the recommendation system according to the cache content in the cache content queue generated by the recommendations. 19.根据权利要求15-18中任一项所述的方法,其特征在于,所述方法还包括:19. The method according to any one of claims 15-18, further comprising: 所述CDN边缘服务器获取候选内容队列中的候选内容的推荐热度和访问热度;The CDN edge server acquires recommendation popularity and access popularity of candidate content in the candidate content queue; 所述CDN边缘服务器根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换。The CDN edge server performs cache replacement on the candidate content queue according to the recommendation popularity and access popularity of the candidate content in the candidate content queue. 20.根据权利要求19所述的方法,其特征在于,所述CDN边缘服务器根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换,包括:20. The method according to claim 19, wherein the CDN edge server caches and replaces the candidate content queue according to the recommendation popularity and access popularity of the candidate content in the candidate content queue, comprising: 若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则所述CDN边缘服务器确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;If the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, the CDN edge server determines to eliminate the candidate content at the tail of the candidate content queue that has less popular access; 所述CDN边缘服务器比较所述候选内容队列中具有相同访问热度的候选内容的推荐热度,淘汰所述具有相同访问热度的候选内容中推荐热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。The CDN edge server compares the recommendation popularity of the candidate content with the same access popularity in the candidate content queue, and eliminates the candidate content with the lower recommendation popularity among the candidate content with the same access popularity, until the candidate content in the candidate content queue If the size of the candidate content is smaller than a fourth threshold, the elimination of the candidate content queue is stopped, and the fourth threshold is smaller than or equal to the third threshold. 21.根据权利要求19所述的方法,其特征在于,所述CDN边缘服务器根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换,包括:21. The method according to claim 19, wherein the CDN edge server caches and replaces the candidate content queue according to the recommendation popularity and access popularity of the candidate content in the candidate content queue, comprising: 若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则所述CDN边缘服务器确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;If the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, the CDN edge server determines to eliminate the candidate content at the tail of the candidate content queue that has less popular access; 所述CDN边缘服务器根据所述候选内容队列的队尾中候选内容的访问热度和推荐热度,计算所述候选内容队列的队尾中候选内容的综合热度;The CDN edge server calculates the comprehensive popularity of the candidate content in the queue tail of the candidate content queue according to the access popularity and recommendation popularity of the candidate content in the queue tail of the candidate content queue; 所述CDN边缘服务器淘汰所述候选内容队列的队尾中候选内容的综合热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。The CDN edge server eliminates the candidate content with lower comprehensive popularity of the candidate content in the tail of the candidate content queue until the size of the candidate content in the candidate content queue is smaller than the fourth threshold, then stops processing the candidate content The queue is eliminated, and the fourth threshold is less than or equal to the third threshold. 22.根据权利要求19所述的方法,其特征在于,所述CDN边缘服务器获取候选内容队列中的候选内容的推荐热度和访问热度,包括:22. The method according to claim 19, wherein the CDN edge server acquires recommendation popularity and access popularity of candidate content in the candidate content queue, comprising: 所述CDN边缘服务器根据所述候选内容队列中的候选内容的历史访问情况生成所述候选内容队列中的候选内容的访问热度;The CDN edge server generates the access heat of the candidate content in the candidate content queue according to the historical access conditions of the candidate content in the candidate content queue; 所述推荐系统接收推荐系统发送的所述候选内容的推荐热度,所述候选内容的推荐热度是所述推荐系统根据所述候选内容的推荐情况生成的。The recommendation system receives the recommendation popularity of the candidate content sent by the recommendation system, and the recommendation popularity of the candidate content is generated by the recommendation system according to the recommendation situation of the candidate content. 23.一种网络内容的缓存替换方法,其特征在于,包括:23. A cache replacement method for network content, comprising: 内容分发网络CDN的边缘服务器接收客户端发送的内容获取请求,所述内容获取请求中包括待访问内容的标识信息;The edge server of the content distribution network CDN receives the content acquisition request sent by the client, and the content acquisition request includes identification information of the content to be accessed; 所述CDN边缘服务器根据所述待访问内容的标识信息确定所述待访问内容是否在自己的缓存内容队列中;The CDN edge server determines whether the content to be accessed is in its cache content queue according to the identification information of the content to be accessed; 若所述待访问内容在所述缓存内容队列中,则所述CDN边缘服务器向所述客户端返回所述待访问内容;If the content to be accessed is in the cached content queue, the CDN edge server returns the content to be accessed to the client; 所述CDN边缘服务器更新所述待访问内容的访问热度,并根据所述待访问内容的访问热度和推荐热度计算所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述缓存内容队列;The CDN edge server updates the access popularity of the content to be accessed, and calculates the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed, and updates the Cache content queue; 当需要对所述缓存内容队列进行缓存替换时,所述CDN边缘服务器根据所述缓存内容队列中缓存内容的热度信息,淘汰所述缓存内容队列中热度较小的缓存内容。When it is necessary to perform cache replacement on the cached content queue, the CDN edge server eliminates less popular cached content in the cached content queue according to the popularity information of the cached content in the cached content queue. 24.根据权利要求23所述的方法,其特征在于,若所述待访问内容的标识信息不在所述缓存内容队列中,所述CDN边缘服务器根据所述待访问内容的标识信息确定所述待访问内容是否在所述CDN边缘服务器的候选内容队列中;24. The method according to claim 23, wherein if the identification information of the content to be accessed is not in the cached content queue, the CDN edge server determines the content to be accessed according to the identification information of the content to be accessed Whether the accessed content is in the candidate content queue of the CDN edge server; 若所述待访问内容在所述候选内容队列中,则所述CDN边缘服务器更新所述待访问内容的访问热度,根据所述待访问内容的访问热度和推荐热度确定所述待访问内容的热度信息;If the content to be accessed is in the candidate content queue, the CDN edge server updates the access popularity of the content to be accessed, and determines the popularity of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed information; 所述CDN边缘服务器根据所述待访问内容的热度信息判断所述待访问内容的热度是否大于预设的热度阈值;The CDN edge server determines whether the popularity of the content to be accessed is greater than a preset popularity threshold according to the popularity information of the content to be accessed; 若所述待访问内容的热度大于所述热度阈值,则所述CDN边缘服务器将所述待访问内容添加到所述缓存内容队列中,并从所述候选内容队列中删除所述待访问内容;If the popularity of the content to be accessed is greater than the popularity threshold, the CDN edge server adds the content to be accessed to the cache content queue, and deletes the content to be accessed from the candidate content queue; 所述CDN边缘服务器向所述客户端返回所述待访问内容服务器所在的原始服务器的网络协议IP地址。The CDN edge server returns to the client the network protocol IP address of the original server where the content server to be accessed is located. 25.根据权利要求24所述的方法,其特征在于,若所述待访问内容不在所述候选内容队列中,所述CDN边缘服务器将所述待访问内容添加到所述候选内容队列中;25. The method according to claim 24, wherein if the content to be accessed is not in the content candidate queue, the CDN edge server adds the content to be accessed to the content candidate queue; 所述CDN边缘服务器更新所述待访问内容的访问热度,根据所述待访问内容的热度和所述待访问内容的推荐热度确定所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述候选内容队列;The CDN edge server updates the access popularity of the content to be accessed, determines the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed, and determines the popularity information of the content to be accessed according to the popularity of the content to be accessed information to update the candidate content queue; 所述CDN边缘服务器向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。The CDN edge server returns to the client the IP address of the original server where the content server to be accessed is located. 26.根据权利要求24所述的方法,其特征在于,若所述待访问内容的热度小于或等于所述热度阈值,则所述CDN边缘服务器根据所述待访问内容的热度信息更新所述候选内容队列;26. The method according to claim 24, wherein if the popularity of the content to be accessed is less than or equal to the popularity threshold, the CDN edge server updates the candidate according to the popularity information of the content to be accessed content queue; 所述CDN边缘服务器向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。The CDN edge server returns to the client the IP address of the original server where the content server to be accessed is located. 27.根据权利要求24-26中任一项所述的方法,其特征在于,所述方法还包括:27. The method according to any one of claims 24-26, further comprising: 当需要对所述候选内容队列进行缓存替换时,所述CDN边缘服务器根据所述候选内容队列中候选内容的热度信息,淘汰所述候选内容队列中热度较小的候选内容。When it is necessary to cache and replace the candidate content queue, the CDN edge server eliminates less popular candidate content in the candidate content queue according to the popularity information of the candidate content in the candidate content queue. 28.一种推荐系统,其特征在于,包括:28. A recommendation system, characterized in that it comprises: 接收模块,用于接收内容分发网络CDN发送的缓存内容队列中的缓存内容的标识,根据所述缓存内容的标识和全体内容库获取所述缓存内容的信息,将所述缓存内容的标识和所述缓存内容的信息添加到缓存内容库;The receiving module is configured to receive the identifier of the cached content in the cached content queue sent by the content distribution network CDN, obtain the information of the cached content according to the identifier of the cached content and the entire content library, and combine the identifier of the cached content with the Add the information about the cached content to the cached content repository; 推荐模块,用于当所述推荐系统接收到客户端发送的推荐请求消息时,根据预先获取的用户兴趣特征和所述全体内容库,采用第一推荐算法计算得到第一推荐结果;A recommendation module, configured to use a first recommendation algorithm to calculate a first recommendation result according to the pre-acquired user interest characteristics and the entire content library when the recommendation system receives a recommendation request message sent by the client; 所述推荐模块,还用于根据所述缓存内容库获取第二推荐结果;The recommendation module is further configured to obtain a second recommendation result according to the cached content library; 融合模块,用于根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果;a fusion module, configured to fuse the first recommendation result and the second recommendation result according to a preset fusion algorithm to obtain a target recommendation result; 发送模块,用于将所述目标推荐结果推送给目标用户。A sending module, configured to push the target recommendation result to the target user. 29.根据权利要求28所述的推荐系统,其特征在于,所述推荐模块根据所述缓存内容库获取第二推荐结果,具体为:29. The recommendation system according to claim 28, wherein the recommendation module obtains a second recommendation result according to the cached content library, specifically: 根据所述用户兴趣特征和所述缓存内容库,采用第二推荐算法计算得到所述第二推荐结果。According to the user interest feature and the cached content library, the second recommendation result is calculated by using a second recommendation algorithm. 30.根据权利要求28所述的推荐系统,其特征在于,所述推荐模块根据所述缓存内容库获取第二推荐结果,具体为:30. The recommendation system according to claim 28, wherein the recommendation module acquires a second recommendation result according to the cached content library, specifically: 从所述第一推荐结果选择属于所述缓存内容库的推荐内容,将所选择的推荐内容作为所述第二推荐结果。Select recommended content belonging to the cached content library from the first recommended result, and use the selected recommended content as the second recommended result. 31.根据权利要求28-30中任一项所述的推荐系统,其特征在于,所述融合模块具体用于:31. The recommendation system according to any one of claims 28-30, wherein the fusion module is specifically used for: 确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;determining common recommended content in the first recommendation result and the second recommendation result; 从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;deleting the common recommendation content from the first recommendation result to obtain a third recommendation result; 根据推荐内容的得分,对所述第二推荐结果和所述第三推荐结果中的推荐内容统一进行排序;According to the score of the recommended content, the recommended content in the second recommended result and the third recommended result is uniformly sorted; 将排序后的推荐内容作为所述目标推荐结果,或者,按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。The sorted recommended content is used as the target recommendation result, or part of the recommended content is selected from the sorted recommended content according to a preset algorithm as the target recommendation result. 32.根据权利要求28-30中任一项所述的推荐系统,其特征在于,所述融合模块具体用于:32. The recommendation system according to any one of claims 28-30, wherein the fusion module is specifically used for: 确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;determining common recommended content in the first recommendation result and the second recommendation result; 从所述第一推荐结果中删除所述共同的推荐内容,得到第三推荐结果;deleting the common recommendation content from the first recommendation result to obtain a third recommendation result; 从所述第三推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;Select a%*k recommended content from the third recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100; 从所述第二推荐结果中选择(1-a%)*k个推荐内容;Select (1-a%)*k recommended content from the second recommended result; 根据推荐内容的得分,对从所述第三推荐结果中选择的推荐内容和从所述第二推荐结果中选择的推荐内容进行统一排序,将统一排序后的推荐内容作为所述目标推荐结果。According to the scores of the recommended content, the recommended content selected from the third recommended result and the recommended content selected from the second recommended result are uniformly sorted, and the uniformly sorted recommended content is used as the target recommended result. 33.根据权利要求32所述的推荐系统,其特征在于,所述融合模块从所述第三推荐结果中选择a%*k个推荐内容,具体为:33. The recommendation system according to claim 32, wherein the fusion module selects a%*k recommended content from the third recommendation result, specifically: 根据推荐内容的得分对所述第三推荐结果中的推荐内容进行排序,从排序后的所述第三推荐结果中选择排序在前的a%*k个推荐内容;sorting the recommended content in the third recommendation result according to the score of the recommended content, and selecting the top a%*k recommended content from the sorted third recommendation result; 所述融合模块从所述第二推荐结果中选择(1-a%)*k个推荐内容,具体为:The fusion module selects (1-a%)*k recommended content from the second recommendation result, specifically: 根据推荐内容的得分对所述第二推荐结果中的推荐内容进行排序,从排序后的所述第二推荐结果中选择排序在前的(1-a%)*k个推荐内容。The recommended content in the second recommended result is sorted according to the score of the recommended content, and the top (1-a%)*k recommended content is selected from the sorted second recommended result. 34.根据权利要求31-33中任一项所述的推荐系统,其特征在于,所述融合模块从所述第一推荐结果中删除所述共同的推荐内容之后,还用于:34. The recommendation system according to any one of claims 31-33, wherein after the fusion module deletes the common recommendation content from the first recommendation result, it is further used for: 提高所述第二推荐结果中包括的所述共同的推荐内容的得分。The score of the common recommended content included in the second recommendation result is increased. 35.根据权利要求28-30中任一项所述的推荐系统,其特征在于,所述融合模块具体用于:35. The recommendation system according to any one of claims 28-30, wherein the fusion module is specifically used for: 确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;determining common recommended content in the first recommendation result and the second recommendation result; 从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;deleting the common recommendation content from the second recommendation result to obtain a fourth recommendation result; 根据推荐内容的得分,对所述第一推荐结果和所述第四推荐结果中的推荐内容统一进行排序;According to the score of the recommended content, the recommended content in the first recommended result and the fourth recommended result is uniformly sorted; 将排序后的推荐内容作为所述目标推荐结果,或者,按照预设的算法从所述排序后的推荐内容中选择部分推荐内容作为所述目标推荐结果。The sorted recommended content is used as the target recommendation result, or part of the recommended content is selected from the sorted recommended content according to a preset algorithm as the target recommendation result. 36.根据权利要求28-30中任一项所述的推荐系统,其特征在于,所述融合模块具体用于:36. The recommendation system according to any one of claims 28-30, wherein the fusion module is specifically used for: 确定所述第一推荐结果和所述第二推荐结果中共同的推荐内容;determining common recommended content in the first recommendation result and the second recommendation result; 从所述第二推荐结果中删除所述共同的推荐内容,得到第四推荐结果;deleting the common recommendation content from the second recommendation result to obtain a fourth recommendation result; 从所述第一推荐结果中选择a%*k个推荐内容,其中,k为所述目标推荐结果中包括的推荐内容的个数,a大于等于0小于等于100;Select a%*k recommended content from the first recommendation result, where k is the number of recommended content included in the target recommendation result, and a is greater than or equal to 0 and less than or equal to 100; 从所述第四推荐结果中选择(1-a%)*k个推荐内容;Select (1-a%)*k recommended content from the fourth recommended result; 根据推荐内容的得分,对从所述第一推荐结果中选择的推荐内容和从所述第四推荐结果中选择的推荐内容进行统一排序,并将统一排序后的推荐内容作为所述目标推荐结果。According to the score of the recommended content, the recommended content selected from the first recommended result and the recommended content selected from the fourth recommended result are uniformly sorted, and the unified sorted recommended content is used as the target recommended result. . 37.根据权利要求36所述的推荐系统,其特征在于,所述融合模块从所述第一推荐结果中选择a%*k个推荐内容,具体为:37. The recommendation system according to claim 36, wherein the fusion module selects a%*k recommended content from the first recommendation result, specifically: 根据推荐内容的得分对所述第一推荐结果中的推荐内容进行排序,从排序后的所述第一推荐结果中选择排序在前的a%*k个推荐内容;sorting the recommended content in the first recommendation result according to the score of the recommended content, and selecting the top a%*k recommended content from the sorted first recommendation result; 所述融合模块从所述第四推荐结果中选择(1-a%)*k个推荐内容,具体为:The fusion module selects (1-a%)*k recommended content from the fourth recommendation result, specifically: 根据推荐内容的得分对所述第四推荐结果中的推荐内容进行排序,从排序后的所述第四推荐结果中选择(1-a%)*k个推荐内容。The recommended content in the fourth recommended result is sorted according to the score of the recommended content, and (1-a%)*k recommended content is selected from the sorted fourth recommended result. 38.根据权利要求35-37中任一项所述的推荐系统,其特征在于,所述融合模块从所述第二推荐结果中删除所述共同的推荐内容之后,还用于:38. The recommendation system according to any one of claims 35-37, wherein after the fusion module deletes the common recommendation content from the second recommendation result, it is further used for: 提高所述第一推荐结果中包括的所述共同的推荐内容的得分。The score of the common recommended content included in the first recommendation result is increased. 39.根据权利要求28-30中任一项所述的推荐系统,其特征在于,所述推荐系统还包括:39. The recommendation system according to any one of claims 28-30, wherein the recommendation system further comprises: 推荐热度生成模块,用于根据所述全体内容库中的全体内容的推荐情况生成推荐热度库,所述推荐热度库中包括所述全体内容库中的全体内容在预设时间内的推荐热度;A recommendation popularity generation module, configured to generate a recommendation popularity library according to the recommendation situation of all contents in the entire content library, the recommendation popularity library including the recommendation popularity of all the contents in the entire content library within a preset time; 所述发送模块,还用于将推荐热度库中的所有内容发送给所述CDN。The sending module is further configured to send all the content in the recommended popularity library to the CDN. 40.根据权利要求39所述的推荐系统,其特征在于,所述融合模块根据预设的融合算法对所述第一推荐结果和所述第二推荐结果进行融合,得到目标推荐结果之后,所述推荐热度生成模块还用于:40. The recommendation system according to claim 39, wherein the fusion module fuses the first recommendation result and the second recommendation result according to a preset fusion algorithm, and after obtaining the target recommendation result, the The recommendation heat generating module is also used for: 根据所述目标推荐结果更新所述推荐热度库。The recommendation popularity database is updated according to the target recommendation result. 41.根据权利要求28-41中任一项所述的推荐系统,其特征在于,所述CDN发送的缓存内容为所述缓存内容队列的前P%的内容,或者,为所述缓存内容队列的前P%的内容相对于上次发送的内容的增量数据,其中,P为大于0小于100。41. The recommendation system according to any one of claims 28-41, wherein the cached content sent by the CDN is the content of the top P% of the cached content queue, or is the content of the cached content queue Incremental data of the content of the top P% relative to the content sent last time, where P is greater than 0 and less than 100. 42.一种内容分发网络CDN边缘服务器,其特征在于,包括:42. A content distribution network CDN edge server, characterized in that it comprises: 获取模块,用于获取缓存内容队列中的缓存内容的推荐热度和访问热度;An acquisition module, configured to acquire recommendation popularity and access popularity of cached content in the cached content queue; 缓存替换模块,用于根据所述缓存内容队列中的缓存内容的访问热度和推荐热度对所述缓存内容队列进行缓存替换。A cache replacement module, configured to perform cache replacement on the cache content queue according to the access popularity and recommendation popularity of the cache content in the cache content queue. 43.根据权利要求42所述的CDN边缘服务器,其特征在于,所述缓存替换模块具体用于:43. The CDN edge server according to claim 42, wherein the cache replacement module is specifically used for: 若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则确定对所述缓存内容队列的队尾访问热度较小的缓存内容进行淘汰;If the size of the cached content in the cached content queue is greater than or equal to the first threshold, it is determined to eliminate the cached content at the end of the cached content queue with less popular access; 比较所述缓存内容队列的队尾具有相同访问热度的缓存内容的推荐热度,淘汰所述具有相同访问热度的缓存内容中推荐热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于或等于所述第一阈值。Comparing the recommendation heat of the cache content with the same access heat at the queue tail of the cache content queue, eliminating the cache content with the lower recommendation heat among the cache content with the same access heat until the cache content in the cache content queue reaches If the size is smaller than a second threshold, stop eliminating the cached content queue, and the second threshold is smaller than or equal to the first threshold. 44.根据权利要求42所述的CDN边缘服务器,其特征在于,所述缓存替换模块具体用于:44. The CDN edge server according to claim 42, wherein the cache replacement module is specifically used for: 若所述缓存内容队列中的缓存内容的大小大于或等于第一阈值,则确定对所述缓存内容队列的队尾的访问热度较小的缓存内容进行淘汰;If the size of the cached content in the cached content queue is greater than or equal to the first threshold, it is determined to eliminate the cached content at the queue tail of the cached content queue with less popular access; 根据所述缓存内容队列的队尾的缓存内容的访问热度和推荐热度,计算所述缓存内容队列的队尾中缓存内容的综合热度;According to the access heat and recommendation heat of the cache content at the queue tail of the cache content queue, calculate the comprehensive heat of the cache content in the queue tail of the cache content queue; 淘汰所述缓存内容队列的队尾中综合热度较小的缓存内容,直到所述缓存内容队列中的缓存内容的大小小于第二阈值,则停止对所述缓存内容队列进行淘汰,所述第二阈值小于等于所述第一阈值。Eliminate the cache content with less comprehensive heat in the queue tail of the cache content queue until the size of the cache content in the cache content queue is less than a second threshold, then stop eliminating the cache content queue, the second The threshold is less than or equal to the first threshold. 45.根据权利要求42所述的CDN边缘服务器,其特征在于,所述获取模块具体用于:45. The CDN edge server according to claim 42, wherein the acquiring module is specifically used for: 根据所述缓存内容队列中的缓存内容的历史访问情况生成所述缓存内容队列中的缓存内容的访问热度;generating the access popularity of the cached content in the cached content queue according to the historical access conditions of the cached content in the cached content queue; 接收推荐系统发送的所述缓存内容队列中的缓存内容的推荐热度,所述缓存内容队列中的缓存内容的推荐热度是所述推荐系统根据所述缓存内容队列中的缓存内容的推荐情况生成的。receiving the recommendation heat of the cache content in the cache content queue sent by the recommendation system, the recommendation heat of the cache content in the cache content queue is generated by the recommendation system according to the recommendation situation of the cache content in the cache content queue . 46.根据权利要求42-45中任一项所述的CDN边缘服务器,其特征在于,所述获取模块还用于:46. The CDN edge server according to any one of claims 42-45, wherein the acquisition module is also used for: 获取候选内容队列中的候选内容的推荐热度和访问热度;Obtain the recommendation popularity and access popularity of the candidate content in the candidate content queue; 所述缓存替换模块,还用于:根据所述候选内容队列中的候选内容的推荐热度和访问热度对所述候选内容队列进行缓存替换。The cache replacement module is further configured to: perform cache replacement on the candidate content queue according to the recommendation popularity and access popularity of the candidate content in the candidate content queue. 47.根据权利要求46所述的CDN边缘服务器,其特征在于,所述缓存替换模块具体用于:47. The CDN edge server according to claim 46, wherein the cache replacement module is specifically used for: 若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;If the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, it is determined to eliminate the candidate content at the tail of the candidate content queue that has less popular access; 比较所述候选内容队列中具有相同访问热度的候选内容的推荐热度,淘汰所述具有相同访问热度的候选内容中推荐热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。Comparing the recommendation popularity of the candidate content with the same access popularity in the candidate content queue, eliminating the candidate content with the lower recommendation popularity among the candidate contents with the same access popularity, until the size of the candidate content in the candidate content queue is less than the fourth threshold, stop eliminating the candidate content queue, and the fourth threshold is less than or equal to the third threshold. 48.根据权利要求46所述的CDN边缘服务器,其特征在于,所述缓存替换模块具体用于:48. The CDN edge server according to claim 46, wherein the cache replacement module is specifically used for: 若所述候选内容队列中的候选内容的大小大于或等于第三阈值,则确定对所述候选内容队列的队尾的访问热度较小的候选内容进行淘汰;If the size of the candidate content in the candidate content queue is greater than or equal to a third threshold, it is determined to eliminate the candidate content at the tail of the candidate content queue that has less popular access; 根据所述候选内容队列的队尾中候选内容的访问热度和推荐热度,计算所述候选内容队列的队尾中候选内容的综合热度;calculating the comprehensive popularity of the candidate content in the tail of the candidate content queue according to the access popularity and recommendation popularity of the candidate content in the queue tail of the candidate content queue; 淘汰所述候选内容队列的队尾中候选内容的综合热度较小的候选内容,直到所述候选内容队列中的候选内容的大小小于第四阈值,则停止对所述候选内容队列进行淘汰,所述第四阈值小于或等于所述第三阈值。Eliminate the candidate content with less comprehensive popularity of the candidate content in the queue tail of the candidate content queue, until the size of the candidate content in the candidate content queue is less than the fourth threshold, then stop eliminating the candidate content queue, so The fourth threshold is less than or equal to the third threshold. 49.根据权利要求46所述的CDN边缘服务器,其特征在于,所述获取模块具体用于:49. The CDN edge server according to claim 46, wherein the acquiring module is specifically used for: 根据所述候选内容队列中的候选内容的历史访问情况生成所述候选内容队列中的候选内容的访问热度;generating the access popularity of the candidate content in the candidate content queue according to the historical access conditions of the candidate content in the candidate content queue; 接收推荐系统发送的所述候选内容的推荐热度,所述候选内容的推荐热度是所述推荐系统根据所述候选内容的推荐情况生成的。The recommendation popularity of the candidate content sent by the recommendation system is received, and the recommendation popularity of the candidate content is generated by the recommendation system according to the recommendation situation of the candidate content. 50.一种内容分发网络CDN边缘服务器,其特征在于,包括:50. A content distribution network CDN edge server, characterized in that it comprises: 接收模块,用于接收客户端发送的内容获取请求,所述内容获取请求中包括待访问内容的标识信息;A receiving module, configured to receive a content acquisition request sent by the client, where the content acquisition request includes identification information of the content to be accessed; 处理模块,用于根据所述待访问内容的标识信息确定所述待访问内容是否在自己的缓存内容队列中,若所述待访问内容在所述缓存内容队列中,则向所述客户端返回所述待访问内容;A processing module, configured to determine whether the content to be accessed is in its own cache content queue according to the identification information of the content to be accessed, and return to the client if the content to be accessed is in the cache content queue The content to be accessed; 更新模块,用于更新所述待访问内容的访问热度,并根据所述待访问内容的访问热度和推荐热度计算所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述缓存内容队列;An update module, configured to update the access popularity of the content to be accessed, and calculate the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed, and update the Cache content queue; 缓存替换模块,用于当需要对所述缓存内容队列进行缓存替换时,根据所述缓存内容队列中缓存内容的热度信息,淘汰所述缓存内容队列中热度较小的缓存内容。The cache replacement module is configured to, when it is necessary to perform cache replacement on the cache content queue, eliminate less popular cache content in the cache content queue according to the popularity information of the cache content in the cache content queue. 51.根据权利要求50所述的CDN边缘服务器,其特征在于,若所述待访问内容的标识信息不在所述缓存内容队列中,所述处理模块还用于:51. The CDN edge server according to claim 50, wherein if the identification information of the content to be accessed is not in the cached content queue, the processing module is further configured to: 根据所述待访问内容的标识信息确定所述待访问内容是否在所述CDN边缘服务器的候选内容队列中;determining whether the content to be accessed is in the candidate content queue of the CDN edge server according to the identification information of the content to be accessed; 若所述待访问内容在所述候选内容队列中,则更新所述待访问内容的访问热度,根据所述待访问内容的访问热度和推荐热度确定所述待访问内容的热度信息;If the content to be accessed is in the candidate content queue, update the access popularity of the content to be accessed, and determine the popularity information of the content to be accessed according to the access popularity and recommendation popularity of the content to be accessed; 根据所述待访问内容的热度信息判断所述待访问内容的热度是否大于预设的热度阈值;judging whether the popularity of the content to be accessed is greater than a preset popularity threshold according to the popularity information of the content to be accessed; 若所述待访问内容的热度大于所述热度阈值,则将所述待访问内容添加到所述缓存内容队列中,并从所述候选内容队列中删除所述待访问内容;If the popularity of the content to be accessed is greater than the popularity threshold, adding the content to be accessed to the cache content queue, and deleting the content to be accessed from the candidate content queue; 向所述客户端返回所述待访问内容服务器所在的原始服务器的网络协议IP地址。Returning the network protocol IP address of the original server where the content server to be accessed is located to the client. 52.根据权利要求51所述的CDN边缘服务器,其特征在于,若所述待访问内容不在所述候选内容队列中,所述处理模块还用于:52. The CDN edge server according to claim 51, wherein if the content to be accessed is not in the candidate content queue, the processing module is further configured to: 将所述待访问内容添加到所述候选内容队列中;adding the content to be accessed to the candidate content queue; 更新所述待访问内容的访问热度,根据所述待访问内容的热度和所述待访问内容的推荐热度确定所述待访问内容的热度信息,根据所述待访问内容的热度信息更新所述候选内容队列;Update the access popularity of the content to be accessed, determine the popularity information of the content to be accessed according to the popularity of the content to be accessed and the recommendation popularity of the content to be accessed, and update the candidate according to the popularity information of the content to be accessed content queue; 向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。Returning to the client the IP address of the original server where the content server to be accessed is located. 53.根据权利要求51所述的CDN边缘服务器,其特征在于,若所述待访问内容的热度小于或等于所述热度阈值,则所述处理模块还用于:53. The CDN edge server according to claim 51, wherein if the popularity of the content to be accessed is less than or equal to the popularity threshold, the processing module is further configured to: 根据所述待访问内容的热度信息更新所述候选内容队列;updating the candidate content queue according to the popularity information of the content to be accessed; 向所述客户端返回所述待访问内容服务器所在的原始服务器的IP地址。Returning to the client the IP address of the original server where the content server to be accessed is located. 54.根据权利要求51-53中任一项所述的CDN边缘服务器,其特征在于,所述缓存替换模块还用于:54. The CDN edge server according to any one of claims 51-53, wherein the cache replacement module is also used for: 当需要对所述候选内容队列进行缓存替换时,根据所述候选内容队列中候选内容的热度信息,淘汰所述候选内容队列中热度较小的候选内容。When it is necessary to cache and replace the candidate content queue, the less popular candidate content in the candidate content queue is eliminated according to the popularity information of the candidate content in the candidate content queue.
CN201510202934.8A 2015-04-24 2015-04-24 Recommendation, cache replacement method and device for web content Active CN106161569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510202934.8A CN106161569B (en) 2015-04-24 2015-04-24 Recommendation, cache replacement method and device for web content

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510202934.8A CN106161569B (en) 2015-04-24 2015-04-24 Recommendation, cache replacement method and device for web content

Publications (2)

Publication Number Publication Date
CN106161569A true CN106161569A (en) 2016-11-23
CN106161569B CN106161569B (en) 2019-05-28

Family

ID=57346643

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510202934.8A Active CN106161569B (en) 2015-04-24 2015-04-24 Recommendation, cache replacement method and device for web content

Country Status (1)

Country Link
CN (1) CN106161569B (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106850581A (en) * 2017-01-04 2017-06-13 网宿科技股份有限公司 The distribution backup method of interactive live broadcast stream media data, system and server
CN107645667A (en) * 2017-09-21 2018-01-30 广州华多网络科技有限公司 Video recommendation method, system and server apparatus
CN107770283A (en) * 2017-11-08 2018-03-06 北京奇艺世纪科技有限公司 A kind of control method of file download, apparatus and system
CN108011941A (en) * 2017-11-29 2018-05-08 广东欧珀移动通信有限公司 Content delivery method, device, server and storage medium
CN108156253A (en) * 2018-01-05 2018-06-12 中汇信息技术(上海)有限公司 A kind of data transmission method, apparatus and system
CN108347461A (en) * 2017-01-25 2018-07-31 华为技术有限公司 Offline cache method, equipment and system
CN108419101A (en) * 2018-05-08 2018-08-17 北京奇艺世纪科技有限公司 A kind of video recommendation page generation method and device
CN108573066A (en) * 2018-04-27 2018-09-25 佛山市日日圣科技有限公司 A kind of game data processing method and processing unit
CN109274414A (en) * 2018-07-26 2019-01-25 厦门大学 Method for network coding and edge buffering in multi-directional wireless relay interaction channel cooperation
CN109766462A (en) * 2018-12-27 2019-05-17 山东信通电子股份有限公司 Image file read method, apparatus and system in transmission line of electricity monitoring system
CN111782897A (en) * 2020-07-07 2020-10-16 中国联合网络通信集团有限公司 User rights management method, server, system, device and medium
CN112084206A (en) * 2020-09-15 2020-12-15 腾讯科技(深圳)有限公司 Database transaction request processing method, related device and storage medium
CN112699327A (en) * 2020-11-06 2021-04-23 养哇(南京)科技有限公司 Front-end navigation bar recommendation method based on cloud computing and terminal equipment
CN113282786A (en) * 2021-05-12 2021-08-20 河海大学 Panoramic video edge collaborative cache replacement method based on deep reinforcement learning
CN114490781A (en) * 2022-04-01 2022-05-13 中国信息通信研究院 Block chain data processing method and device
CN114979271A (en) * 2022-05-11 2022-08-30 浪潮云信息技术股份公司 CDN cache layered scheduling method based on edge cloud computing
US11520701B2 (en) 2021-04-02 2022-12-06 Tenstorrent Inc. Data structure optimized dedicated memory caches
CN115484314A (en) * 2022-08-10 2022-12-16 重庆大学 Edge cache optimization method for recommending performance under mobile edge computing network
CN116319999A (en) * 2023-02-21 2023-06-23 银河互联网电视有限公司 Content heat degradation method and device in CDN
CN116662494A (en) * 2023-04-26 2023-08-29 华南师范大学 An artificial intelligence-based auxiliary teaching method and device
WO2023165410A1 (en) * 2022-03-02 2023-09-07 北京字节跳动网络技术有限公司 Content recommendation method and apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101911687A (en) * 2007-12-31 2010-12-08 阿尔卡特朗讯公司 Method and apparatus for distributing content
CN102571839A (en) * 2010-12-15 2012-07-11 北京邮电大学 P2P content delivery method based on social attribute of users and system adopting same
CN103412875A (en) * 2013-07-11 2013-11-27 广东工业大学 CDN strategy adjustment method based on AHP decision model

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101911687A (en) * 2007-12-31 2010-12-08 阿尔卡特朗讯公司 Method and apparatus for distributing content
CN102571839A (en) * 2010-12-15 2012-07-11 北京邮电大学 P2P content delivery method based on social attribute of users and system adopting same
CN103412875A (en) * 2013-07-11 2013-11-27 广东工业大学 CDN strategy adjustment method based on AHP decision model

Cited By (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106850581A (en) * 2017-01-04 2017-06-13 网宿科技股份有限公司 The distribution backup method of interactive live broadcast stream media data, system and server
CN108347461A (en) * 2017-01-25 2018-07-31 华为技术有限公司 Offline cache method, equipment and system
CN107645667A (en) * 2017-09-21 2018-01-30 广州华多网络科技有限公司 Video recommendation method, system and server apparatus
CN107770283A (en) * 2017-11-08 2018-03-06 北京奇艺世纪科技有限公司 A kind of control method of file download, apparatus and system
CN107770283B (en) * 2017-11-08 2020-10-23 北京奇艺世纪科技有限公司 Method, device and system for controlling file downloading
CN108011941A (en) * 2017-11-29 2018-05-08 广东欧珀移动通信有限公司 Content delivery method, device, server and storage medium
CN108156253A (en) * 2018-01-05 2018-06-12 中汇信息技术(上海)有限公司 A kind of data transmission method, apparatus and system
CN108573066A (en) * 2018-04-27 2018-09-25 佛山市日日圣科技有限公司 A kind of game data processing method and processing unit
CN108419101A (en) * 2018-05-08 2018-08-17 北京奇艺世纪科技有限公司 A kind of video recommendation page generation method and device
CN108419101B (en) * 2018-05-08 2021-01-22 北京奇艺世纪科技有限公司 Method and device for generating video recommendation page
CN109274414A (en) * 2018-07-26 2019-01-25 厦门大学 Method for network coding and edge buffering in multi-directional wireless relay interaction channel cooperation
CN109766462A (en) * 2018-12-27 2019-05-17 山东信通电子股份有限公司 Image file read method, apparatus and system in transmission line of electricity monitoring system
CN109766462B (en) * 2018-12-27 2020-12-15 山东信通电子股份有限公司 Image file reading method, device and system in power transmission line monitoring system
CN111782897A (en) * 2020-07-07 2020-10-16 中国联合网络通信集团有限公司 User rights management method, server, system, device and medium
CN111782897B (en) * 2020-07-07 2023-05-23 中国联合网络通信集团有限公司 User rights management method, server, system, equipment and medium
CN112084206A (en) * 2020-09-15 2020-12-15 腾讯科技(深圳)有限公司 Database transaction request processing method, related device and storage medium
CN112084206B (en) * 2020-09-15 2025-10-28 腾讯科技(深圳)有限公司 Database transaction request processing method, related equipment and storage medium
CN112699327A (en) * 2020-11-06 2021-04-23 养哇(南京)科技有限公司 Front-end navigation bar recommendation method based on cloud computing and terminal equipment
CN112699327B (en) * 2020-11-06 2024-04-19 的卢技术有限公司 Front-end navigation bar recommendation method based on cloud computing and terminal equipment
US11520701B2 (en) 2021-04-02 2022-12-06 Tenstorrent Inc. Data structure optimized dedicated memory caches
US12019546B2 (en) 2021-04-02 2024-06-25 Tenstorrent Inc. Data structure optimized dedicated memory caches
CN113282786A (en) * 2021-05-12 2021-08-20 河海大学 Panoramic video edge collaborative cache replacement method based on deep reinforcement learning
CN113282786B (en) * 2021-05-12 2022-09-30 河海大学 An edge-cooperative cache replacement method for panoramic video based on deep reinforcement learning
WO2023165410A1 (en) * 2022-03-02 2023-09-07 北京字节跳动网络技术有限公司 Content recommendation method and apparatus
CN114490781B (en) * 2022-04-01 2022-07-22 中国信息通信研究院 Block chain data processing method and device
CN114490781A (en) * 2022-04-01 2022-05-13 中国信息通信研究院 Block chain data processing method and device
CN114979271A (en) * 2022-05-11 2022-08-30 浪潮云信息技术股份公司 CDN cache layered scheduling method based on edge cloud computing
CN115484314A (en) * 2022-08-10 2022-12-16 重庆大学 Edge cache optimization method for recommending performance under mobile edge computing network
CN115484314B (en) * 2022-08-10 2024-04-02 重庆大学 An edge cache optimization method for recommendation empowerment under mobile edge computing networks
CN116319999A (en) * 2023-02-21 2023-06-23 银河互联网电视有限公司 Content heat degradation method and device in CDN
CN116662494A (en) * 2023-04-26 2023-08-29 华南师范大学 An artificial intelligence-based auxiliary teaching method and device
CN116662494B (en) * 2023-04-26 2024-11-05 华南师范大学 Auxiliary teaching method and device based on artificial intelligence

Also Published As

Publication number Publication date
CN106161569B (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN106161569A (en) The recommendation of Web content, buffer replacing method and equipment
US12506806B2 (en) Methods and systems for processing data requests
US8463876B2 (en) Partial object distribution in content delivery network
US10572446B2 (en) System and method for storing content on a content delivery network
US10182127B2 (en) Application-driven CDN pre-caching
US10129365B2 (en) Method and apparatus for pre-fetching remote content based on static and dynamic recommendations
WO2017096830A1 (en) Content delivery method and scheduling proxy server for cdn platform
CN104486350A (en) Network content acceleration method based on user behavior
WO2011126481A1 (en) Partial object distribution in content delivery network
US11086905B1 (en) Method and system for presenting stories
CN113473247B (en) Video playing request processing method, device and system and electronic equipment
CN119520612B (en) Cache update methods, systems, and devices
CN110753268B (en) Page card data generation method and device and electronic equipment
JP2007527067A (en) Hierarchical distribution of UI assets
CN121233583A (en) Data processing method and related equipment
SG184587A1 (en) A method and apparatus for caching and retrieving a stream object

Legal Events

Date Code Title Description
C06 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211222

Address after: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee after: HUAWEI TECHNOLOGIES Co.,Ltd.

Address before: No. 94 Ande gate, Yuhuatai District, Jiangsu, Nanjing

Patentee before: HUAWEI SOFTWARE TECHNOLOGIES Co.,Ltd.

Effective date of registration: 20211222

Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Patentee after: xFusion Digital Technologies Co., Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

CP03 Change of name, title or address

Address after: 450000 Henan Province, Zhengzhou City, Free Trade Zone Zhengzhou Area (Zhengdong), Inner Ring North Road of Longhu, No. 99

Patentee after: Super Fusion Digital Technology Co.,Ltd.

Country or region after: China

Address before: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Patentee before: xFusion Digital Technologies Co., Ltd.

Country or region before: China