Summary of the invention
The embodiment of the present invention provides recommendation, buffer replacing method and the equipment of a kind of Web content, has solved recommender system
Content recommended to the user in CDN caching, does not lead to the problem of period of reservation of number length.
First aspect present invention provides a kind of recommended method of Web content, comprising:
The mark for the cache contents in cache contents queue that recommender system reception content distribution network CDN is sent, according to
The mark of the cache contents and all content library obtain the information of the cache contents, by the mark of the cache contents and institute
The information for stating cache contents is added to cache contents library;
When the recommender system receives the recommendation request message of client transmission, the recommender system according to obtaining in advance
The user interest profile taken and all content library, are calculated the first recommendation results using the first proposed algorithm;
The recommender system obtains the second recommendation results according to the cache contents library;
The recommender system according to preset blending algorithm to first recommendation results and second recommendation results into
Row fusion, obtains target recommendation results;
The target recommendation results are pushed to target user by the recommender system.
With reference to first aspect, in the first possible implementation of the first aspect, the recommender system is according to
Cache contents library obtains the second recommendation results, comprising:
The recommender system is calculated according to the user interest profile and the cache contents library using the second proposed algorithm
Obtain second recommendation results.
With reference to first aspect, in the second possible implementation of the first aspect, the recommender system is according to
Cache contents library obtains the second recommendation results, comprising:
The recommender system belongs to the recommendation in the cache contents library from first recommendation results selection, will be selected
The recommendation selected is as second recommendation results.
With reference to first aspect, the first of first aspect is any into second of possible implementation,
In the third possible implementation of one side, the recommender system recommends to tie according to preset blending algorithm to described first
Fruit and second recommendation results are merged, and target recommendation results are obtained, comprising:
The recommender system determines recommendation common in first recommendation results and second recommendation results;
The recommender system deletes the common recommendation from first recommendation results, obtains third and recommends knot
Fruit;
The recommender system is according to the score of recommendation, in second recommendation results and the third recommendation results
Recommendation be uniformly ranked up;
The recommender system is using the recommendation after sequence as the target recommendation results, alternatively, the recommender system
According to preset algorithm from the recommendation after the sequence selected section recommendation as the target recommendation results.
With reference to first aspect, the first of first aspect is any into second of possible implementation,
In 4th kind of possible implementation of one side, the recommender system recommends to tie according to preset blending algorithm to described first
Fruit and second recommendation results are merged, and target recommendation results are obtained, comprising:
The recommender system determines recommendation common in first recommendation results and second recommendation results;
The recommender system deletes the common recommendation from first recommendation results, obtains third and recommends knot
Fruit;
The recommender system selects a%*k recommendation from the third recommendation results, wherein k is the target
The number for the recommendation for including in recommendation results, a are more than or equal to 0 and are less than or equal to 100;
The recommender system selects (1-a%) * k recommendation from second recommendation results;
The recommender system according to the score of recommendation, to the recommendation selected from the third recommendation results and
The recommendation selected from second recommendation results carries out unified sequence, using the recommendation after unified sequence as described in
Target recommendation results.
The 4th kind of possible implementation with reference to first aspect, in the 5th kind of possible implementation of first aspect
In, the recommender system selects a%*k recommendation from the third recommendation results, comprising:
The recommender system is ranked up the recommendation in the third recommendation results according to the score of recommendation,
The preceding a%*k recommendation of selected and sorted from the third recommendation results after sequence;
The recommender system selects (1-a%) * k recommendation from second recommendation results, comprising:
The recommender system is ranked up the recommendation in second recommendation results according to the score of recommendation,
Preceding (1-a%) the * k recommendation of selected and sorted from second recommendation results after sequence.
With reference to first aspect the third is any into the 5th kind of possible implementation, the of first aspect
In six kinds of possible implementations, the recommender system deleted from first recommendation results common recommendation it
Afterwards, the method also includes:
The recommender system improves the score for the common recommendation for including in second recommendation results.
With reference to first aspect, the first of first aspect is any into second of possible implementation,
In 7th kind of possible implementation of one side, the recommender system recommends to tie according to preset blending algorithm to described first
Fruit and second recommendation results are merged, and target recommendation results are obtained, comprising:
The recommender system determines recommendation common in first recommendation results and second recommendation results;
The recommender system deletes the common recommendation from second recommendation results, obtains the 4th recommendation knot
Fruit;
The recommender system is according to the score of recommendation, in first recommendation results and the 4th recommendation results
Recommendation be uniformly ranked up;
The recommender system is using the recommendation after sequence as the target recommendation results, alternatively, the recommender system
According to preset algorithm from the recommendation after the sequence selected section recommendation as the target recommendation results.
With reference to first aspect, the first of first aspect is any into second of possible implementation,
In 8th kind of possible implementation of one side, the recommender system recommends to tie according to preset blending algorithm to described first
Fruit and second recommendation results are merged, and target recommendation results are obtained, comprising:
The recommender system determines recommendation common in first recommendation results and second recommendation results;
The recommender system deletes the common recommendation from second recommendation results, obtains the 4th recommendation knot
Fruit;
The recommender system selects a%*k recommendation from first recommendation results, wherein k is the target
The number for the recommendation for including in recommendation results, a are more than or equal to 0 and are less than or equal to 100;
The recommender system selects (1-a%) * k recommendation from the 4th recommendation results;
The recommender system according to the score of recommendation, to the recommendation selected from first recommendation results and
The recommendation selected from the 4th recommendation results carries out unified sequence, and using the recommendation after unified sequence as institute
State target recommendation results.
The 8th kind of possible implementation with reference to first aspect, in the 9th kind of possible implementation of first aspect
In, the recommender system selects a%*k recommendation from first recommendation results, comprising:
The recommender system is ranked up the recommendation in first recommendation results according to the score of recommendation,
The preceding a%*k recommendation of selected and sorted from first recommendation results after sequence;
The recommender system selects (1-a%) * k recommendation from the 4th recommendation results, comprising:
The recommender system is ranked up the recommendation in the 4th recommendation results according to the score of recommendation,
(1-a%) * k recommendation is selected from the 4th recommendation results after sequence.
The 7th kind with reference to first aspect is any into the 9th kind of possible implementation, the of first aspect
In ten kinds of possible implementations, the recommender system deleted from second recommendation results common recommendation it
Afterwards, the method also includes:
The recommender system improves the score for the common recommendation for including in first recommendation results.
With reference to first aspect, the first of first aspect is any into second of possible implementation,
In a kind of possible implementation of the tenth of one side, the method also includes:
The recommender system is generated according to the recommended case of all content in all content library recommends temperature library, institute
It states and recommends to include the recommendation temperature of all content within a preset time in all content library in temperature library;
The recommender system will recommend all the elements in temperature library to be sent to the CDN.
A kind of possible implementation of the tenth with reference to first aspect, in the 12nd kind of possible realization side of first aspect
In formula, the recommender system melts first recommendation results and second recommendation results according to preset blending algorithm
It closes, after obtaining target recommendation results, the method also includes:
The recommender system updates the recommendation temperature library according to the target recommendation results.
With reference to first aspect, the first of first aspect is any into the 12nd kind of possible implementation,
In 13rd kind of possible implementation of first aspect, the cache contents that the CDN is sent are the cache contents queue
The content of preceding P%, alternatively, for the incremental number of content that sent relative to last time of content of the preceding P% of the cache contents queue
According to, wherein P is greater than 0 less than 100.
Second aspect of the present invention provides a kind of buffer replacing method of Web content, comprising:
Content distributing network CDN Edge Server obtains the recommendation temperature and access of the cache contents in cache contents queue
Temperature;
The CDN Edge Server is according to the access temperatures of the cache contents in the cache contents queue and recommends temperature
Caching replacement is carried out to the cache contents queue.
In conjunction with second aspect, in the first possible implementation of the second aspect, the CDN Edge Server according to
The access temperature and recommendation temperature of cache contents in the cache contents queue carry out caching to the cache contents queue and replace
It changes, comprising:
If the size of the cache contents in the cache contents queue is greater than or equal to first threshold, the edge CDN
The determining tail of the queue access lesser cache contents of temperature to the cache contents queue of server carry out superseded;
The tail of the queue of the CDN Edge Server cache contents queue has the cache contents of identical access temperature
Recommendation temperature, eliminate in the cache contents with identical access temperature and recommend the lesser cache contents of temperature, Zhi Daosuo
The size for stating the cache contents in cache contents queue is less than second threshold, then stops washing in a pan the cache contents queue
It eliminates, the second threshold is less than or equal to the first threshold.
In conjunction with second aspect, in a second possible implementation of the second aspect, the CDN Edge Server according to
The access temperature and recommendation temperature of cache contents in the cache contents queue carry out caching to the cache contents queue and replace
It changes, comprising:
If the size of the cache contents in the cache contents queue is greater than or equal to first threshold, the edge CDN
Server determination carries out the lesser cache contents of access temperature of the tail of the queue of the cache contents queue superseded;
The CDN Edge Server is according to the access temperature and recommendation of the cache contents of the tail of the queue of the cache contents queue
Temperature calculates the synthesis temperature of cache contents in the tail of the queue of the cache contents queue;
The CDN Edge Server eliminates the comprehensive lesser cache contents of temperature in the tail of the queue of the cache contents queue,
Until the cache contents in the cache contents queue size be less than second threshold, then stop to the cache contents queue into
Row is eliminated, and the second threshold is less than or equal to the first threshold.
In conjunction with second aspect, in the third possible implementation of the second aspect, the CDN Edge Server is obtained
The recommendation temperature and access temperature of cache contents in cache contents queue, comprising:
The CDN Edge Server accesses situation according to the history of the cache contents in the cache contents queue and generates institute
State the access temperature of the cache contents in cache contents queue;
The CDN Edge Server receives the recommendation of the cache contents in the cache contents queue that recommender system is sent
The recommendation temperature of temperature, the cache contents in the cache contents queue is the recommender system according to the cache contents queue
In cache contents recommended case generate.
In conjunction with second aspect, second aspect the first into the third possible implementation it is any, second
In 4th kind of possible implementation of aspect, the method also includes:
The CDN Edge Server obtains the recommendation temperature and access temperature of the alternating content in alternating content queue;
The CDN Edge Server is according to the recommendation temperature of the alternating content in the alternating content queue and access temperature
Caching replacement is carried out to the alternating content queue.
In conjunction with the 4th kind of possible implementation of second aspect, in the 5th kind of possible implementation of second aspect
In, the CDN Edge Server is according to the recommendation temperature and access temperature of the alternating content in the alternating content queue to institute
It states alternating content queue and carries out caching replacement, comprising:
If the size of the alternating content in the alternating content queue is greater than or equal to third threshold value, the edge CDN
Server determination carries out the lesser alternating content of access temperature of the tail of the queue of the alternating content queue superseded;
Pushing away with the identical alternating content for accessing temperature in the CDN Edge Server alternating content queue
Temperature is recommended, eliminates in the alternating content with identical access temperature and recommends the lesser alternating content of temperature, until the time
It selects the size of the alternating content in content queue less than the 4th threshold value, then stops carrying out superseded, institute to the alternating content queue
The 4th threshold value is stated less than or equal to the third threshold value.
In conjunction with the 4th kind of possible implementation of second aspect, in the 6th kind of possible implementation of second aspect
In, the CDN Edge Server is according to the recommendation temperature and access temperature of the alternating content in the alternating content queue to institute
It states alternating content queue and carries out caching replacement, comprising:
If the size of the alternating content in the alternating content queue is greater than or equal to third threshold value, the edge CDN
Server determination carries out the lesser alternating content of access temperature of the tail of the queue of the alternating content queue superseded;
The CDN Edge Server is according to the access temperature and recommendation of alternating content in the tail of the queue of the alternating content queue
Temperature calculates the synthesis temperature of alternating content in the tail of the queue of the alternating content queue;
The synthesis temperature that the CDN Edge Server eliminates alternating content in the tail of the queue of the alternating content queue is lesser
Alternating content, until the size of the alternating content in the alternating content queue is less than the 4th threshold value, then stopping is to the candidate
Content queue carry out it is superseded, the 4th threshold value be less than or equal to the third threshold value.
In conjunction with the 4th kind of possible implementation of second aspect, in the 7th kind of possible implementation of second aspect
In, the CDN Edge Server obtains the recommendation temperature and access temperature of the alternating content in alternating content queue, comprising:
The CDN Edge Server accesses situation according to the history of the alternating content in the alternating content queue and generates institute
State the access temperature of the alternating content in alternating content queue;
The recommender system receives the recommendation temperature for the alternating content that recommender system is sent, and the alternating content pushes away
Recommending temperature is that the recommender system is generated according to the recommended case of the alternating content.
Third aspect present invention provides a kind of buffer replacing method of Web content, comprising:
The Edge Server of CDN receives the content acquisition request that client is sent, include in the content acquisition request to
Access the identification information of content;
The CDN Edge Server according to the identification information of the content to be visited determine the content to be visited whether
In the cache contents queue of oneself;
If the content to be visited, in the cache contents queue, the CDN Edge Server is to the client
Return to the content to be visited;
The CDN Edge Server updates the access temperature of the content to be visited, and according to the content to be visited
Access temperature and recommendation temperature calculate the temperature information of the content to be visited, more according to the temperature information of the content to be visited
The new cache contents queue;
When needing to carry out the cache contents queue caching replacement, the CDN Edge Server is according to the caching
The temperature information of cache contents in content queue eliminates the lesser cache contents of temperature in the cache contents queue.
In conjunction with the third aspect, in the first possible implementation of the third aspect, if the mark of the content to be visited
Information is known not in the cache contents queue, and the CDN Edge Server is true according to the identification information of the content to be visited
Whether the fixed content to be visited is in the alternating content queue of the CDN Edge Server;
If the content to be visited, in the alternating content queue, the CDN Edge Server updates described wait visit
The access temperature for asking content determines the heat of the content to be visited according to the access temperature of the content to be visited and recommendation temperature
Spend information;
The CDN Edge Server judges the temperature of the content to be visited according to the temperature information of the content to be visited
Whether preset heat degree threshold is greater than;
If the temperature of the content to be visited is greater than the heat degree threshold, the CDN Edge Server is by described wait visit
It asks that content is added in the cache contents queue, and deletes the content to be visited from the alternating content queue;
The CDN Edge Server return to the content server to be visited to the client where original server
IP address.
In conjunction with the third aspect, in the second possible implementation of the third aspect, if the content to be visited does not exist
In the alternating content queue, the content to be visited is added in the alternating content queue by the CDN Edge Server;
The CDN Edge Server updates the access temperature of the content to be visited, according to the heat of the content to be visited
The recommendation temperature of degree and the content to be visited determines the temperature information of the content to be visited, according to the content to be visited
Alternating content queue described in temperature information update;
The CDN Edge Server return to the content server to be visited to the client where original server
IP address.
In conjunction with the third aspect, in the third possible implementation of the third aspect, if the heat of the content to be visited
Degree is less than or equal to the heat degree threshold, then the CDN Edge Server is according to the temperature information update of the content to be visited
The alternating content queue;
The CDN Edge Server return to the content server to be visited to the client where original server
IP address.
In conjunction with the first of the third aspect and the third aspect to the third possible realization, the 4th of the third aspect the
In the possible implementation of kind, the method also includes:
When needing to carry out the alternating content queue caching replacement, the CDN Edge Server is according to the candidate
The temperature information of alternating content in content queue eliminates the lesser alternating content of temperature in the alternating content queue.
Fourth aspect present invention provides a kind of recommender system, comprising:
Receiving module, the mark of the cache contents in cache contents queue sent for reception content distribution network CDN,
The information that the cache contents are obtained according to the mark of the cache contents and all content library, by the mark of the cache contents
It is added to cache contents library with the information of the cache contents;
Recommending module, when for receiving the recommendation request message of client transmission when the recommender system, according to preparatory
The user interest profile of acquisition and all content library, are calculated the first recommendation results using the first proposed algorithm;
The recommending module is also used to obtain the second recommendation results according to the cache contents library;
Fusion Module, for according to preset blending algorithm to first recommendation results and second recommendation results into
Row fusion, obtains target recommendation results;
Sending module, for the target recommendation results to be pushed to target user.
In conjunction with fourth aspect, in the first possible implementation of the fourth aspect, the recommending module is according to
Cache contents library obtains the second recommendation results, specifically:
According to the user interest profile and the cache contents library, described second is calculated using the second proposed algorithm
Recommendation results.
In conjunction with fourth aspect, in the second possible implementation of the fourth aspect, the recommending module is according to
Cache contents library obtains the second recommendation results, specifically:
The recommendation for belonging to the cache contents library from first recommendation results selection, by selected recommendation
As second recommendation results.
The first in conjunction with fourth aspect, fourth aspect is any into second of possible implementation,
In the third possible implementation of four aspects, the Fusion Module is specifically used for:
Determine recommendation common in first recommendation results and second recommendation results;
The common recommendation is deleted from first recommendation results, obtains third recommendation results;
According to the score of recommendation, unite to the recommendation in second recommendation results and the third recommendation results
One is ranked up;
Using the recommendation after sequence as the target recommendation results, alternatively, according to preset algorithm from the sequence
Selected section recommendation is as the target recommendation results in recommendation afterwards.
The first in conjunction with fourth aspect, fourth aspect is any into second of possible implementation,
In 4th kind of possible implementation of four aspects, the Fusion Module is specifically used for:
Determine recommendation common in first recommendation results and second recommendation results;
The common recommendation is deleted from first recommendation results, obtains third recommendation results;
A%*k recommendation is selected from the third recommendation results, wherein k is to wrap in the target recommendation results
The number of the recommendation included, a are more than or equal to 0 and are less than or equal to 100;
(1-a%) * k recommendation is selected from second recommendation results;
According to the score of recommendation, pushed away to the recommendation selected from the third recommendation results and from described second
It recommends the recommendation selected in result and carries out unified sequence, the recommendation after unified sequence is recommended to tie as the target
Fruit.
In conjunction with the 4th kind of possible implementation of fourth aspect, in the 5th kind of possible implementation of fourth aspect
In, the Fusion Module selects a%*k recommendation from the third recommendation results, specifically:
The recommendation in the third recommendation results is ranked up according to the score of recommendation, from the institute after sequence
State the preceding a%*k recommendation of selected and sorted in third recommendation results;
The Fusion Module selects (1-a%) * k recommendation from second recommendation results, specifically:
The recommendation in second recommendation results is ranked up according to the score of recommendation, from the institute after sequence
State preceding (1-a%) the * k recommendation of selected and sorted in the second recommendation results.
The third in conjunction with fourth aspect is any into the 5th kind of possible implementation, the of fourth aspect
In six kinds of possible implementations, the Fusion Module deleted from first recommendation results common recommendation it
Afterwards, it is also used to:
Improve the score for the common recommendation for including in second recommendation results.
The first in conjunction with fourth aspect, fourth aspect is any into second of possible implementation,
In 7th kind of possible implementation of four aspects, the Fusion Module is specifically used for:
Determine recommendation common in first recommendation results and second recommendation results;
The common recommendation is deleted from second recommendation results, obtains the 4th recommendation results;
According to the score of recommendation, unite to the recommendation in first recommendation results and the 4th recommendation results
One is ranked up;
Using the recommendation after sequence as the target recommendation results, alternatively, according to preset algorithm from the sequence
Selected section recommendation is as the target recommendation results in recommendation afterwards.
The first in conjunction with fourth aspect, fourth aspect is any into second of possible implementation,
In 8th kind of possible implementation of four aspects, the Fusion Module is specifically used for:
Determine recommendation common in first recommendation results and second recommendation results;
The common recommendation is deleted from second recommendation results, obtains the 4th recommendation results;
A%*k recommendation is selected from first recommendation results, wherein k is to wrap in the target recommendation results
The number of the recommendation included, a are more than or equal to 0 and are less than or equal to 100;
(1-a%) * k recommendation is selected from the 4th recommendation results;
According to the score of recommendation, pushed away to the recommendation selected from first recommendation results and from the described 4th
It recommends the recommendation selected in result and carries out unified sequence, and the recommendation after unified sequence is recommended to tie as the target
Fruit.
In conjunction with the 8th kind of possible implementation of fourth aspect, in the 9th kind of possible implementation of fourth aspect
In, the Fusion Module selects a%*k recommendation from first recommendation results, specifically:
The recommendation in first recommendation results is ranked up according to the score of recommendation, from the institute after sequence
State the preceding a%*k recommendation of selected and sorted in the first recommendation results;
The Fusion Module selects (1-a%) * k recommendation from the 4th recommendation results, specifically:
The recommendation in the 4th recommendation results is ranked up according to the score of recommendation, from the institute after sequence
State selection (1-a%) * k recommendation in the 4th recommendation results.
In conjunction with fourth aspect the 7th kind to the 9th kind possible implementation in it is any, the of fourth aspect
In ten kinds of possible implementations, the Fusion Module deleted from second recommendation results common recommendation it
Afterwards, it is also used to:
Improve the score for the common recommendation for including in first recommendation results.
The first in conjunction with fourth aspect, fourth aspect is any into second of possible implementation,
In a kind of possible implementation of the tenth of four aspects, the recommender system further include:
Recommend temperature generation module, recommends for being generated according to the recommended case of all content in all content library
Temperature library, it is described to recommend to include the recommendation temperature of all content within a preset time in all content library in temperature library;
The sending module is also used to that all the elements in temperature library will be recommended to be sent to the CDN.
In conjunction with a kind of the tenth possible implementation of fourth aspect, in the 12nd kind of possible realization side of fourth aspect
In formula, the Fusion Module melts first recommendation results and second recommendation results according to preset blending algorithm
It closes, after obtaining target recommendation results, the recommendation temperature generation module is also used to:
The recommendation temperature library is updated according to the target recommendation results.
The first in conjunction with fourth aspect, fourth aspect is any into the 12nd kind of possible implementation,
In 13rd kind of possible implementation of fourth aspect, the cache contents that the CDN is sent are the cache contents queue
The content of preceding P%, alternatively, for the incremental number of content that sent relative to last time of content of the preceding P% of the cache contents queue
According to, wherein P is greater than 0 less than 100.
Fifth aspect present invention provides a kind of content distributing network CDN Edge Server, comprising:
Module is obtained, for obtaining the recommendation temperature and access temperature of the cache contents in cache contents queue;
Replacement module is cached, for the access temperature and recommendation temperature according to the cache contents in the cache contents queue
Caching replacement is carried out to the cache contents queue.
In conjunction with the 5th aspect, in the first possible implementation of the 5th aspect, the caching replacement module is specific
For:
If the size of the cache contents in the cache contents queue is greater than or equal to first threshold, it is determined that described slow
Deposit content queue tail of the queue access the lesser cache contents of temperature carry out it is superseded;
The tail of the queue for comparing the cache contents queue has the recommendation temperature of the identical cache contents for accessing temperature, eliminates institute
It states in the cache contents with identical access temperature and recommends the lesser cache contents of temperature, until in the cache contents queue
The size of cache contents is less than second threshold, then stopping carries out the cache contents queue superseded, and the second threshold is less than
Or it is equal to the first threshold.
In conjunction with the 5th aspect, in second of possible implementation of the 5th aspect, the caching replacement module is specific
For:
If the size of the cache contents in the cache contents queue is greater than or equal to first threshold, it is determined that described slow
Deposit the tail of the queue of content queue the lesser cache contents of access temperature carry out it is superseded;
According to the access temperature of the cache contents of the tail of the queue of the cache contents queue and recommend temperature, calculates the caching
The synthesis temperature of cache contents in the tail of the queue of content queue;
The comprehensive lesser cache contents of temperature in the tail of the queue of the cache contents queue are eliminated, until the cache contents team
The size of cache contents in column is less than second threshold, then stops carrying out the cache contents queue superseded, second threshold
Value is less than or equal to the first threshold.
In conjunction with the 5th aspect, in the third possible implementation of the 5th aspect, the acquisition module is specifically used for:
Situation is accessed according to the history of the cache contents in the cache contents queue to generate in the cache contents queue
Cache contents access temperature;
Receive the recommendation temperature of the cache contents in the cache contents queue that recommender system is sent, the cache contents
The recommendation temperature of cache contents in queue is the recommender system pushing away according to the cache contents in the cache contents queue
Recommend situation generation.
In conjunction with the 5th aspect, the 5th aspect the first into the third possible implementation it is any, the 5th
In 4th kind of possible implementation of aspect, the acquisition module is also used to:
Obtain the recommendation temperature and access temperature of the alternating content in alternating content queue;
The caching replacement module, is also used to: according to the recommendation temperature of the alternating content in the alternating content queue and
Access temperature carries out caching replacement to the alternating content queue.
In conjunction with the 4th kind of possible implementation of the 5th aspect, in the 5th kind of possible implementation of the 5th aspect
In, the caching replacement module is specifically used for:
If the size of the alternating content in the alternating content queue is greater than or equal to third threshold value, it is determined that the time
The lesser alternating content of access temperature of the tail of the queue of content queue is selected to carry out superseded;
The recommendation temperature for comparing the alternating content with identical access temperature in the alternating content queue, eliminates the tool
Recommend the lesser alternating content of temperature, the candidate in the alternating content queue in the alternating content for having identical access temperature
The size of content is less than the 4th threshold value, then stopping carries out the alternating content queue superseded, and the 4th threshold value is less than or waits
In the third threshold value.
In conjunction with the 4th kind of possible implementation of the 5th aspect, in the 6th kind of possible implementation of the 5th aspect
In, the caching replacement module is specifically used for:
If the size of the alternating content in the alternating content queue is greater than or equal to third threshold value, it is determined that the time
The lesser alternating content of access temperature of the tail of the queue of content queue is selected to carry out superseded;
According to the access temperature of alternating content in the tail of the queue of the alternating content queue and recommend temperature, calculates the candidate
The synthesis temperature of alternating content in the tail of the queue of content queue;
The lesser alternating content of synthesis temperature for eliminating alternating content in the tail of the queue of the alternating content queue, until described
The size of alternating content in alternating content queue is less than the 4th threshold value, then stopping carries out the alternating content queue superseded,
4th threshold value is less than or equal to the third threshold value.
In conjunction with the 4th kind of possible implementation of the 5th aspect, in the 7th kind of possible implementation of the 5th aspect
In, the acquisition module is specifically used for:
Situation is accessed according to the history of the alternating content in the alternating content queue to generate in the alternating content queue
Alternating content access temperature;
The recommendation temperature for the alternating content that recommender system is sent is received, the recommendation temperature of the alternating content is described
Recommender system is generated according to the recommended case of the alternating content.
Sixth aspect present invention provides the Edge Server of content distributing network CDN a kind of, comprising:
Receiving module includes wait visit in the content acquisition request for receiving the content acquisition request of client transmission
Ask the identification information of content;
Processing module, for determining the content to be visited whether at oneself according to the identification information of the content to be visited
Cache contents queue in, if the content to be visited in the cache contents queue, to the client return described in
Content to be visited;
Update module, for updating the access temperature of the content to be visited, and according to the access of the content to be visited
Temperature and recommendation temperature calculate the temperature information of the content to be visited, according to the temperature information update institute of the content to be visited
State cache contents queue;
Cache replacement module, for when need to the cache contents queue carry out caching replacement when, according to the caching
The temperature information of cache contents in content queue eliminates the lesser cache contents of temperature in the cache contents queue.
In conjunction with the 6th aspect, in the first possible implementation of the 6th aspect, if the mark of the content to be visited
Information is known not in the cache contents queue, and the processing module is also used to:
Determine the content to be visited whether in the CDN Edge Server according to the identification information of the content to be visited
Alternating content queue in;
If the content to be visited in the alternating content queue, updates the access temperature of the content to be visited,
The temperature information of the content to be visited is determined according to the access temperature of the content to be visited and recommendation temperature;
Judge whether the temperature of the content to be visited is greater than preset heat according to the temperature information of the content to be visited
Spend threshold value;
If the temperature of the content to be visited is greater than the heat degree threshold, the content to be visited is added to described slow
It deposits in content queue, and deletes the content to be visited from the alternating content queue;
The IP address of original server where returning to from the content server to be visited to the client.
In conjunction with the 6th aspect, in second of possible implementation of the 6th aspect, if the content to be visited does not exist
In the alternating content queue, the processing module is also used to:
The content to be visited is added in the alternating content queue;
The access temperature for updating the content to be visited, according to the temperature of the content to be visited and the content to be visited
Recommendation temperature determine the temperature information of the content to be visited, waited according to the temperature information update of the content to be visited
Select content queue;
The IP address of original server where returning to from the content server to be visited to the client.
In conjunction with the 6th aspect, in the third possible implementation of the 6th aspect, if the heat of the content to be visited
Degree is less than or equal to the heat degree threshold, then the processing module is also used to:
According to alternating content queue described in the temperature information update of the content to be visited;
The IP address of original server where returning to from the content server to be visited to the client.
In conjunction with the first of the 6th aspect and the 6th aspect to the third possible realization, the 4th of the 6th aspect the
In the possible implementation of kind, the caching replacement module is also used to:
When needing to carry out the alternating content queue caching replacement, according to alternating content in the alternating content queue
Temperature information, eliminate the lesser alternating content of temperature in the alternating content queue.
Recommendation, buffer replacing method and the equipment of Web content provided in an embodiment of the present invention, CDN is by recommender system
The mark of the cache contents in cache contents queue is sent, so that recommender system is when to user's recommendation, can be sent out according to CDN
The cache contents sent generate recommendation results, so that it is guaranteed that recommender system recommends the recommendation results of user as far as possible CDN's
In cache contents queue, when the recommendation that user includes into CDN request recommendation results, CDN can be from cache contents team
The content that user's request is got in column obtains without the original server where the content requested from user, reduces
The time that user waits, and the occupancy for returning source bandwidth of CDN can be reduced.Recommender system can also generate complete according to recommendation results
The recommendation temperature held in vivo, and the recommendation temperature of all content is sent to CDN, in order to which CDN is examined when carrying out caching replacement
Consider and recommend temperature, so that the high content of recommendation temperature is retained in the buffer as much as possible, obtains user faster
The content that recommender system is recommended.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Currently, many network application systems include simultaneously two parts CDN and recommender system, such as network protocol television
(Internet Protocol Television, abbreviation IPTV), video on demand (Video On Demand, abbreviation VoD), view
Frequency website (such as Netflix, YouTube, youku.com and LeEco), the website e-commerce (Electronic Commerce) are (as washed in a pan
Precious, Jingdone district and Amazon etc.), mobile applications and betting-shops (the App Store of such as Apple Inc.).
Recommender system can be divided into three classes according to proposed algorithm: content-based recommendation system, the recommendation system based on collaboration
System and mixed recommendation system.Content-based recommendation system obtains the feature vector of user interest profile vector sum content, passes through
Calculating the similitude between the feature vector of user interest profile vector sum content is that user recommends article.Recommendation based on collaboration
System is recommended independent of to user and content itself, but the article bought based on other users is pushed away for target user
Recommend article.Mixed recommendation system can be integrated using content-based recommendation method and based on the recommended method of collaboration.In general,
The purpose of recommendation is exactly to select in the content library of magnanimity to the most useful article of user and be presented to user, to avoid user
It gets lost among selection of numerous names, saves the time of user, and improve the depth of exposure of end article.It needs to illustrate
It is that the content mentioned in following embodiment is also referred to as Web content, Web content specifically can be video, music, commodity, application
(APP), game etc..
CDN includes multiple network clusters, and the network cluster that CDN includes can be divided into center cluster and edge cluster, center
Cluster includes one or more CDN central server, and edge cluster includes one or more CDN Edge Server.Center cluster
The all-network content for needing to distribute can be generally cached, and edge cluster only caches one of the Web content for needing to distribute
Point.When user accesses a certain content, user passes through client to domain name system (Domain Name System, abbreviation DNS)
Address resolution request is sent, DNS can be assigned to the access of user on the edge cluster nearest from user, if the edge cluster
It is stored with the content that user is accessed, then being stored with the CDN Edge Server for the content that user is accessed in the edge cluster
The content that user requests can be directly returned to user.If user access edge cluster do not store user accessed it is interior
Hold, then edge cluster just obtains the access content to the original server where access content, then returns again to user.?
Under latter situation, for a user, user generally requires the response for waiting the long period that could obtain edge cluster, influences
User experience, for operator, the original server where CDN from access content obtains access content, can occupy Hui Yuan
Bandwidth leads to network resources waste, returns the bandwidth of source bandwidth, that is, between CDN and the original server of content.
By taking video recommendations as an example, Fig. 1 is a kind of schematic diagram of existing video recommendations process, as shown in Figure 1, video recommendations
Process may include steps of:
Step 101, client send video recommendations request message to web page server (Web Server).
In video recommendations, client is specifically as follows browser or player, which is generally triggered by user, example
Such as, it is used to open youku.com's player, the movie option in click play device homepage, youku.com's player will be from trend web service
Device sends video recommendations request message.
Step 102, web page server send inquiry request message to recommender system.
Inquiry request receives the video recommendations request of web page server transmission for obtaining inquiry recommendation list, recommender system
Message afterwards obtains user interest profile, is pushed away from video content library according to preset proposed algorithm and user interest profile
Recommend result.Wherein, user interest profile is mainly generated according to following two information: a kind of information is user in log-on webpage service
The information provided when device, comprising: gender, age, region, educational background, personal interest of user etc., another information are going through for user
History access record.Recommender system can be located in the same hardware device with web page server, can also be located at individual hardware
In equipment.
Step 103, recommender system return to video recommendations list to web page server.
Recommender system after getting recommendation results, can according to the score of video to the video for including in recommendation results into
Row sequence obtains video recommendations list, and video recommendations list is returned to web page server.
Step 104, web page server return to video recommendations list to client.
Step 105, client request some video content to CDN Edge Server.
The operation is usually some video triggering clicked in (or viewing) video recommendations list by user.
Step 106, CDN Edge Server return to the video content of request to client.
The video of client request may be buffered in CDN Edge Server, it is also possible to not be buffered in CDN edge service
In device, when the video of client request is on CDN Edge Server, CDN Edge Server is directly by the view of client request
It takes place frequently and gives client, if the video of client request, not on CDN Edge Server, CDN Edge Server can be to the video
The original server at place requests the video, and by the video cache in CDN Edge Server, then, CDN Edge Server exists
The video is returned to client.
By above-mentioned example it is found that CDN needs Hui Yuan to obtain when recommender system content recommended to the user is not in CDN
Web content is taken, CDN, which returns source acquisition Web content, will lead to period of reservation of number is long, occupies CDN times source bandwidth etc..
In order to solve problems in the prior art, the embodiment of the present invention one provides a kind of recommended method of Web content, recommends
System can consider the content cached in CDN when to user's recommendation, guarantee content storage recommended to the user as far as possible
In CDN.Fig. 2 is the flow chart of the recommended method for the Web content that the embodiment of the present invention one provides, as shown in Fig. 2, this implementation
The method that example provides may comprise steps of:
Step 201, recommender system receive the mark of the cache contents in the cache contents queue that CDN is sent, according to caching
The mark of content and all content library obtain the information of cache contents, and the mark of cache contents and the information of cache contents are added
To cache contents library.
CDN sends the mark of the cache contents stored in cache contents queue under the triggering of trigger signal to recommender system
Know, the mark of cache contents can be uniform resource locator (the uniform/universal resource of cache contents
The cryptographic Hash (HASH) of the url of locator, abbreviation url or cache contents.The cache contents queue of CDN exists for memory buffers
Cache contents in CDN when CDN sends the mark of cache contents to recommender system, can will own in cache contents queue
The mark of cache contents is all sent to recommender system, can also only send the part cache contents in buffer queue.Mainly because
It is according to the tactic of temperature, in the caching that comes cache contents queue for, cache contents in CDN cache contents queue
Hold when cache contents capacity of queue Man Shihui is eliminated out cache contents queue, if recommender system is by can in cache contents queue
The cache contents that can be eliminated have been sent to recommender system, and the cache contents have been recommended user by recommender system, when with
When family accesses the cache contents, which may be eliminated, and at this moment, CDN is still needed into the storage caching
The original server of appearance obtains the cache contents.
The cache contents in cache contents queue recommended in order to ensure recommender system are still located at when user accesses
In cache contents queue, in the present embodiment, the content that the cache contents that CDN is sent are the preceding P% of cache contents queue, alternatively,
The incremental data of the content sent relative to last time for the content of the preceding P% of cache contents queue, wherein, P is to be less than greater than 0
100。
After recommender system receives the mark of cache contents, cache contents are generated according to cache contents mark and all content library
Library includes the information of all the elements in recommender system in all content library: the information of each content include: the mark of content,
The metadata of content, content grading information, by taking video content as an example, the metadata of video content includes the attribute mark of content
Label, the attribute tags of content include title, author, performer, style, shooting time etc., by taking content of good as an example, content of good
Attribute tags include product name, price, retail shop's title, color, style etc..CDN only sends cache contents to recommender system
After mark, recommender system finds the information of cache contents according to the mark of cache contents from all content library, by cache contents
Information and the marks of cache contents be added to cache contents library, cache contents library is a subset in all content library.
Step 202, when recommender system receives the recommendation request message of client transmission, recommender system according to obtaining in advance
The first recommendation results are calculated using the first proposed algorithm in the user interest profile taken and all content library.
All recommendations belong to all content library in first recommendation results, and in recommendation process, recommender system can root
The feature that all content library is generated according to all content library generates first according to the feature in user interest profile and all content library and pushes away
Recommend result.
Step 203, recommender system obtain the second recommendation results according to cache contents library.
In a kind of implementation, recommender system is recommended according to user interest profile and the cache contents library using second
Two recommendation results are calculated in algorithm.In another implementation, recommender system belongs in caching from the selection of the first recommendation results
The recommendation of Rong Ku, using selected recommendation as the second recommendation results.In former implementation, recommender system
The feature that cache contents library can be generated according to cache contents library generates the according to the feature of user interest profile and caching content library
Two recommendation results.In latter implementation, which recommendation category is recommender system determine first from the first recommendation results
In cache contents library, then, the recommendation for belonging to cache contents library is obtained from the first recommendation results, by selected recommendation
Content is as the second recommendation results.
In the present embodiment and following embodiments, the feature and caching of the user interest profile, all content library mentioned
The feature of content library all refers to feature vector.
In the present embodiment, the first proposed algorithm and the second proposed algorithm may each comprise one or more proposed algorithms, push away
Recommending algorithm can be using any one existing algorithm, for example, the algorithm based on content, the algorithm based on collaboration, being based on content
With the hybrid algorithm of collaboration.And in the present embodiment, the first proposed algorithm and the second proposed algorithm can be the same or different.
In the present embodiment, the first recommendation results and the second recommendation results include at least one recommendation, and first recommends
As a result it can be indicated in the form of a list with the second recommendation results.It should be noted that step 202 and step 203 are when being executed simultaneously
There is no sequencing, may be performed simultaneously yet.
Step 204, recommender system melt the first recommendation results and the second recommendation results according to preset blending algorithm
It closes, obtains target recommendation results.
The first recommendation results and the second recommendation results can specifically be merged by following several modes:
First way, firstly, recommender system determines in recommendation common in the first recommendation results and the second recommendation results
Hold.Secondly, recommender system deletes common recommendation from the first recommendation results, third recommendation results are obtained;Then, recommend
System is uniformly ranked up the recommendation in the second recommendation results and third recommendation results according to the score of recommendation;
Finally, recommender system is using the recommendation after sequence as target recommendation results, alternatively, recommender system according to preset algorithm from
Selected section recommendation is as target recommendation results in recommendation after sequence, for example, recommender system needs to return altogether K
Recommendation, then the preceding K content of recommender system selected and sorted from the recommendation after sequence is as target recommendation results.
It include multiple recommendations in first recommendation results and the second recommendation results, include pushes away in the first recommendation results
Recommending the recommendation for including in content and the second recommendation results, to might have part identical, and recommender system is recommended by comparing first
As a result recommendation common in the two is determined with the second recommendation results.
The second way, firstly, recommender system determines in recommendation common in the first recommendation results and the second recommendation results
Hold, the common recommendation is deleted from the first recommendation results, obtains third recommendation results.Secondly, recommender system is from
A%*k recommendation is selected in three recommendation results, wherein K is the number for the recommendation for including, a in target recommendation results
It is less than or equal to 100 more than or equal to 0, (1-a%) * k recommendation is selected from the second recommendation results.Finally, recommender system root
According to the score of recommendation, to from the recommendation selected in third recommendation results and the recommendation selected from the second recommendation results
Content carries out unified sequence, using the recommendation after unified sequence as target recommendation results.
Recommender system selects a%*k recommendation to be specifically as follows from third recommendation results: recommender system is according to pushing away
The score for recommending content is ranked up the recommendation in third recommendation results, the row of selection from the third recommendation results after sequence
The preceding a%*k recommendation of sequence, the preceding a%*k recommendation that sort is the higher recommendation of score, alternatively, pushing away
It recommends system and selects a%*k recommendation from the third recommendation results after sequence according to preset principle (for example, equal proportion principle)
Content.It similarly, can also be according in recommendation when recommender system selects (1-a%) * k recommendation from the second recommendation results
The score of appearance is ranked up the recommendation of the second recommendation results, and selected and sorted is preceding from the second recommendation results after sequence
(1-a%) * k recommendation, alternatively, recommender system is selected from the second recommendation results after sequence according to preset principle
(1-a%) * k recommendation.Certainly, recommender system is selecting recommendation from third recommendation results and the second recommendation results
When can not also sort, or be ranked up according to other parameters, the embodiment of the present invention is limited not to this.
Optionally, in first way and the second way, recommender system is deleted common from the first recommendation results
After recommendation, recommender system improves the score for the common recommendation for including in the second recommendation results, correspondingly, recommending
System when being sorted according to score to the recommendation in the second recommendation results, is ranked up according to the score after raising.
The third mode, firstly, recommender system determines in recommendation common in the first recommendation results and the second recommendation results
Hold;Secondly, recommender system deletes common recommendation from the second recommendation results, the 4th recommendation results are obtained;Then, recommend
System is uniformly ranked up the recommendation in the first recommendation results and the 4th recommendation results according to the score of recommendation;
Finally, recommender system is using the recommendation after sequence as target recommendation results, alternatively, recommender system according to preset algorithm from
Selected section recommendation is as target recommendation results in recommendation after sequence.
4th kind of mode, firstly, recommender system determines in recommendation common in the first recommendation results and the second recommendation results
Hold, common recommendation is deleted from the second recommendation results, obtains the 4th recommendation results;Then, recommender system is pushed away from first
Selection (1-a%) * k recommendation in result is recommended, (1-a%) * k recommendation is selected from the 4th recommendation results;Finally,
Recommender system is according to the score of recommendation, to from the recommendation selected in the first recommendation results and from the 4th recommendation results
The recommendation of selection carries out unified sequence, and using the recommendation after unified sequence as target recommendation results.
Wherein, recommender system selects (1-a%) * k recommendation from the first recommendation results, specifically: recommender system
The recommendation in the first recommendation results is ranked up according to the score of recommendation, from the first recommendation results after sequence
The preceding a%*k recommendation of selected and sorted;Alternatively, recommender system recommends to tie according to preset principle from first after sequence
A%*k recommendation is selected in fruit.Similarly, recommender system selects (1-a%) * k recommendation from the 4th recommendation results
When, the recommendation in the 4th recommendation results can also be ranked up according to the score of recommendation, from the 4th after sequence
(1-a%) * k recommendation is selected in recommendation results, alternatively, according to preset principle from the 4th recommendation results after sequence
Select (1-a%) * k recommendation.Certainly, recommender system is selecting to recommend from the first recommendation results and the 4th recommendation results
It can not also sort when content, or be ranked up according to other parameters, the embodiment of the present invention is limited not to this.
Optionally, in the third mode and the 4th kind of mode, recommender system is deleted common from the second recommendation results
After recommendation, recommender system improves the score for the common recommendation for including in the first recommendation results, correspondingly, recommending
System when being sorted according to score to the recommendation in the first recommendation results, is ranked up according to the score after raising.
Target recommendation results are pushed to target user by step 205, recommender system.
In the present embodiment, the mark of the cache contents in cache contents queue of the recommender system by receiving CDN transmission, root
Cache contents library is generated according to the mark of cache contents and all content library, it is subsequent when recommender system receives pushing away for client transmission
When recommending request message, not only according to user interest profile and preset proposed algorithm, first is obtained from all content library and is recommended
As a result, the second recommendation results are obtained from caching content library, then, according to pre- also according to user interest profile and proposed algorithm
If blending algorithm the first recommendation results and the second recommendation results are merged, target recommendation results are obtained, finally, by target
Recommendation results are pushed to target user.In the method, all recommendations in the second recommendation results are all in the caching of CDN
Hold in queue, so that it is guaranteed that recommender system recommends the recommendation results of user as far as possible in the cache contents queue of CDN, when
When the recommendation that user includes into CDN request recommendation results, CDN can get user's request from caching content queue
Content, obtained without the original server where the content requested from user, reduce the time of user's waiting, and
The occupancy for returning source bandwidth of CDN can be reduced.
The method of embodiment one will be described in detail by several specific embodiments below.
The embodiment of the present invention two illustrates how CDN sends cache contents in cache contents queues to recommender system
Mark, Fig. 3 is the structural schematic diagram of CDN provided by Embodiment 2 of the present invention and recommender system, as shown in figure 3, recommender system packet
Include: cache contents queue receiver, cache contents library, recommendation results, all content recommend temperature library, recommend temperature transmitter,
Push trigger.CDN includes: to recommend temperature receiver, recommend temperature list, push trigger, cache contents queue transmitter
With caching content queue.The mark of cache contents in the cache contents queue of CDN CDN push trigger control under, by
Cache contents queue transmitter is sent to the cache contents queue receiver of recommender system, and recommender system is according to cache contents queue
The mark for the cache contents that receiver receives and all content library (being not shown in Fig. 3) obtain the information of cache contents, will delay
The information of the mark and cache contents of depositing content is added to cache contents library, and recommender system can establish multiple cache contents libraries.
In the embodiment of the present invention, in order to further ensure recommender system recommends caching of the recommendation results in CDN of user
In content queue, recommender system is also used to generate the recommendation temperature of all content in all content library according to recommendation results, entirely
The recommendation temperature held in vivo is stored in all content and recommends to recommend heat under the control of the push trigger of recommender system in temperature library
All content is recommended the data in temperature library to be sent to the recommendation temperature receiver of CDN by degree transmitter, recommends temperature receiver
The recommendation temperature of all content received is stored in and is recommended in temperature list.Pushing away for content is introduced in the embodiment of the present invention
Temperature is recommended, the recommendation temperature of content indicates a possibility that content future is accessed, and the bigger expression content of the recommendation temperature of content is not
Come bigger a possibility that being accessed, temperature is recommended to be specifically as follows the recommendation number of content.
Fig. 4 is the flow chart for the mark that CDN provided by Embodiment 2 of the present invention sends cache contents to recommender system, is such as schemed
Shown in 4, method provided in this embodiment be may comprise steps of:
Step 301, CDN push trigger to cache contents queue transmitter send trigger signal.
In the present embodiment, the push trigger of CDN can be sent out using periodic mode to cache contents queue transmitter
Trigger signal is sent, the mark of cache contents is sent to trigger cache contents queue transmitter to recommender system.Trigger signal is divided into
Two kinds, full dose trigger signal and incremental trigger signal.Cache contents queue transmitter, can handle when receiving full dose trigger signal
The cryptographic Hash of the url or url of p% cache contents (according to the recommendation granularity difference of recommender system, are delayed before all cache contents queues
The url for depositing content can be the corresponding url or url of fragment) it is sent to recommender system.Cache contents queue transmitter is receiving
When to incremental trigger signal, the content of the preceding P% of cache contents queue can be sent relative to last time the incremental data of content
Url is sent to recommender system, which is buffer queue content when the full dose data of buffer queue content and last time are sent
The different data of full dose data, which is generally much smaller than full dose data.As an example it is assumed that in the t1 moment caches
Holding the content saved in queue is that " url of these contents is sent to recommendation by a, b, c, d, e ", CDN in a manner of full dose data
System, the content saved in t2 moment cache contents queue are " b, c, d, e, f ", the at this time incremental data relative to the t1 moment
For " url of incremental data is sent to recommender system by a, f ", CDN.Recommender system is after receiving incremental data, comparison caching
" a, b, c, d, e ", discovery " a " have existed for the content information that the t1 moment saves in content library at the t1 moment, then just deleting
Fall " a ";It was found that " f " is not present at the t1 moment, then just the content of " f " is added in cache contents library.
In the present embodiment, full dose trigger signal is generated using event triggering and periodic triggers two ways.Event triggering
Refer to the trigger signal generated when the CDN bandwidth free time;Periodic triggers refer to every a cycle T0 (such as 24 hours)
The trigger signal of generation.Both modes can be used alone, and can also be used in combination, the example that the two is used in combination
Such as: event trigger signal is generated when the CND bandwidth free time;If touched within the time of cycle T 0 without generation event
It signals, then generates Periodic triggers.
Incremental trigger signal is generated using periodic mode.Under normal circumstances, the generation cycle T 1 of incremental trigger signal
It is less than the event-triggered times cycle T 0 of full dose trigger signal.Full dose triggering and incremental trigger, which can also use, to be used in combination,
Full dose triggering and incremental trigger combine can guarantee that recommender system obtains standard with lesser network flow cost to the maximum extent
The cache contents of true cache contents queue.In some cases, as content library quantity is smaller or the idle bandwidth of CDN is very abundant
In the case where, it is possible to use only full dose triggers mode.
Step 302, cache contents queue transmitter judge whether trigger signal is full dose trigger signal.
If so, i.e. trigger signal is full dose trigger signal, 303 are thened follow the steps, if it is not, i.e. trigger signal is incremental trigger
Signal thens follow the steps 304.
Step 303, CDN obtain the data of the preceding p% of cache contents queue.
CDN may have multiple cache contents queues, be usually the temperature according to cache contents in cache contents queue
Tactic, in the prior art, the temperatures of cache contents is the access temperature of cache contents, in the embodiment of the present invention, caching
The temperature of content includes the access temperature and recommendation temperature of cache contents.It is arranged in the cache contents team of cache contents queue tail
Column capacity Man Shihui is eliminated out cache contents queue.So whole cachings of cache contents queue cannot be selected in the present embodiment
Content is sent to recommender system, to avoid the content in recommendation results comprising that will be eliminated.Therefore, CDN is to recommender system
The part that preceding p% in cache contents queue is only selected when sending the data of cache contents queue, so that it is guaranteed that recommender system is pushed away
The cache contents in buffer queue content recommended user access when be still located at CDN cache contents queue in, avoid due to
Recommendation be eliminated and caused by period of reservation of number extend.Here the selection of p% can define a time interval t (such as
0.5 hour), according to the historical data that CDN is cached, calculates the content eliminated in time interval t in historical data and account for caching
The average percent q% of content queue, then p%=1-q%, or rule of thumb one percentage of selection, such as 80% or 90%,
Or p% is obtained according to the method for other parameters adjustment (as simulated using historical data).
The content saved in the cache contents queue of CDN can be multimedia object, and multimedia object can substantially divide
For two classes, one kind is video and audio biggish multimedia object in equal volume, and another kind of is picture lesser multimedia in equal volume
Object.Video and audio in equal volume biggish multimedia object the characteristics of be that an object is generally divided into multiple fragments and saves
In cache contents queue, user is accessing some video by clients such as browser or players and audio is larger in equal volume
Multimedia object when, client can to CDN send obtain related object fragment request;And the isometric lesser more matchmakers of picture
Body object is usually without fragment, and user is accessing some picture lesser multimedia object in equal volume by client
When, client can send the request for obtaining the object to CDN.Since what may be saved in the cache contents queue of CDN is object
Burst information, and saved in the cache contents library of recommender system be object information, CDN is before obtaining cache contents queue
After the fragment of p%, it is also necessary to carry out the information that parsing obtains object belonging to the fragment to these fragments.
In example as follows, " 187.204.219.57-- [09/Jul/2014:04:54:58+0000] " GET
http://sscdn.clarovideo.com/multimediav81/plataforma_vod/ISM/201301/
WMP4H01538MTSS_full/WMP4H01538MTSS_full.ism/QualityLevels(1200000)/Frag ments
(video=3563560000) HTTP/1.1 " 200 319213 "-" " Mozilla/5.0 (Windows NT 6.2;WOW64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2008.2 Safari/537.36 " "-" is to use
Family request some video and audio in equal volume the fragment of biggish multimedia object when the example of CDN log that generates,
In " http://sscdn.clarovideo.com/multimediav81/plataforma_vod/ISM/20 1301/
WMP4H01538MTSS_full/WMP4H01538MTSS_full.ism " is the url of the affiliated multimedia object of the fragment,
QualityLevels (1200000) is the code rate information of the multimedia object, and (video=3563560000) is the multimedia
The type of object and corresponding timestamp.For (such as recommending some for the recommender system of granularity using multimedia object
Video or audio), CDN needs first to parse the url of multimedia object belonging to p% fragment before cache contents queue, when some
When the fragment quantity of multimedia object is greater than certain threshold value (60% of all fragment quantity of such as multimedia object), CDN
It just will be considered that the multimedia object has been stored in CDN cache contents queue, CDN can send out the url of the multimedia object later
Give recommender system.For using fragment, for the recommender system of granularity (climax parts for such as recommending some video), CDN is not required to
The url of multimedia object corresponding to p% fragment before cache contents queue is parsed, directly the url of requested fragment is sent out
Give recommender system.
The incremental number for the content that the data that step 304, CDN obtain the preceding p% of cache contents queue were sent relative to last time
According to.
CDN after determining the data of preceding p% of cache contents queue, compare cache contents queue preceding p% data and
The content that last time sends obtains incremental data.
The data of preceding p% or the mark of incremental data for the cache contents queue that step 305, CDN will acquire are sent to
Recommender system.
It should be noted that the url general data volume of multimedia object is larger, can be just sent to after being compressed
Recommender system, for example, the cryptographic Hash of url is sent to recommender system after the url of multimedia object is carried out Hash operation.
Step 306, recommender system obtain cache contents according to the mark of the cache contents received and all content library
The information of cache contents is added to cache contents library by information.
The specific implementation of this step can refer to the associated description of embodiment one, and which is not described herein again.
In the present embodiment, CDN is by by the mark of the cache contents of the preceding P% of cache contents queue, alternatively, will be in caching
The mark for holding the incremental data of the cache contents of the preceding P% of queue is sent to recommender system, to guarantee what recommender system was recommended
User's recommendation results are still in the cache contents queue of CDN, and subsequent when user accesses recommendation results, CDN can be out of caching
Hold the content for returning to request in queue to user, to reduce the time of user's waiting.
Fig. 5 is the process for the recommendation temperature that the recommender system that the embodiment of the present invention three provides sends all content library to CDN
Figure, may comprise steps of with Fig. 5, method provided in this embodiment referring to figure 3.:
Step 401, recommender system push trigger to recommend temperature transmitter send trigger signal.
Recommender system to CDN send recommend temperature information be push trigger control under carry out, recommender system to
CDN is sent when recommending temperature by the way of full dose transmission.Trigger signal also uses event triggering and two kinds of sides of periodic triggers
Formula generates, and event triggers for example are as follows: push trigger generates trigger signal when network idle bandwidth is larger, periodically touches
Hair is for example are as follows: push trigger generates trigger signal with a fixed cycle T.The selection of T can be empirically determined, and such as 1
Hour.The two triggering mode is used alone, and can also be applied in combination.A kind of example that the two is applied in combination is, with event
Based on trigger signal, if generating Periodic triggers without generation event trigger signal within the time of cycle T.
Step 402 recommends temperature transmitter that the recommendation temperature in all content library in recommendation temperature library is sent to CDN's
Recommend temperature receiver.
Recommend temperature transmitter before the recommendation temperature for sending all content, recommender system can also be according to all content library
In all content recommended case generate recommend temperature library, recommend temperature library in include all content library in all content exist
Recommendation temperature in preset time.
In the present embodiment, the recommendation temperature of all content is sent to CDN by recommender system, the purpose for the arrangement is that making CDN
When carrying out superseded to the tail portion content of cache contents queue, the access temperature of content is not only considered, it is also considered that the recommendation of content
Temperature, so that access temperature is small at present, but the following content being more likely accessed is not easy to eliminate cache contents team
Column.When what is stored in cache contents queue is the fragment of some object, the recommendation temperature of the fragment can be pair belonging to it
The recommendation temperature of elephant is also possible to the recommendation being weighted the location of in affiliated object according to fragment heat
Degree, for example, the fragment weight value for being located at object header is 0.8, the weight value of intermediate climax parts is 1.0, the power of tail portion
Refetching value is 0.7, and when calculating the recommendation temperature of fragment, the recommendation temperature of the object belonging to fragment is obtained multiplied by the weight of fragment
To the recommendation temperature of fragment.
It should be noted that recommend temperature that there is very strong timeliness, so, for calculating the time for recommending temperature
Window W can not be too big, determine the method for the time window size first is that being obtained using empirical value, such as 12 hours.Recommend heat
Degree can be to recommend the number that content is recommended in time window, which can use a byte representation, a byte
It can at most indicate that content is recommending to be recommended 2^8=1024 times in time window, recommend temperature that can also use less ratio
Special position indicates, for example, by using nybble, nybble can at most indicate that content is recommending to be recommended 2 in time window
^4=16 times.In the present embodiment, it will not influence to recommend temperature to cache contents queue recommending temperature generation data to overflow
Replacement because the more content of recommended number is there is a high likelihood that be often accessed content, these contents can be with
It is present in cache contents queue more stablely.Therefore, consider to recommend when replacing the cache contents of cache contents queue
The main purpose of temperature is to allow cache contents queue end access temperature small as far as possible, but be more likely accessed in future
Content be not eliminated away.As for the content before cache contents queue, the present invention is not concerned with before and after the position of its sequence,
Because content before cache contents queue regardless of it is forward still rearward, what these contents can be more stable is stored in caching
In content queue.
Step 403, CDN recommendation temperature receiver the recommendation temperature of all content received is sent to recommendation temperature
List.
In the present embodiment, recommender system by the way that the recommendation temperature of the middle all content in all content library is sent to CDN, with
Convenient for CDN when carrying out caching replacement to cache contents queue, caching replacement can be carried out according to the recommendation temperature of cache contents,
To guarantee that access temperature is small at present, but future is possible to accessed content and is not easy the cache contents queue that is eliminated out,
In this way, after this partial content is recommended user by recommender system, for user when requesting this partial content to CDN, CDN can be from
The content of request is returned in cache contents queue to user, to reduce the time of user's waiting.
Fig. 6 is the schematic diagram of the operation flow of the recommended method for the Web content that the embodiment of the present invention four provides, such as Fig. 6 institute
Show, recommender system includes database and recommended engine, include: in database the user interest profile of generation, all content library and
Cache contents library, recommended engine include core recommended engine and fusion engines.There are three inputs for core recommended engine tool: Yong Huxing
Interesting feature, all content library and caching content library, when carrying out commending contents, core recommended engine is first according to user interest spy
All content library of seeking peace obtains the first recommendation results, and then, core recommended engine is according to user interest profile and caching content library
The second recommendation results are obtained, the first recommendation results and the second recommendation results can be showed with the form of list, for example, first recommends
As a result r_1 is used, r_2 ..., r_n are indicated, the second recommendation results rq_1, rq_2 ..., rq_m are indicated.Finally, fusion engines root
The first recommendation results and the second recommendation results are merged according to preset blending algorithm to obtain target recommendation results, export target
Recommendation results are to client.
Fig. 7 is the flow chart of the recommended method for the Web content that the embodiment of the present invention four provides, and please refers to Fig. 6 and Fig. 7, this
The method that embodiment provides may comprise steps of:
Step 501, user A check the recommendation page.
Step 502, client send recommendation request message to web page server.
Recommendation process is triggered by user, recommends the page when user accesses, or browsed some objects (such as music or
Video) after, browser or player will trigger a recommendation process, send recommendation request message to web page server.
Step 503, web page server are sent to recommender system to disappear for inquiring the inquiry request of the recommendation list of user A
Breath.
Interest characteristics and all content library of the core recommended engine according to user A of step 504, recommender system, using
The first recommendation results are calculated in one proposed algorithm.
Step 505, core recommended engine are according to the interest characteristics of user A and caching content library, using the second proposed algorithm
The second recommendation results are calculated.
Cache contents in buffer queue library are usually to be arranged in cache contents queue according to the tactic of update
The content of tail portion is eliminated out cache contents queue as cache contents capacity of queue Man Shihui, and core recommended engine is according in caching
When appearance queue obtains the second recommendation results, whole cache contents of cache contents queue cannot be selected, to avoid in recommendation results
Include the content that will be eliminated.Solution is the cache contents for the p% that core recommended engine only selects cache contents queue,
The selection method of p value is identical as embodiment two, and details are not described herein again.
Step 506, fusion engines are deleted the recommendation common with the second recommendation results from the first recommendation results and are obtained
Third recommendation results.
Optionally, after procedure 506, the score of recommendation common in the second recommendation results can also be improved.
Step 507, fusion engines are according to the score of recommendation to pushing away in third recommendation results and the second recommendation results
Content is recommended uniformly to be ranked up.
Step 508, fusion engines select K recommendation as target recommendation results from the recommendation after sequence.
Step 509, fusion engines update all content according to target recommendation results and recommend temperature library.
If recommender system and CDN cooperate, and in the CDN recommendation temperature that needs recommender system to send cached
Hold the update of queue, then fusion engines redefine the recommendation of the recommendation in target recommendation results according to target recommendation results
Temperature updates all content according to the recommendation temperature of the recommendation in target recommendation results and recommends temperature library, otherwise, the step
It can omit.
Target recommendation results are sent to web page server by step 510, fusion engines.
Target recommendation results are transmitted to client by step 511, web page server.
Step 512, client show target recommendation results to user.
Fig. 8 is the flow chart of the recommended method for the Web content that the embodiment of the present invention five provides, as shown in figure 8, this implementation
The method that example provides may comprise steps of:
Step 601, user A check the recommendation page.
Step 602, client send recommendation request message to web page server.
Step 603, web page server are sent to recommender system to disappear for inquiring the inquiry request of the recommendation list of user A
Breath.
Interest characteristics and all content library of the core recommended engine according to user A of step 604, recommender system, using
The first recommendation results are calculated in one proposed algorithm.
Step 605, core recommended engine belong to recommendation in cache contents library from selection in the first recommendation results, by institute
The recommendation selected is as the second recommendation results.
Step 606, fusion engines delete the second recommendation results from the first recommendation results, obtain third recommendation results.
All recommendations for including in the present embodiment, in the second recommendation results are that the first recommendation results and second recommend knot
The common recommendation of fruit.Optionally, after step 606, obtaining for the recommendation in the second recommendation results can also be improved
Point.
Step 607, fusion engines select a%*k recommendation from third recommendation results.
A is parameter for coordinating the first recommendation results and the second recommendation results: a=0, then the institute in target recommendation results
There is recommendation all to derive from cache contents library;A=1, then all recommendations in target recommendation results all derive from entirety
Content library.Under normal conditions, a can be used as a parameter and carry out simulation acquisition by historical data, or using machine learning
Algorithm calculates an optimal value, or obtains an optimal value by user feedback using the method for online experiment.For CDN
For the system to cooperate with recommender system, in the value range of a (0,1), i.e. a is greater than 0 and less than 1.Determining that a's is specific
When value, allow user that there is the application quickly experienced for biasing toward, the value of a should not appreciably affect recommendation effect (such as
The indexs such as precision and recall rate) under the premise of it is small as far as possible, that is, allow more recommendation source cache contents libraries;For inclined
The application for allowing user that there is various sexual experience is overweighted, the value of a should be use up under the premise of not appreciably affecting user's acquisition speed
It is possible big, that is, allow more recommendations from all content library.
Step 608, fusion engines select (1-a%) * k recommendation from the second recommendation results.
Step 609, fusion engines are selected according to the score of recommendation from third recommendation results and the second recommendation results
The K recommendation selected uniformly is ranked up, and obtains target recommendation results.
Step 610, fusion engines update all content according to target recommendation results and recommend temperature library.
Target recommendation results are sent to web page server by step 611, fusion engines.
Target recommendation results are transmitted to client by step 612, web page server.
Step 613, client show target recommendation results to user.
It should be noted that the step 604-606 in the present embodiment can be exchanged with step 504-506 in example IV,
Step 607-608 can be exchanged with step 506-507 in example IV in the present embodiment.
Fig. 9 is the structural schematic diagram of cache contents queue and the alternating content queue of CDN Edge Server, as shown in figure 9,
CDN Edge Server can generally maintain two queues: cache contents queue and alternating content queue when carrying out caching replacement,
In various embodiments of the present invention, cache contents queue is for storing content of the real cache in CDN, and alternating content queue is for depositing
The following content that may be accessed is stored up, the alternating content stored in alternating content queue is not buffered in CDN.The edge CDN
Server has at least one cache contents queue, but the number of alternating content queue can be zero, one or more.
CDN Edge Server is all based on the access heat of content to the update and caching replacement of cache contents queue and alternating content queue
The access temperature of degree and recommendation temperature, cache contents and alternating content is all stored in access temperature list, cache contents and time
It selects the recommendation temperature of content to be all stored in recommend in temperature list.Certainly, the access temperature of cache contents and alternating content can also
Be stored in different access temperature lists respectively, the recommendation temperature of cache contents and alternating content is also stored in difference respectively
Recommendation temperature list in, the embodiment of the present invention simultaneously limits this.
Cache contents queue is used to store the biggish content of temperature, position of the cache contents in cache contents queue be by
It is ranked up according to temperature size, the temperature information of content includes: access temperature, recommends temperature, according to access temperature and recommendation
Synthesis temperature, access temperature and the combination for recommending temperature that temperature is calculated.When some content in alternating content queue
As soon as temperature is greater than threshold value, CDN Edge Server is added to the content in cache contents queue, and from alternating content team
The content is deleted in column, there are many threshold value determination method, such as can be the minimum hot value in cache contents queue, can also be with
It is calculated by other methods such as experience estimations.If the length of cache contents queue reaches some threshold value (such as cache contents
Total size be more than the 90% of hard-disk capacity), then it is the smallest temperature in cache contents queue to be eliminated according to cache replacement algorithm
A part of content, until the length of cache contents queue is less than some threshold value, (total size of such as cache contents is less than hard-disk capacity
85%), the content being eliminated in cache contents queue is added in alternating content queue.
Alternating content queue is used to store the lesser content of temperature, and alternating content is big according to temperature in alternating content queue
It is small to be ranked up.When some content is accessed, if the content is saved in time not in cache contents queue, the content
It selects in content queue, is ranked up after calculating its temperature according to temperature;It, will be in candidate if alternating content capacity of queue has expired
Hold queue end content identical with the content total size that alternating content queue is newly added and eliminates alternating content queue.In candidate
Hold the ratio that do not fix between the length and cache contents queue of queue, and simultaneously due to the content in alternating content queue
It is not stored in the hard disk of CDN Edge Server, so being not take up hard-disc storage space.It is added into alternating content queue new
Content when, if alternating content queue has been expired, eliminate alternating content queue in the smallest content of temperature, the heat of alternating content
The calculation method of degree can be identical as the temperature calculation method of cache contents, can also be different.
There are many calculation for accessing temperature, such as page displacedment algorithm (Least Frequently is least commonly used
Used, abbreviation LFU) and algorithm (Least Recently Used, abbreviation LRU) at least is used in the recent period, when using some in LFU
Access temperature of the access times of content as the content, LRU using content the last access time apart from it is current when
Between access temperature of the time difference as the content, time difference of the content the last access time apart from current time at this time
Smaller, then the access temperature of the content is bigger.Recommend the calculation of temperature also very much, it such as can be using content in some time
Access temperature of the number being recommended in section as the content.It should be noted that recommender system when being recommended possibly also with
More broadly information, as position of certain video in popular video ranking list, grading information, therefore, it is recommended that the meter of temperature
Calculation may also contain this category information.In inventing each embodiment, temperature is recommended to be obtained by recommender system according to recommended case,
The recommendation temperature of all content is sent to CDN under the control of push trigger by recommender system.The calculation of comprehensive temperature
Can there are many, such as can to access temperature and recommend temperature linearly or nonlinearly be weighted, wherein the weight weighted can
To obtain using empirical data, optimal value can also be obtained using the method for machine learning.It accesses temperature and recommends the group of temperature
Conjunction includes: in the identical situation of access temperature, to recommend temperature bigger to access based on temperature, then temperature is bigger, can also be with
Recommend based on temperature, in the case where recommending the identical situation of temperature, access temperature is bigger, then temperature is bigger.
Figure 10 is the flow chart for the buffer replacing method of Web content that the embodiment of the present invention six provides, please refer to Fig. 9 and
Figure 10, method provided in this embodiment may comprise steps of:
Step 701, CDN Edge Server obtain the recommendation temperature and access heat of the cache contents in cache contents queue
Degree.
Specifically, recommender system, which accesses situation according to the history of the cache contents in cache contents queue, generates cache contents
The access temperature of cache contents in queue.Recommender system is according to the caching received in the cache contents queue that recommender system is sent
The recommendation temperature of the recommendation temperature of content, the cache contents in cache contents queue is recommender system according in cache contents queue
Cache contents recommended case generate, recommender system to CDN send recommend temperature when, can be by the institute in all content library
Substantial recommendation temperature is all sent to CDN Edge Server.
Step 702, CDN Edge Server according to the access temperatures of the cache contents in cache contents queue and recommend temperature
Caching replacement is carried out to cache contents queue.
CDN Edge Server can periodically detect the size of the hard disk remaining space of oneself, such as primary every detection in ten minutes.
If detecting that the size of the cache contents of hard-disc storage has been more than first threshold (the 90% of such as hard-disk capacity), the side CDN
Edge server just will start caching replacement process, until the size of the cache contents of hard-disc storage is lower than second threshold (such as hard disk
The 85% of capacity).The caching replacement process of cache contents queue is usually to eliminate the smallest cache contents of temperature.
In a kind of implementation, if the size of the cache contents in cache contents queue is greater than or equal to first threshold,
The determination of CDN Edge Server carries out superseded, usual cache contents to the lesser cache contents of tail of the queue temperature of cache contents queue
Cache contents in queue are ranked up from high to low according to access temperature, the access of the cache contents of cache contents queue tail of the queue
Temperature is small, and the tail of the queue of cache contents queue needs the access temperature of certain cache contents in superseded cache contents may be identical.
Cache contents identical for access temperature, CDN Edge Server can further compare the recommendation temperature of cache contents.Specifically
, the tail of the queue that CDN Edge Server compares cache contents queue has the recommendation temperature of the cache contents of identical access temperature, washes in a pan
It eliminates in the cache contents with identical access temperature and recommends the lesser cache contents of temperature, the caching in cache contents queue
The size of content be less than second threshold, stopping cache contents queue is carried out it is superseded, second threshold be less than or equal to described first
Threshold value.For example, CDN Edge Server needs to eliminate 10 cache contents of cache contents queue tail of the queue, still, cache contents every time
Queue tail of the queue has the access temperature of 12 cache contents all identical, then, CDN Edge Server compares this 12 cache contents
Recommend temperature, is eliminated from this 12 cache contents and recommend lesser 10 cache contents of temperature.
In another implementation, if the size of the cache contents in cache contents queue is greater than or equal to first threshold,
Then the determination of CDN Edge Server carries out the lesser cache contents of access temperature of the tail of the queue of cache contents queue superseded.Then,
CDN Edge Server calculates in caching according to the access temperature and recommendation temperature of the cache contents of the tail of the queue of cache contents queue
Hold the synthesis temperature of cache contents in the tail of the queue of queue;CDN Edge Server eliminates Thermal Synthetic in the tail of the queue of cache contents queue
Lesser cache contents are spent, until the size of the cache contents in cache contents queue is less than second threshold, then stopping is to caching
Content queue carries out superseded.For example, CDN Edge Server needs to eliminate 10 cache contents of cache contents queue tail of the queue every time,
But cache contents queue tail of the queue has the access temperature of 12 cache contents all identical, then, CDN Edge Server can root
According to recommending temperature and access temperature to calculate the synthesis temperature of this 12 cache contents, Thermal Synthetic is eliminated from this 12 cache contents
Spend lesser 10 cache contents.
In the present embodiment, CDN Edge Server obtains the recommendation temperature and access of the cache contents in cache contents queue
Temperature, when needing to carry out cache contents queue caching replacement, according to the access of the cache contents in cache contents queue heat
Degree and recommendation temperature carry out caching replacement to cache contents queue.In the method, replaced carrying out caching to cache contents queue
When changing, the access temperature of cache contents is not only allowed for, it is also contemplated that the recommendation temperature of cache contents, thus as much as possible recommendation
The high content of temperature retains in the buffer, and user is allow to obtain the content that recommender system is recommended faster.
Figure 11 is the flow chart of the buffer replacing method for the Web content that the embodiment of the present invention seven provides, the reality of the present embodiment
The difference for applying example six is: in the present embodiment, it includes alternating content queue that CDN Edge Server includes cache contents queue again
When, CDN Edge Server is when carrying out caching replacement to alternating content queue, also according to the recommendation temperature of alternating content to candidate
Content queue carries out caching replacement.As shown in figure 11, method provided in this embodiment may comprise steps of:
Step 801, CDN Edge Server obtain the recommendation temperature and access heat of the cache contents in cache contents queue
Degree.
Step 802, CDN Edge Server according to the access temperatures of the cache contents in cache contents queue and recommend temperature
Caching replacement is carried out to cache contents queue.
Step 801 and 802 specific implementation can refer to the description of embodiment six, and which is not described herein again.
Step 803, CDN Edge Server obtain the recommendation temperature and access heat of the alternating content in alternating content queue
Degree.
It is somebody's turn to do specifically, CDN Edge Server accesses situation generation according to the history of the alternating content in alternating content queue
The access temperature of alternating content, recommender system receive the recommendation temperature for the alternating content that recommender system is sent, the alternating content
Recommendation temperature to be recommender system generate according to the recommended case of the alternating content.
Step 804, CDN Edge Server are according to the recommendation temperature of the alternating content in alternating content queue and access temperature
Caching replacement is carried out to alternating content queue.
In a kind of implementation, if the size of the alternating content in alternating content queue is greater than or equal to third threshold value,
The determination of CDN Edge Server carries out the lesser alternating content of access temperature of the tail of the queue of alternating content queue superseded.Usually wait
The alternating content in content queue is selected to be ranked up from high to low according to access temperature, the alternating content of alternating content queue tail of the queue
Access temperature it is small, the tail of the queue of alternating content queue needs the access temperature of certain alternating contents in superseded alternating content may
It is identical.Alternating content identical for access temperature, CDN Edge Server can further compare the recommendation heat of alternating content
Degree.Specifically, CDN Edge Server compares the recommendation heat of the alternating content with identical access temperature in alternating content queue
Degree is eliminated in the alternating content with identical access temperature and recommends the lesser alternating content of temperature, until in alternating content queue
Alternating content size less than the 4th threshold value, then stop carrying out alternating content queue superseded, the 4th threshold value is less than or equal to
Third threshold value.
In another implementation, if the size of the alternating content in alternating content queue is greater than or equal to third threshold value,
Then the determination of CDN Edge Server carries out the lesser alternating content of access temperature of the tail of the queue of alternating content queue superseded;Then,
CDN Edge Server is according to the access temperature of alternating content in the tail of the queue of alternating content queue and recommends temperature, calculates in candidate
Hold the synthesis temperature of alternating content in the tail of the queue of queue;Finally, comparing the synthesis of alternating content in the tail of the queue of alternating content queue
Temperature eliminates the lesser alternating content of synthesis temperature of alternating content in the tail of the queue of alternating content queue, until alternating content team
The size of alternating content in column less than the 4th threshold value, then stop carrying out alternating content queue it is superseded, the 4th threshold value be less than or
Equal to third threshold value.
In the present embodiment, when carrying out caching replacement to cache contents queue and alternating content queue, not only allow for delaying
Deposit the access temperature of content and alternating content, it is also contemplated that the recommendation temperature of cache contents and alternating content, thus as much as possible
The content for recommending temperature high retains in the buffer, and user is allow to obtain the content that recommender system is recommended faster.
CDN recommendation temperature for caching replacement when, a kind of method is update to entire cache contents queue and eliminates
All consider to recommend temperature;Another method is only just to consider to recommend heat when carrying out superseded to the tail of the queue of cache contents queue
Degree, for example, when eliminating the access lesser cache contents queue tail of the queue data of temperature, preferential access temperature of eliminating is identical but recommend
The lesser content of temperature, both modes can also be applied in the caching replacement of alternating content queue.Embodiment six and implementation
In the method for example seven, superseded process is being carried out to the tail of the queue of cache contents queue and alternating content queue by recommending temperature to apply
In, in following two embodiment, CDN will recommend temperature to apply in update and selection process to entire cache contents queue.
Figure 12 is the flow chart of the buffer replacing method for the Web content that the embodiment of the present invention eight provides, as shown in figure 12,
The method of the present embodiment may comprise steps of:
Step 901, CDN Edge Server receive the content acquisition request that client is sent, and include in content acquisition request
The identification information of content to be visited.
The caching replacement process of CDN recommends recommendation results or the end of the page by the access triggers of user when the user clicks
When some the upper content of application of end, a caching replacement process is just triggered, client can be sent in one to CDN Edge Server
Hold acquisition request.
It should be noted that client is not directly to send content acquisition request to CDN Edge Server, client is first
Address resolution request first is sent to the dns server of CDN, includes the identification information of content to be visited, DNS in address resolution request
Server determines the edge cluster nearest apart from user, the edge cluster nearest apart from user according to the mark of content to be visited
In include at least one CDN Edge Server, when in the edge cluster nearest apart from user include a CDN Edge Server
When, the IP address of the CDN Edge Server is directly returned to client by DNS, and client is into CDN Edge Server transmission
Hold acquisition request.When in the edge cluster nearest apart from user including multiple CDN Edge Servers, each edge CDN clothes
Business device all has independent IP address, and only saves part of cache content, and cache contents are in the cluster according to certain mode
It is allocated, for example, Hash can be carried out to the value of the url of cache contents calculates the hash value for obtaining cache contents, it is different
CDN Edge Server saves the different corresponding cache contents of hash value range, in this way, each edge CDN in edge cluster
Server is assured that the content in which CDN Edge Server according to the hash value of the url of a content.If DNS knows
The range of the hash value for the cache contents that each CDN Edge Server in the track pitch edge cluster nearest from user is stored,
So dns server hash value that the url of content to be visited is calculated according to the url of content to be visited, according to be visited interior
CDN Edge Server of the hash value of the url of appearance where finding content to be visited in multiple CDN Edge Server, will be to
The IP address of CDN Edge Server where access content returns to client, the side CDN where client to content to be visited
Edge server sends content acquisition request.If DNS knows each CDN Edge Server in the edge cluster nearest apart from user
The range of the hash value of the cache contents stored, then dns server found from the edge cluster nearest apart from user it is negative
The smallest CDN Edge Server is carried, sends content acquisition request, the smallest CDN edge service of the load to CDN Edge Server
Device finds the CDN Edge Server where content to be visited, and will be wait visit by the hash value of the url of calculating content to be visited
Ask that the IP address of the CDN Edge Server where content returns to dns server, dns server will be where content to be visited
The IP address of CDN Edge Server is transmitted to client, and client is according to the IP of the CDN Edge Server where content to be visited
Address sends content acquisition request to the IP address of the CDN Edge Server where content to be visited.
Whether step 902, CDN Edge Server determine content to be visited at oneself according to the identification information of content to be visited
Cache contents queue in.
If CDN Edge Server may determine that be visited when the identification information of content to be visited is the url of content to be visited
The hash value of the url of content whether within the scope of the hash value of oneself, if the hash value of the url of content to be visited oneself
Within the scope of hash value, it is determined that content to be visited is in the cache contents queue of oneself, if the hash value of the url of content to be visited
Not within the scope of the hash value of oneself, it is determined that content to be visited is not in the cache contents queue of oneself.CDN Edge Server
It can also directly judge the url of content to be visited whether in the cache contents queue of oneself.
If step 903, content to be visited are in cache contents queue, CDN Edge Server is returned to client wait visit
Ask content.
Step 904, CDN Edge Server update the access temperature of content to be visited, and according to the access of content to be visited
The recommendation temperature of temperature and content to be visited calculates the temperature information of content to be visited, more according to the temperature information of content to be visited
New cache contents queue.
Here the temperature information of content to be visited can be the synthesis temperature of content to be visited, or in be visited
The access temperature of appearance and the combination for recommending temperature.Cache contents in cache contents queue be all according to temperature information sorting,
Here according to the temperature information update cache contents queue of content to be visited, i.e., adjusted according to the temperature information of content to be visited slow
Deposit the sequence of cache contents in content queue.
If the cache contents in cache contents queue are ranked up according to comprehensive temperature, then, according to content to be visited
The recommendation temperature of access temperature and content to be visited calculates the temperature information of content to be visited, is believed according to the temperature of content to be visited
Breath updates cache contents queue, specifically: CDN Edge Server uses line to the access temperature and recommendation temperature of content to be visited
Property weighting or the mode of nonlinear weight the synthesis temperature of content to be visited is calculated, then, CDN Edge Server according to
Access the sequence of the cache contents in the synthesis temperature adjustment cache contents queue of content.
If cache contents in cache contents queue are ranked up based on temperature with accessing, when the access of two cache contents
When temperature is identical, then compare the recommendation temperature of the two cache contents, the temperature for the cache contents for recommending temperature big is big, when sequence
Sequence is before the cache contents for recommending temperature small.So, according to the access temperature of content to be visited and pushing away for content to be visited
The temperature information that temperature calculates content to be visited is recommended, according to the temperature information update cache contents queue of content to be visited, specifically
Are as follows: the size of the access temperature of other cache contents in CDN Edge Server content more to be visited and caching content queue, if
The access temperature of content to be visited is identical without the access temperature with other cache contents, then CDN Edge Server directly updates
Cache contents queue, if the access temperature of content to be visited is identical with the access temperature of some cache contents, CDN edge service
The recommendation temperature of device content more to be visited has the recommendation temperature of the cache contents of identical access temperature with this, if more to be visited
The recommendation temperature of content is greater than the recommendation temperature of the cache contents with identical access temperature, then the sequence of content to be visited exists
Before the cache contents with identical access temperature, if the recommendation temperature of content more to be visited, which is less than this, has identical access heat
The recommendation temperature of the cache contents of degree, then the sequence of content to be visited this with it is identical access temperature cache contents after,
If the recommendation temperature of content more to be visited is equal to the recommendation temperature of the cache contents with identical access temperature, to be visited interior
The sequence of appearance is ok before or after the sequence of the cache contents with identical access temperature.
If cache contents in cache contents queue are to recommend to be ranked up based on temperature, when the recommendation of two cache contents
When temperature is identical, then compare the access temperature of the two cache contents, the temperature of the big cache contents of access temperature is big, when sequence
Sequence is before the small cache contents of access temperature.So, according to the access temperature of content to be visited and pushing away for content to be visited
The temperature information that temperature calculates content to be visited is recommended, according to the temperature information update cache contents queue of content to be visited, specifically
Are as follows: the size of the recommendation temperature of other cache contents in CDN Edge Server content more to be visited and caching content queue, if
The recommendation temperature of content to be visited is identical without the recommendation temperature with other cache contents, then CDN Edge Server directly updates
Cache contents queue, if the recommendation temperature of content to be visited is identical with the recommendation temperature of some cache contents, CDN edge service
The access temperature of the access temperature of device content more to be visited and the cache contents that there is identical access to recommend, if more to be visited
The access temperature of content is greater than the access temperature with the identical cache contents for recommending temperature, then the sequence of content to be visited exists
Before this is with the identical cache contents for recommending temperature, if the access temperature of content more to be visited, which is less than this, has identical recommendation heat
The access temperature of the cache contents of degree, then the sequence of content to be visited this with it is identical recommend temperature cache contents after,
If the access temperature of content more to be visited is equal to the access temperature of the cache contents with same buffered temperature, to be visited interior
The sequence of appearance is ok before or after the sequence of the cache contents with identical recommendation temperature.
Step 905, when need to carry out cache contents queue caching replacement when, CDN Edge Server is according to cache contents
The temperature information of cache contents in queue eliminates the lesser cache contents of temperature in cache contents queue.
In the present embodiment, the edge CDN when being updated to cache contents queue, according to the access temperature of cache contents and
Temperature is recommended to be updated, therefore, the sequence of all cache contents in cache contents queue is all according to access temperature and to push away
Temperature sequence is recommended, it is subsequent in this way when carrying out caching replacement to cache contents queue, directly eliminate the team of cache contents queue
The lesser cache contents of tail temperature, without or else needing the access temperature according to cache contents and temperature being recommended to calculate the slow of tail of the queue
The temperature information for depositing content is ranked up according to the temperature information being calculated.
In the present embodiment, CDN Edge Server passes through according to the access temperature of content to be visited and pushing away for content to be visited
It recommends temperature and updates cache contents queue, in order to guarantee that current time accesses when carrying out caching replacement to cache contents
Temperature is small, but the following big cache contents of possibility that access are not easy the cache contents queue that is eliminated out, subsequent when user visits
When asking recommendation results, CDN can return to the content of request from caching content queue to user, to reduce user's waiting
Time.
Figure 13 is the flow chart of the buffer replacing method for the Web content that the embodiment of the present invention nine provides, the present embodiment and reality
The difference for applying example eight is: in the present embodiment, it includes alternating content queue that CDN Edge Server includes cache contents queue again
When, CDN Edge Server is when being updated alternating content queue, also according to the recommendation temperature of alternating content and access temperature
Alternating content queue is updated.The method of the present embodiment is executed by CDN Edge Server, as shown in figure 13, the present embodiment
Method may comprise steps of:
Step 1001 receives the content acquisition request that client is sent, and includes content to be visited in content acquisition request
Identification information.
Whether step 1002 determines content to be visited in cache contents queue according to the identification information of content to be visited.
If content to be visited thens follow the steps 1003 in the cache contents queue of CDN Edge Server, if in be visited
Hold not in the cache contents queue of CDN Edge Server, thens follow the steps 1005.
Step 1003, the access temperature for updating content to be visited, and according to the access temperature of content to be visited and to be visited
The recommendation temperature of content determines the temperature information of content to be visited, according to the temperature information update cache contents team of content to be visited
Column.
After step 1003 has executed, step 1004 is executed.
Step 1004 returns to content to be visited to client.
The specific implementation of step 1001-1004 can refer to the associated description of embodiment eight, and which is not described herein again.
Whether step 1005 determines content to be visited in alternating content queue according to the identification information of content to be visited.
If content to be visited thens follow the steps 1006 in alternating content queue, if content to be visited is not in subsequent content
In queue, 1011 are thened follow the steps.Whether CDN Edge Server determines content to be visited according to the identification information of content to be visited
Specific method in alternating content queue, with CDN Edge Server determine cache contents whether in cache contents queue class
Seemingly, which is not described herein again.
Step 1006, the access temperature for updating content to be visited according to the access temperature of content to be visited and recommend temperature
Determine the temperature information of content to be visited.
Step 1007 judges whether the temperature of content to be visited is greater than preset heat according to the temperature information of content to be visited
Spend threshold value.
If the temperature of content to be visited is greater than heat degree threshold, 1008 are thened follow the steps, if the temperature of content to be visited is less than
Or it is equal to heat degree threshold, then follow the steps 1010.
Content to be visited is added in cache contents queue, and deletes from alternating content queue wait visit by step 1008
Ask content.
Step 1009, the IP address that original server where content server to be visited is returned to client.
Step 1010, the temperature information update alternating content queue according to content to be visited.
After step 1010 has executed, step 1009 is executed.
Content to be visited is added in alternating content queue by step 1011, updates the access temperature of content to be visited, root
The temperature information of content to be visited is calculated according to the temperature of content to be visited and the recommendation temperature of content to be visited.
After step 1011 has executed, step 1010 is executed.
If the IP of original server of the information that CDN Edge Server is returned to client where content to be visited
Content to be visited is requested to the original server then IP address of the client according to the original server in location, and obtain to
After accessing content, content to be visited is showed into user.
Figure 14 is a kind of structural schematic diagram for recommender system that the embodiment of the present invention ten provides, as shown in figure 14, this implementation
The recommender system that example provides includes: receiving module 11, recommending module 12, Fusion Module 13 and sending module 14.
Receiving module 11, the mark of the cache contents in cache contents queue for receiving CDN transmission, according to described slow
The mark and all content library of depositing content obtain the information of the cache contents, by the mark of the cache contents and the caching
The information of content is added to cache contents library;
Recommending module 12, when for receiving the recommendation request message of client transmission when the recommender system, according to pre-
The user interest profile first obtained and all content library, are calculated the first recommendation results using the first proposed algorithm;
The recommending module 12 is also used to obtain the second recommendation results according to the cache contents library;
Fusion Module 13 is used for according to preset blending algorithm to first recommendation results and second recommendation results
It is merged, obtains target recommendation results;
Sending module 14, for the target recommendation results to be pushed to target user.
In a kind of implementation, the recommending module obtains the second recommendation results according to the cache contents library, specifically:
According to the user interest profile and the cache contents library, described second is calculated using the second proposed algorithm and recommends to tie
Fruit.In another implementation, the recommending module obtains the second recommendation results according to the cache contents library, specifically: from
First recommendation results selection belongs to the recommendation in the cache contents library, using selected recommendation as described the
Two recommendation results.
Optionally, the Fusion Module 13 is specifically used for: determining first recommendation results and second recommendation results
In common recommendation;The common recommendation is deleted from first recommendation results, obtains third recommendation results;
According to the score of recommendation, the recommendation in second recommendation results and the third recommendation results is uniformly arranged
Sequence;Using the recommendation after sequence as the target recommendation results, alternatively, according to preset algorithm from pushing away after the sequence
Selected section recommendation is recommended in content as the target recommendation results.
Optionally, the Fusion Module 13 is specifically used for: determining first recommendation results and second recommendation results
In common recommendation;The common recommendation is deleted from first recommendation results, obtains third recommendation results;
A%*k recommendation is selected from the third recommendation results, wherein k is the recommendation for including in the target recommendation results
The number of content, a are more than or equal to 0 and are less than or equal to 100;(1-a%) * k recommendation is selected from second recommendation results;
According to the score of recommendation, to from the recommendation selected in the third recommendation results and from second recommendation results
The recommendation of selection carries out unified sequence, using the recommendation after unified sequence as the target recommendation results.
Wherein, the Fusion Module 13 selects a%*k recommendation from the third recommendation results, specifically: root
The recommendation in the third recommendation results is ranked up according to the score of recommendation, is recommended from the third after sequence
As a result the preceding a%*k recommendation of middle selected and sorted.The Fusion Module 13 selects (1- from second recommendation results
A%) * k recommendation, specifically: the recommendation in second recommendation results is carried out according to the score of recommendation
Sequence, preceding (1-a%) the * k recommendation of selected and sorted from second recommendation results after sequence.
Optionally, the Fusion Module 13 is after deleting the common recommendation in first recommendation results,
It is also used to: improving the score for the common recommendation for including in second recommendation results.
Optionally, the Fusion Module 13 is specifically used for: determining first recommendation results and second recommendation results
In common recommendation;The common recommendation is deleted from second recommendation results, obtains the 4th recommendation results;
According to the score of recommendation, the recommendation in first recommendation results and the 4th recommendation results is uniformly arranged
Sequence;Using the recommendation after sequence as the target recommendation results, alternatively, according to preset algorithm from pushing away after the sequence
Selected section recommendation is recommended in content as the target recommendation results.
Optionally, the Fusion Module 13 is specifically used for: determining first recommendation results and second recommendation results
In common recommendation;The common recommendation is deleted from second recommendation results, obtains the 4th recommendation results;
A%*k recommendation is selected from first recommendation results, wherein k is the recommendation for including in the target recommendation results
The number of content, a are more than or equal to 0 and are less than or equal to 100;(1-a%) * k recommendation is selected from the 4th recommendation results;
According to the score of recommendation, to from the recommendation selected in first recommendation results and from the 4th recommendation results
The recommendation of selection carries out unified sequence, and using the recommendation after unified sequence as the target recommendation results.
Wherein, the Fusion Module 13 selects a%*k recommendation from first recommendation results, specifically: root
The recommendation in first recommendation results is ranked up according to the score of recommendation, is recommended from described first after sequence
As a result the preceding a%*k recommendation of middle selected and sorted.The Fusion Module 13 selects (1- from the 4th recommendation results
A%) * k recommendation, specifically: the recommendation in the 4th recommendation results is carried out according to the score of recommendation
Sequence selects (1-a%) * k recommendation from the 4th recommendation results after sequence.
Optionally, the Fusion Module 13 is after deleting the common recommendation in second recommendation results,
It is also used to: improving the score for the common recommendation for including in first recommendation results.
Optionally, the recommender system further include: recommend temperature generation module, for according in all content library
The recommended case of all content, which generates, recommends temperature library, described to recommend to include in the entirety in all content library in temperature library
Hold recommendation temperature within a preset time;The sending module 14 is also used to that all the elements in temperature library will be recommended to be sent to
The CDN.Correspondingly, the Fusion Module 13 pushes away first recommendation results and described second according to preset blending algorithm
It recommends result to be merged, after obtaining target recommendation results, the recommendation temperature generation module is also used to: being pushed away according to the target
It recommends result and updates the recommendation temperature library.
Optionally, in the present embodiment, the cache contents that the CDN is sent are the interior of the preceding P% of the cache contents queue
Hold, alternatively, for the incremental data of content that sent relative to last time of content of the preceding P% of the cache contents queue, wherein P
For greater than 0 less than 100.
The recommender system of the present embodiment can be used for executing the method for embodiment one to embodiment five, specific implementation and skill
Art effect is similar, and which is not described herein again.
Figure 15 is a kind of structural schematic diagram for CDN Edge Server that the embodiment of the present invention 11 provides, as shown in figure 15,
CDN Edge Server provided in this embodiment includes: to obtain module 21 and caching replacement module 22.
Module 21 is obtained, for obtaining the recommendation temperature and access temperature of the cache contents in cache contents queue;
Replacement module 22 is cached, for the access temperature and recommendation heat according to the cache contents in the cache contents queue
Degree carries out caching replacement to the cache contents queue.
Optionally, the caching replacement module 22 is specifically used for: if cache contents in the cache contents queue is big
It is small to be greater than or equal to first threshold, it is determined that the lesser cache contents of tail of the queue access temperature of the cache contents queue are carried out
It eliminates;The tail of the queue for comparing the cache contents queue has the recommendation temperature of the identical cache contents for accessing temperature, eliminates described
Recommend the lesser cache contents of temperature in cache contents with identical access temperature, until slow in the cache contents queue
Deposit content size be less than second threshold, then stop the cache contents queue is carried out it is superseded, the second threshold be less than or
Equal to the first threshold.
Optionally, the caching replacement module 22 is specifically used for: if cache contents in the cache contents queue is big
It is small to be greater than or equal to first threshold, it is determined that the lesser cache contents of access temperature of the tail of the queue of the cache contents queue into
Row is eliminated;According to the access temperature of the cache contents of the tail of the queue of the cache contents queue and recommend temperature, calculates the caching
The synthesis temperature of cache contents in the tail of the queue of content queue;It is lesser to eliminate comprehensive temperature in the tail of the queue of the cache contents queue
Cache contents, until the size of the cache contents in the cache contents queue is less than second threshold, then stopping is to the caching
Content queue carry out it is superseded, the second threshold be less than or equal to the first threshold.
In the present embodiment, the acquisition module 21 is specifically used for: according to the cache contents in the cache contents queue
History access situation generates the access temperature of the cache contents in the cache contents queue;Receive the described of recommender system transmission
The recommendation temperature of the recommendation temperature of cache contents in cache contents queue, the cache contents in the cache contents queue is institute
State what recommender system was generated according to the recommended case of the cache contents in the cache contents queue.
CDN Edge Server provided in this embodiment, can be used for executing the method for embodiment six, specific implementation and skill
Art effect is similar, and which is not described herein again.
The embodiment of the present invention 12 provides a kind of CDN Edge Server, the knot of CDN Edge Server provided in this embodiment
Structure is identical as CDN Edge Server shown in figure 15, please refers to Figure 15, and in the present embodiment, the acquisition module 21 is also used to: being obtained
Take the recommendation temperature and access temperature of the alternating content in alternating content queue;The caching replacement module 22, is also used to: according to
The recommendation temperature and access temperature of alternating content in the alternating content queue carry out caching to the alternating content queue and replace
It changes.
Optionally, the caching replacement module 22 is specifically used for: if alternating content in the alternating content queue is big
It is small to be greater than or equal to third threshold value, it is determined that the lesser alternating content of access temperature of the tail of the queue of the alternating content queue into
Row is eliminated;The recommendation temperature for comparing the alternating content with identical access temperature in the alternating content queue, eliminates the tool
Recommend the lesser alternating content of temperature, the candidate in the alternating content queue in the alternating content for having identical access temperature
The size of content is less than the 4th threshold value, then stopping carries out the alternating content queue superseded, and the 4th threshold value is less than or waits
In the third threshold value.
Optionally, the caching replacement module 22 is specifically used for: if alternating content in the alternating content queue is big
It is small to be greater than or equal to third threshold value, it is determined that the lesser alternating content of access temperature of the tail of the queue of the alternating content queue into
Row is eliminated;According to the access temperature of alternating content in the tail of the queue of the alternating content queue and recommend temperature, calculates the candidate
The synthesis temperature of alternating content in the tail of the queue of content queue;Eliminate the synthesis of alternating content in the tail of the queue of the alternating content queue
The lesser alternating content of temperature then stops until the size of the alternating content in the alternating content queue is less than the 4th threshold value
The alternating content queue is carried out it is superseded, the 4th threshold value be less than or equal to the third threshold value.
In the present embodiment, the acquisition module 21 is specifically used for: according to the alternating content in the alternating content queue
History access situation generates the access temperature of the alternating content in the alternating content queue;Receive the described of recommender system transmission
The recommendation temperature of alternating content, the recommendation temperature of the alternating content are recommendation of the recommender system according to the alternating content
What situation generated.
CDN Edge Server provided in this embodiment, can be used for executing the method for embodiment seven, specific implementation and skill
Art effect is similar, and which is not described herein again.
Figure 16 is a kind of structural schematic diagram of the Edge Server for CDN that the embodiment of the present invention 13 provides, such as Figure 16 institute
Show, CDN Edge Server provided in this embodiment includes: receiving module 31, processing module 32, update module 33 and caching replacement
Module 34.
Receiving module 31, include for receiving the content acquisition request of client transmission, in the content acquisition request to
Access the identification information of content;
Processing module 32, for determining the content to be visited whether certainly according to the identification information of the content to be visited
In oneself cache contents queue, if the content to be visited returns to institute in the cache contents queue, to the client
State content to be visited;
Update module 33, for updating the access temperature of the content to be visited, and according to the visit of the content to be visited
Ask that temperature and recommendation temperature calculate the temperature information of the content to be visited, according to the temperature information update of the content to be visited
The cache contents queue;
Replacement module 34 is cached, for delaying according to described when needing to carry out the cache contents queue caching replacement
The temperature information for depositing cache contents in content queue eliminates the lesser cache contents of temperature in the cache contents queue.
If the identification information of the content to be visited is not in the cache contents queue, the processing module 32 is also used
In: according to the identification information of the content to be visited determine the content to be visited whether the CDN Edge Server time
It selects in content queue;If the content to be visited in the alternating content queue, updates the access of the content to be visited
Temperature determines the temperature information of the content to be visited according to the access temperature of the content to be visited and recommendation temperature;According to
The temperature information of the content to be visited judges whether the temperature of the content to be visited is greater than preset heat degree threshold;If described
The temperature of content to be visited is greater than the heat degree threshold, then the content to be visited is added in the cache contents queue,
And the content to be visited is deleted from the alternating content queue;The content server to be visited is returned to the client
The IP address of the original server at place.
If the content to be visited is not in the alternating content queue, the processing module 32 is also used to: will it is described to
Access content is added in the alternating content queue;The access temperature for updating the content to be visited, according to described to be visited
The recommendation temperature of the temperature of content and the content to be visited determines the temperature information of the content to be visited, according to described wait visit
Ask alternating content queue described in the temperature information update of content;Where returning to the content server to be visited to the client
Original server IP address.
If the temperature of the content to be visited is less than or equal to the heat degree threshold, the processing module 32 is also used to:
According to alternating content queue described in the temperature information update of the content to be visited;It is returned to the client described to be visited interior
Hold the IP address of the original server where server.
Optionally, the caching replacement module 34 is also used to: when needs carry out caching replacement to the alternating content queue
When, according to the temperature information of alternating content in the alternating content queue, it is lesser to eliminate temperature in the alternating content queue
Alternating content.
CDN Edge Server provided in this embodiment, the method that can be used for executing embodiment eight and embodiment nine are specific real
Existing mode is similar with technical effect, and which is not described herein again.
Figure 17 is the structural schematic diagram for the CDN Edge Server that the embodiment of the present invention 14 provides, as shown in figure 17, this reality
The CDN Edge Server 400 for applying example offer includes: processor 41, memory 42, communication interface 43 and system bus 44, described
Memory 42 and the communication interface 43 are connected and communicated by the system bus 44 with the processor 41;The memory
42, for storing computer executed instructions;The communication interface 43 is used for and other equipment are communicated, the processor 41,
For running the computer executed instructions, the method under executing:
Obtain the recommendation temperature and access temperature of the cache contents in cache contents queue;
According to the access temperature of the cache contents in the cache contents queue and recommend temperature to the cache contents team
Column carry out caching replacement.
Optionally, the processor 41 is warm according to the access temperature of the cache contents in the cache contents queue and recommendation
Degree carries out caching replacement to the cache contents queue, specifically: if the size of the cache contents in the cache contents queue
More than or equal to first threshold, it is determined that washed in a pan to the tail of the queue access lesser cache contents of temperature of the cache contents queue
It eliminates;Then, the tail of the queue of the cache contents queue has the recommendation temperature of the cache contents of identical access temperature, eliminates institute
It states in the cache contents with identical access temperature and recommends the lesser cache contents of temperature, until in the cache contents queue
The size of cache contents is less than second threshold, then stopping carries out the cache contents queue superseded, and the second threshold is less than
Or it is equal to the first threshold.
Optionally, the processor 41 is warm according to the access temperature of the cache contents in the cache contents queue and recommendation
Degree carries out caching replacement to the cache contents queue, specifically: if the size of the cache contents in the cache contents queue
More than or equal to first threshold, it is determined that carried out to the lesser cache contents of the access temperature of the tail of the queue of the cache contents queue
It eliminates;Then, it according to the access temperature of the cache contents of the tail of the queue of the cache contents queue and recommendation temperature, calculates described slow
Deposit the synthesis temperature of cache contents in the tail of the queue of content queue;Finally, eliminating Thermal Synthetic in the tail of the queue of the cache contents queue
Lesser cache contents are spent, until the size of the cache contents in the cache contents queue is less than second threshold, then stopping pair
The cache contents queue carry out it is superseded, the second threshold be less than or equal to the first threshold.
In the present embodiment, the processor 41 obtains the recommendation temperature and access heat of the cache contents in cache contents queue
Degree, specifically: situation is accessed according to the history of the cache contents in the cache contents queue and generates the cache contents queue
In cache contents access temperature;Receive the recommendation heat of the cache contents in the cache contents queue that recommender system is sent
It spends, the recommendation temperature of the cache contents in the cache contents queue is the recommender system according in the cache contents queue
Cache contents recommended case generate.
The processor 41 is also used to: obtaining the recommendation temperature and access temperature of the alternating content in alternating content queue;
The alternating content queue is delayed according to the recommendation temperature of the alternating content in the alternating content queue and access temperature
Deposit replacement.
Optionally, the processor 41 is warm according to the recommendation temperature of the alternating content in the alternating content queue and access
Degree carries out caching replacement to the alternating content queue, specifically: if the size of the alternating content in the alternating content queue
More than or equal to third threshold value, it is determined that carried out to the lesser alternating content of the access temperature of the tail of the queue of the alternating content queue
It eliminates;Then, the recommendation temperature of the alternating content with identical access temperature in the alternating content queue, is eliminated described
Recommend the lesser alternating content of temperature in alternating content with identical access temperature, the time in the alternating content queue
Select the size of content less than the 4th threshold value, then stop carrying out the alternating content queue it is superseded, the 4th threshold value be less than or
Equal to the third threshold value.
Optionally, the processor 41 is warm according to the recommendation temperature of the alternating content in the alternating content queue and access
Degree carries out caching replacement to the alternating content queue, specifically: if the size of the alternating content in the alternating content queue
More than or equal to third threshold value, it is determined that carried out to the lesser alternating content of the access temperature of the tail of the queue of the alternating content queue
It eliminates;Then, according to the access temperature of alternating content in the tail of the queue of the alternating content queue and recommendation temperature, the time is calculated
Select the synthesis temperature of alternating content in the tail of the queue of content queue;Finally, eliminating in the tail of the queue of the alternating content queue in candidate
The lesser alternating content of synthesis temperature of appearance, until the size of the alternating content in the alternating content queue is less than the 4th threshold
Value, then stopping carries out the alternating content queue superseded, and the 4th threshold value is less than or equal to the third threshold value.
In the present embodiment, the processor 41 obtains the recommendation temperature and access heat of the alternating content in alternating content queue
Degree, specifically: situation is accessed according to the history of the alternating content in the alternating content queue and generates the alternating content queue
In alternating content access temperature;Receive the recommendation temperature for the alternating content that recommender system is sent, the alternating content
Recommendation temperature be that the recommender system is generated according to the recommended case of the alternating content.
The CDN Edge Server of the present embodiment, the method that can be used for executing embodiment six and embodiment seven, specific implementation side
Formula is similar with technical effect, and which is not described herein again.
Figure 18 is the structural schematic diagram for the CDN Edge Server that the embodiment of the present invention 15 provides, as shown in figure 18, this reality
The CDN Edge Server 500 for applying example offer includes: processor 51, memory 52, communication interface 53 and system bus 54, described
Memory 52 and the communication interface 53 are connected and communicated by the system bus 54 with the processor 51;The memory
52, for storing computer executed instructions;The communication interface 53 is used for and other equipment are communicated, the processor 51,
For running the computer executed instructions, the method under executing:
The content acquisition request that client is sent is received, includes the mark letter of content to be visited in the content acquisition request
Breath;
Determine the content to be visited whether in oneself cache contents team according to the identification information of the content to be visited
In column;
If the content to be visited in the cache contents queue, returns described to be visited interior to the client
Hold;
The access temperature of the content to be visited is updated, and according to the access temperature of the content to be visited and recommends temperature
The temperature information for calculating the content to be visited, according to cache contents team described in the temperature information update of the content to be visited
Column;
When needing to carry out the cache contents queue caching replacement, according to cache contents in the cache contents queue
Temperature information, eliminate the lesser cache contents of temperature in the cache contents queue.
If the identification information of the content to be visited is not in the cache contents queue, the processor 51 is also used to:
Determine the content to be visited whether in the candidate of the CDN Edge Server according to the identification information of the content to be visited
Hold in queue;If the content to be visited in the alternating content queue, updates the access temperature of the content to be visited,
The temperature information of the content to be visited is determined according to the access temperature of the content to be visited and recommendation temperature;According to it is described to
The temperature information of access content judges whether the temperature of the content to be visited is greater than preset heat degree threshold;If described to be visited
The temperature of content is greater than the heat degree threshold, then the content to be visited is added in the cache contents queue, and from institute
It states and deletes the content to be visited in alternating content queue;Where returning to the content server to be visited to the client
The IP address of original server.
If the content to be visited is not in the alternating content queue, the processor 51 is also used to: by described wait visit
Ask that content is added in the alternating content queue;The access temperature for updating the content to be visited, according to described to be visited interior
The recommendation temperature of the temperature of appearance and the content to be visited determines the temperature information of the content to be visited, according to described to be visited
Alternating content queue described in the temperature information update of content;Where returning to the content server to be visited to the client
The IP address of original server.
If the temperature of the content to be visited is less than or equal to the heat degree threshold, the processor 51 is also used to: root
Alternating content queue described in temperature information update according to the content to be visited;The content to be visited is returned to the client
The IP address of original server where server.
The processor 51 is also used to: when needing to carry out the alternating content queue caching replacement, according to the time
The temperature information for selecting alternating content in content queue eliminates the lesser alternating content of temperature in the alternating content queue.
Figure 19 is the structural schematic diagram for the recommender system that the embodiment of the present invention 16 provides, as shown in figure 19, the present embodiment
The recommender system 600 of offer includes: processor 61, memory 62, communication interface 63 and system bus 64,62 He of memory
The communication interface 63 is connected and communicated by the system bus 64 with the processor 61;The memory 62, for depositing
Store up computer executed instructions;The communication interface 63 is used for and other equipment are communicated, the processor 61, for running
Computer executed instructions are stated, the lower method is executed:
The mark for receiving the cache contents in the cache contents queue that CDN is sent, according to the mark of the cache contents and
All content library obtains the information of the cache contents, and the information of the mark of the cache contents and the cache contents is added
To cache contents library;
When the recommender system receives the recommendation request message of client transmission, according to the user interest obtained in advance
Feature and all content library, are calculated the first recommendation results using the first proposed algorithm;
The second recommendation results are obtained according to the cache contents library;
First recommendation results and second recommendation results are merged according to preset blending algorithm, obtain mesh
Mark recommendation results;
The target recommendation results are pushed to target user.
Optionally, the processor 61 obtains the second recommendation results according to the cache contents library, specifically: according to described
Second recommendation results are calculated using the second proposed algorithm in user interest profile and the cache contents library.
Optionally, the processor 61 obtains the second recommendation results according to the cache contents library, specifically: from described the
One recommendation results select the recommendation for belonging to the cache contents library, recommend selected recommendation as described second
As a result.
Optionally, the processor 61 recommends first recommendation results and described second according to preset blending algorithm
As a result it is merged, obtains target recommendation results, specifically: it determines in first recommendation results and second recommendation results
Common recommendation;The common recommendation is deleted from first recommendation results, obtains third recommendation results;Root
According to the score of recommendation, the recommendation in second recommendation results and the third recommendation results is uniformly arranged
Sequence;Using the recommendation after sequence as the target recommendation results, alternatively, according to preset algorithm from pushing away after the sequence
Selected section recommendation is recommended in content as the target recommendation results.
Optionally, the processor 61 recommends first recommendation results and described second according to preset blending algorithm
As a result it is merged, obtains target recommendation results, specifically: it determines in first recommendation results and second recommendation results
Common recommendation;The common recommendation is deleted from first recommendation results, obtains third recommendation results;From
A%*k recommendation is selected in the third recommendation results, wherein k is in the recommendation for including in the target recommendation results
The number of appearance, a are more than or equal to 0 and are less than or equal to 100;(1-a%) * k recommendation is selected from second recommendation results;Root
According to the score of recommendation, select from the recommendation selected in the third recommendation results and from second recommendation results
The recommendation selected carries out unified sequence, using the recommendation after unified sequence as the target recommendation results.
Wherein, the processor 61 selects a%*k recommendation from the third recommendation results, specifically: according to
The score of recommendation is ranked up the recommendation in the third recommendation results, recommends knot from the third after sequence
The preceding a%*k recommendation of selected and sorted in fruit.The processor 61 selects (1- from second recommendation results
A%) * k recommendation, specifically: the recommendation in second recommendation results is carried out according to the score of recommendation
Sequence, preceding (1-a%) the * k recommendation of selected and sorted from second recommendation results after sequence.
Optionally, the processor 61 is after deleting the common recommendation in first recommendation results, also
For: improve the score for the common recommendation for including in second recommendation results.
Optionally, the processor 61 recommends first recommendation results and described second according to preset blending algorithm
As a result it is merged, obtains target recommendation results, specifically: it determines in first recommendation results and second recommendation results
Common recommendation;The common recommendation is deleted from second recommendation results, obtains the 4th recommendation results;Root
According to the score of recommendation, the recommendation in first recommendation results and the 4th recommendation results is uniformly arranged
Sequence;Using the recommendation after sequence as the target recommendation results, alternatively, according to preset algorithm from pushing away after the sequence
Selected section recommendation is recommended in content as the target recommendation results.
Optionally, the processor 61 recommends first recommendation results and described second according to preset blending algorithm
As a result it is merged, obtains target recommendation results, specifically: it determines in first recommendation results and second recommendation results
Common recommendation;The common recommendation is deleted from second recommendation results, obtains the 4th recommendation results;From
A%*k recommendation is selected in first recommendation results, wherein k is in the recommendation for including in the target recommendation results
The number of appearance, a are more than or equal to 0 and are less than or equal to 100;(1-a%) * k recommendation is selected from the 4th recommendation results;Root
According to the score of recommendation, select from the recommendation selected in first recommendation results and from the 4th recommendation results
The recommendation selected carries out unified sequence, and using the recommendation after unified sequence as the target recommendation results.
Wherein, the processor 61 selects a%*k recommendation from first recommendation results, specifically: according to
The score of recommendation is ranked up the recommendation in first recommendation results, recommends knot from described first after sequence
The preceding a%*k recommendation of selected and sorted in fruit.The processor 61 selects (1- from the 4th recommendation results
A%) * k recommendation, specifically: the recommendation in the 4th recommendation results is carried out according to the score of recommendation
Sequence selects (1-a%) * k recommendation from the 4th recommendation results after sequence.
Optionally, the processor 61 is after deleting the common recommendation in second recommendation results, also
For: improve the score for the common recommendation for including in first recommendation results.
Optionally, the processor 61 is also used to: raw according to the recommended case of all content in all content library
It include the recommendation of all content within a preset time in all content library in the recommendation temperature library at temperature library is recommended
Temperature;All the elements in temperature library will be recommended to be sent to the CDN.Correspondingly, the processor 61 is according to preset fusion
Algorithm merges first recommendation results and second recommendation results, after obtaining target recommendation results, is also used to:
The recommendation temperature library is updated according to the target recommendation results.
In the present embodiment, the content that the cache contents that the CDN is sent are the preceding P% of the cache contents queue, alternatively,
For the incremental data for the content that the content of the preceding P% of the cache contents queue was sent relative to last time, wherein P is small greater than 0
In 100.
Recommender system provided in this embodiment can be used for executing the method for embodiment one to embodiment five, specific implementation side
Formula is similar with technical effect, and which is not described herein again.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey
When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or
The various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.