US 11,734,276 B2
Method and apparatus for updating search cache to improve the update speed of hot content
Hongpeng Wang, Beijing (CN); Aiyun Chen, Beijing (CN); and Ting Yao, Beijing (CN)
Assigned to BEIJING QIYI CENTURY SCIENCE & TECHNOLOGY CO., LTD., Beijing (CN)
Appl. No. 16/311,657
Filed by Beijing Qiyi Century Science & Technology Co., Ltd., Beijing (CN)
PCT Filed Aug. 25, 2017, PCT No. PCT/CN2017/099116
§ 371(c)(1), (2) Date Dec. 19, 2018,
PCT Pub. No. WO2018/120876, PCT Pub. Date Jul. 5, 2018.
Claims priority of application No. 201611251539.X (CN), filed on Dec. 29, 2016.
Prior Publication US 2019/0310986 A1, Oct. 10, 2019
Int. Cl. G06F 16/245 (2019.01); G06F 16/2455 (2019.01); G06F 16/953 (2019.01); G06F 16/23 (2019.01); G06F 16/957 (2019.01); G06F 16/951 (2019.01)
CPC G06F 16/24552 (2019.01) [G06F 16/2393 (2019.01); G06F 16/951 (2019.01); G06F 16/953 (2019.01); G06F 16/9574 (2019.01)] 18 Claims
OG exemplary drawing
 
1. A method for updating search cache, comprising:
when hot content is updated, extracting a first search term corresponding to information of the hot content, and updating the first search term into a pre-established first database, wherein, the hot content is preset by means of term segmentation or determined according to update frequency, and the first database stores a search term of hot content;
wherein cache content of a search result for the search term of hot content is stored in a pre-established second database, wherein a valid time of the search term of hot content in the first database is set to be longer than a valid time of the cache content of the search result for the search term of hot content in the second database;
when a search request is received, querying the first database according to a search term in the search request and determining whether a second search term identical to the search term in the search request is obtained, to determine whether the search request is for hot content or for non-hot content, wherein when the second search term is obtained, it is indicated that the search request is for hot content; otherwise, it is indicated that the search request is for non-hot content;
when the second search term is obtained and determined to be valid, querying the second database according to the second search term to obtain cache content of a first search result, wherein, when the second search term is determined to be valid, it is indicated that the second search term is still within a valid period and information corresponding to this second search term is still hot content; and
determining whether the cache content of the first search result is valid; if the cache content of the first search result is valid, taking information in the cache content of the first search result as a first search request result; if the cache content of the first search result is not valid, forwarding the search request to a search engine, obtaining a second search request result and updating the second search request result into the second database;
wherein, determining that the second search term is valid comprises:
determining a first difference between a timestamp of obtaining the second search term and a timestamp of writing the second search term;
if the first difference is smaller than a first preset valid period, determining that the second search term is valid; and
determining whether the cache content of the first search result is valid comprises:
determining a second difference between a timestamp of obtaining the cache content of the first search result and a timestamp of writing the cache content of the first search result;
determining whether the cache content of the first search result is valid according to whether the second difference is smaller than a second preset valid period.