CN-122002050-A - CDN catalog refreshing method and device, computer equipment, storage medium and product
Abstract
The disclosure relates to the technical field of content delivery networks, and discloses a CDN directory refreshing method, a CDN directory refreshing device, computer equipment, a storage medium and a product, wherein the CDN directory refreshing method comprises the following steps: and receiving a first resource pulling request, carrying path information of the first resource in the first resource pulling request, matching the path information of the first resource with a refreshing directory structure, if the path information is matched with a first node in the refreshing directory structure, determining a refreshing result of the first resource based on the size relation between a first timestamp of the first node and a second timestamp of the first resource, and responding to the latest first resource. According to the method, the whole resource information is not required to be maintained, the first resource pulling request triggers the catalog refreshing task to be executed, and the refreshing result of the resource is determined by comparing the first time stamp with the second time stamp, so that the first resource is responded, and the execution efficiency of catalog refreshing is improved.
Inventors
- WU RUI
- Deng Hongqi
- SHANG XIAOFEI
- WANG JIAN
Assignees
- 抖音视界有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241107
Claims (12)
- 1. The CDN directory refreshing method is characterized by comprising the following steps: receiving a first resource pulling request, wherein the first resource pulling request carries path information of a first resource; Matching the path information of the first resource with a refreshing directory structure, wherein the refreshing directory structure is established based on a history directory refreshing task, corresponding nodes in the refreshing directory structure carry first time stamps of node directory refreshing tasks, locally cached resources carry second time stamps, and the second time stamps are used for representing the first caching time of the resources; and if the path information is matched with the first node in the refreshing directory structure, determining a refreshing result of the first resource and responding to the latest first resource based on the size relation between the first timestamp of the first node and the second timestamp of the first resource.
- 2. The method of claim 1, wherein the determining the refresh result for the first resource based on the size relationship of the first timestamp for the first node and the second timestamp for the first resource comprises: And if the first time stamp is smaller than or equal to the second time stamp, determining that the refreshing result of the first resource is that refreshing is not needed, and the first resource is the latest first resource.
- 3. The method of claim 1, wherein the determining the refresh result for the first resource based on the size relationship of the first timestamp for the first node and the second timestamp for the first resource comprises: And if the first time stamp is larger than the second time stamp, determining that the refreshing result of the first resource needs to be refreshed, and clearing the first resource.
- 4. A method according to claim 3, wherein said responding to the most current first resource comprises: determining whether a local next content distribution network hierarchy exists for the first node, the next content distribution network hierarchy being a hierarchy proximate to a source station; And if the first time stamp of the first node does not exist, adding the first time stamp of the local first node into a second resource pulling request and sending the second resource pulling request to the next content distribution network level so as to acquire the latest first resource, wherein the next content distribution network level is used for acquiring the latest first resource based on the size relation between the first time stamp of the first node and the second time stamp of the first resource.
- 5. The method according to claim 1, wherein the method further comprises: if a third resource pulling request issued by a previous content distribution network level is received, wherein the third resource pulling request carries a first timestamp of a second node in the previous content distribution network level, the second node is a node for refreshing a directory structure in the previous content distribution network level, the second node is a node matched with the third resource pulling request of the previous content distribution network level, and the third resource pulling request is used for pulling a second resource; and determining a refreshing result of the second resource and responding to the latest second resource based on the size relation between the first timestamp of the second node and the second timestamp of the locally cached second resource.
- 6. The method according to claim 1, wherein the method further comprises: If a first directory refreshing task is received for the first time, determining a first refreshing path in the first directory refreshing task; And establishing the refreshing directory structure based on the first refreshing path, and setting a first timestamp of the first directory refreshing task at a corresponding node of the refreshing directory structure.
- 7. The method of claim 6, wherein the method further comprises: If the second directory refreshing task is not received for the first time, determining a second refreshing path in the second directory refreshing task; Updating the refreshing directory structure based on the second refreshing path, and setting a first time stamp of the second directory refreshing task at a corresponding node of the updated refreshing directory structure.
- 8. The method of claim 7, wherein updating the refresh directory structure based on the second refresh path comprises: inquiring in pre-stored index information based on the second refreshing path, and determining directory information to be updated, wherein the pre-stored index information comprises a refreshing directory structure established based on the first directory refreshing task; and updating the refreshing directory structure based on the directory information to be updated.
- 9. A CDN catalog refreshing device, the device comprising: The request receiving module is used for receiving a first resource pulling request, wherein the first resource pulling request carries path information of a first resource; The directory matching module is used for matching the path information of the first resource with a refreshing directory structure, the refreshing directory structure is established based on a history directory refreshing task, corresponding nodes in the refreshing directory structure carry first time stamps of the node directory refreshing task, and locally cached resources carry second time stamps, and the second time stamps are used for representing the first caching time of the resources; and the resource refreshing module is used for determining a refreshing result of the first resource and responding to the latest first resource based on the size relation between the first timestamp of the first node and the second timestamp of the first resource if the path information is matched with the first node in the refreshing directory structure.
- 10. A computer device, comprising: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the CDN directory refresh method of any one of claims 1 to 8.
- 11. A computer readable storage medium having stored thereon computer instructions for causing a computer to perform the CDN directory refreshing method of any one of claims 1 to 8.
- 12. A computer program product comprising computer instructions for causing a computer to perform the CDN directory refreshing method of any one of claims 1 to 8.
Description
CDN catalog refreshing method and device, computer equipment, storage medium and product Technical Field The disclosure relates to the technical field of content delivery networks, and in particular relates to a CDN directory refreshing method, a CDN directory refreshing device, computer equipment, a storage medium and a CDN directory refreshing product. Background The content delivery network (Content Delivery Network, CDN) can utilize CDN node server groups distributed in different areas to form a traffic distribution management network platform, deliver the content of the source station to the network system of the CDN nodes in each place, provide decentralized storage and caching of the content for the user, and deliver the content to a fast and stable cache server according to the dynamic traffic and load conditions of the network. Due to the conditions of source station resource content change and the like, the internal resources of the content distribution network may have expiration time, and the resources need to be forcedly expired from the cache in a resource refreshing mode. In the related art, when the content distribution network performs directory refreshing, the content distribution network is affected by the level of the content distribution network, the number of cache resources and the like, the execution link of the directory refreshing task is longer, the delay is higher, and the overall refreshing efficiency is lower. Disclosure of Invention In view of this, the present disclosure provides a CDN catalog refreshing method, apparatus, computer device, storage medium, and product, so as to solve the problem of catalog refreshing of a content delivery network. In a first aspect, the present disclosure provides a CDN directory refreshing method, where the method includes: receiving a first resource pulling request, wherein the first resource pulling request carries path information of a first resource; Matching the path information of the first resource with a refreshing directory structure, wherein the refreshing directory structure is established based on a history directory refreshing task, corresponding nodes in the refreshing directory structure carry first time stamps of node directory refreshing tasks, locally cached resources carry second time stamps, and the second time stamps are used for representing the first caching time of the resources; and if the path information is matched with the first node in the refreshing directory structure, determining a refreshing result of the first resource and responding to the latest first resource based on the size relation between the first timestamp of the first node and the second timestamp of the first resource. According to the CDN directory refreshing method, a first resource pulling request is received, path information of the first resource is carried in the first resource pulling request, the path information of the first resource is matched with a refreshing directory structure, wherein the refreshing directory structure is established based on a history directory refreshing task, corresponding nodes in the refreshing directory structure carry first time stamps of node directory refreshing tasks, and locally cached resources carry second time stamps. And if the path information is matched with the first node in the refreshing directory structure, determining a refreshing result of the first resource based on the size relation between the first timestamp of the first node and the second timestamp of the first resource, and responding to the latest first resource. According to the method, the whole resource information is not required to be maintained, the first resource pulling request triggers the catalog refreshing task to be executed, and the refreshing result of the resource is determined by comparing the first time stamp with the second time stamp, so that the first resource is responded, and the execution efficiency of catalog refreshing is improved. In a second aspect, the present disclosure provides a CDN catalog refreshing apparatus, the apparatus comprising: The request receiving module is used for receiving a first resource pulling request, wherein the first resource pulling request carries path information of a first resource; The directory matching module is used for matching the path information of the first resource with a refreshing directory structure, the refreshing directory structure is established based on a history directory refreshing task, corresponding nodes in the refreshing directory structure carry first time stamps of the node directory refreshing task, and locally cached resources carry second time stamps, and the second time stamps are used for representing the first caching time of the resources; and the resource refreshing module is used for determining a refreshing result of the first resource and responding to the latest first resource based on the size relation between the first timestamp of the firs