Method and device for reducing extra back-to-source of disk cache content
By building httpDNS services and big data analysis of source logs in edge nodes, determining the time when cache_key resources are written to disk, realizing nearby source return, solving the problems of additional source requests and fixed source logic caused by disk cache content rotation in the prior art, improving the quality and efficiency of source return.
Patent Information
- Application Number
- CN202411707272.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-27
AI Technical Summary
In the prior art, after the disk cache content is rotated, additional return requests are increased, and the return logic is fixed, so the nearby return source cannot be achieved, and the return quality cannot be guaranteed.
By building httpDNS service in edge nodes, using big data to analyze the source log, and determining the time when each cache_key resource is written to disk, the edge node carries the cache_key request to the httpDNS server in MISS to obtain the upstream IP address, and realizes the nearest return to the source.
Reduces additional source return requests for disk cache content, improves the quality and efficiency of source return, avoids looping situations, and reduces latency and resource waste.
Smart Images

Figure CN119620943A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information processing technology, and in particular to a method and device for reducing extra return to source of disk cache content. Background Art
[0002] With the development of distributed network technology, accurate traffic scheduling and cache hit rate have become essential factors in the content delivery network (CDN) business. The content delivery network, a distributed network service architecture, distributes content files to caches on multiple server nodes. When a client requests to access a content file, the content delivery network locates the client's request to the cache node, avoiding centralized access to the source node, effectively controlling the load balancing of the content delivery network, improving file access speed and availability, and enhancing the reliability and security of the content delivery network.
[0003] At present, in order to ensure the cache hit rate of cache nodes in content distribution networks, it is necessary to deploy files in the content service network from source nodes to cache nodes in real time to complete real-time deployment. The more popular files are deployed in real time, the more conducive it is to improve the cache hit rate of cache nodes.
[0004] However, if the cache is rotated, the next access will miss, and then return to the upper node to obtain the content. If the upper cache is also rotated, it will return to the content source. Therefore, the existing technology has the following problems: 1. For cached content, the rotation of disk content increases the number of return requests; 2. The return logic is fixed, and it is impossible to return to the nearest source, and the return quality cannot be guaranteed.
[0005] Therefore, there is an urgent need for a solution to reduce the risk of additional backhauls caused by cache content being overwritten when the disk is full. Summary of the invention
[0006] The present invention aims to provide a method and device for reducing the additional return to the source of disk cache content to solve the deficiencies in the prior art. The technical problem to be solved by the present invention is achieved through the following technical solutions.
[0007] A first aspect of the present invention provides a method for reducing additional return to the source of disk cache content, the method comprising:
[0008] The client sends a request to the edge node. When the edge node has cache resources, it will hit the cache resources and directly return the data to the client.
[0009] Big data collects detailed information about customer requests based on back-to-source log analysis, including the time the request was initiated, the IP address, URL, and the server's response delay. The logs are cleaned and formatted and stored on the big data platform.
[0010] Determine the time to write each cache_key resource to disk and build the httpDNS service;
[0011] After receiving the request, the edge node checks whether the requested data has been cached. If the data has been cached, the edge node extracts the data from the cache, which is called a cache hit. If the data has not been cached, it enters the cache miss step, which is called a MISS. If the cache hits, the data is returned directly, that is, the edge node cache has the requested data and returns it directly to the client. If the cache misses, the edge node usually initiates a request to the upper node to obtain the data, carrying the cache_key request to the httpDNS server to obtain the upstream IP and corresponding content.
[0012] The edge node checks the logic. If the request does not hit, that is, the content requested by the user does not exist in the cache of the edge node, the edge node forwards the request to the upper node to obtain the required content. The upper node processes the request and returns the content to the edge node. After receiving the content, the edge node caches it so that future requests can be directly obtained locally, reducing latency and back-to-source burden. The edge node returns the obtained corresponding content to the user to complete the request;
[0013] When processing user requests, if the edge node finds that the requested content is not in the local cache, it directly sends a request to the upper-level source station to obtain the content. Regardless of whether the data is a cache hit or obtained from the original data source through a request, the edge node will return the data to the client.
[0014] In combination with the first aspect, the above-mentioned determination of the time to write each cache_key resource to disk and establishment of the httpDNS service further includes:
[0015] The back-to-source logic of the edge gateway is changed from the existing DNS to httpDNS. The httpDNS builds a server based on the http protocol. When the client needs DNS resolution, it no longer sends a DNS query message to the local area, but directly accesses the httpDNS interface through a request. The server returns the nearest IP address based on the client's location and the operator it belongs to, and adds the IP in the http header field. httpDNS checks this header field. If the IP is in the header field, it will not be dispatched. A check logic is added to the edge node to prevent loops.
[0016] In combination with the first aspect, the above-mentioned edge node inspection logic further includes:
[0017] Add IP in the http header field, x_cache_miss: ip, and the httpDNS server checks the header field information. If the IP is in the header field, it means that it has been scheduled and will not be selected again to prevent loops. If the request comes from other edge nodes and the request still does not hit, the http DNS will not be used, and the original one will be used to return directly to the upper layer. For the upper-layer node, if the local request does not hit, it will directly return to the customer's source station or the third-party upper server.
[0018] In combination with the first aspect, the above-mentioned httpDNS server checks the header information, further comprising:
[0019] Header field information check: When the user's request reaches the HTTP DNS server, the server will check the header field information Host and X-Forwarded-For in the request. The header field information contains the source IP and related request parameters;
[0020] Determine whether the IP has been scheduled: The server will check whether the IP address in the request is already in its header field information. If the IP address exists in the header field, it means that the request has been scheduled and does not need to be scheduled again;
[0021] Prevent loops: HTTP DNS servers can avoid repeatedly dispatching requests to the same IP address, preventing requests from circulating between multiple nodes, which would cause unnecessary delays and waste of resources.
[0022] Select other IPs: If the IP in the request is not in the header field information, the server will continue to select other available IP addresses for scheduling.
[0023] In combination with the first aspect, the above-mentioned determining the time when each cache_key resource is written to the disk further includes:
[0024] The big data system uses filebeat to collect back-to-source logs, cleans and converts them through flink, and puts the result data into clickhouse to form a result table. The result table in clickhouse is queried to determine the time when each cache_key is written to disk.
[0025] In combination with the first aspect, the above-mentioned big data system is based on the content distribution network CDN, which is a data platform for collecting, storing and analyzing CDN-related data, and is used to realize data collection, data storage, data processing and analysis, visualization and monitoring, and decision support.
[0026] Data collection: collecting data from each edge node and source station, including user requests, cache hit rate, traffic statistics and error log information;
[0027] The data storage: using distributed storage technology Hadoop and NoSQL database to store massive data for subsequent analysis and query;
[0028] Data processing and analysis: using data processing frameworks such as Apache Spark and Flink to analyze the collected data in real time or in batches to extract valuable information, such as traffic patterns, user behaviors, and performance indicators;
[0029] Visualization and monitoring: Use visualization tools such as Grafana and Tableau to display analysis results, helping operation and maintenance personnel monitor CDN performance and optimize resource allocation;
[0030] The decision support: Based on the analysis results, CDN vendors can make data-driven decisions to adjust cache strategies, optimize content distribution, and improve user experience.
[0031] A second aspect of the present invention provides a device for reducing the extra return to the source of disk cache content, the device comprising:
[0032] Send request module: The client sends a request to the edge node. When the edge node has cache resources, it will hit the cache resources and directly return the data to the client;
[0033] Log analysis module: Big data collects detailed information about customer requests based on back-to-source log analysis, including the time the request was initiated, the IP address, URL, and the server's response delay. The logs are cleaned and formatted and stored on the big data platform.
[0034] Time determination module: determines the time when each cache_key resource is written to disk and builds httpDNS service;
[0035] Cache check module: After receiving a request, the edge node checks whether the requested data has been cached. If the data has been cached, the edge node extracts the data from the cache, which is called a cache hit. If the data has not been cached, it enters the cache miss step, which is called a MISS. If the cache hits, the data is returned directly, that is, the edge node cache has the requested data and returns it directly to the client. If the cache misses, the edge node usually initiates a request to the upper node to obtain the data, carrying the cache_key request to the httpDNS server to obtain the upstream IP and corresponding content.
[0036] Logic check module: Check the logic at the edge node. If the request does not hit, that is, the content requested by the user does not exist in the cache of the edge node, the edge node forwards the request to the upper node to obtain the required content. The upper node processes the request and returns the content to the edge node. After receiving the content, the edge node caches it so that future requests can be directly obtained locally to reduce latency and back-to-source burden. The edge node returns the corresponding content obtained to the user to complete the request;
[0037] Request processing module: When the edge node processes a user request, if it finds that the requested content is not in the local cache, it will directly send a request to the upper-level source station to obtain the content. Regardless of whether the data is a cache hit or obtained from the original data source through a request, the edge node will return the data to the client.
[0038] The embodiments of the present invention include the following advantages: the edge node back-to-source logic of the present invention relies on the internal httpdns, and is based on content scheduling. If the edge node misses, it does not directly return to the fixed upper node, but checks other edge nodes or upper nodes according to the scheduling to see whether they have the cache of this content within the rotation period. If so, the content is directly obtained from the node that has not been rotated, thereby reducing the back-to-source.
[0039] The server returns the nearest IP address based on the client's location and operator, which can effectively reduce latency, avoid domain name hijacking, and achieve precise scheduling. Changes in domain name resolution results can take effect quickly. At the same time, the IP is added to the http header field. httpDNS checks this header field. If the IP is in the header field, it will not be scheduled. An additional check logic is added to avoid loops. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a prior art flow chart of an embodiment of a method for reducing extra return to source of disk cache content of the present invention;
[0041] Figure 2 It is a flow chart of an embodiment of a method for reducing extra return to source of disk cache content of the present invention;
[0042] Figure 3 It is an internal structure diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0043] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0044] It should be noted that the above detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present application belongs.
[0045] Before describing the technical solution of the present invention, the technical terms involved in the solution of the present invention are first introduced.
[0046] Back-to-source acquisition: Taking the current status of content distribution networks as an example, the gateway server itself does not generate content, but only copies the corresponding resources of the upper-level server (which may be internal or external) to the current node. After receiving external requests, for the resources corresponding to each different request URL, if the content is in the server's cache and within the server cache validity period, the gateway server directly responds to the content from the local cache, otherwise it will initiate a request from the content source station of this URL to obtain the resources corresponding to this URL and cache them in the cache server of the current node.
[0047] Cache server: Taking the cache server in the content distribution network architecture as an example, the cache is currently a register for temporary storage of network request signals. A large number of network request signals will be cached in the database. Then the database will distribute different network request signals according to the current status of the network server.
[0048] Cache content rotation: The cache is cached on the disk of the cache server (including SATA, SSD, NVMe). The disk space size is fixed, and the cache content is continuously written, so the disk will be full. After it is full, the cache server will continue to write new content, so the already written content will be overwritten. This is called cache content rotation.
[0049] Access gateway server: Content is published to the edge node closest to the user, so that netizens can obtain the required content nearby, so there are many gateway server edge nodes.
[0050] Layered architecture: There are a large number of edge nodes. In order to converge back to the source, the general practice in the content distribution network industry is to set up upper-level nodes. The edge nodes first return to the upper-level nodes. After the upper-level nodes converge once, they return to the source station or the upper-level server to obtain content.
[0051] Cache content rotation period: the average time it takes for cache content to be rotated.
[0052] cache_key: The key of the cache, which uniquely identifies a cached content.
[0053] DNS: Domain Name Resolution Protocol, which resolves domain names into IP addresses.
[0054] httpDNS: Use the HTTP protocol to directly initiate requests to the DNS server, simplifying the complexity of the request.
[0055] MISS: The edge node did not find the required content when processing the user request, so it needs to go back to the upstream server to pull the content. The Chinese interpretation is "miss" or "missing", that is, the edge node failed to find the requested resource in the local cache.
[0056] The present invention uses big data technology to analyze the back-to-source log, determines the time when each cache_key resource is written to the disk, and writes it to the database. The back-to-source logic of the edge gateway node is changed from DNS to httpDNS. Every time the edge node MISSes back to the upstream to pull content, it carries the cache_key request to the httpdns server, obtains the upstream IP (this IP may be other edge nodes), and obtains the content.
[0057] The back-to-source logic of the edge gateway is changed from the existing DNS to httpDNS. httpDNS builds its own server based on the http protocol. When the client needs DNS resolution, it no longer sends a DNS query message to the local, but directly accesses the httpDNS interface through a request. The server returns the nearest IP address based on the client's location and the operator it belongs to, which can effectively reduce latency, avoid domain name hijacking problems, and achieve accurate scheduling. When the domain name resolution result is changed, it can take effect quickly. At the same time, the IP is added to the http header field. httpDNS checks this header field. If the IP is in the header field, it will not be dispatched. An inspection logic is added to avoid loops.
[0058] When processing a request, the HTTP DNS server checks the header information of the request to determine whether a specific IP address has been dispatched. The main purpose of this mechanism is to prevent loops in the DNS dispatch process (i.e., the same request circulates between multiple servers).
[0059] The specific process is as follows:
[0060] 1. Header field information check: When the user's request reaches the HTTP DNS server, the server will check the header field information in the request (such as Host, X-Forwarded-For, etc.), which usually contains the source IP and related request parameters.
[0061] 2. Determine whether the IP has been scheduled: The server will check whether the IP address in the request is already in its header field information. If the IP address exists in the header field, it means that the request has been scheduled and does not need to be scheduled again.
[0062] 3. Prevent loops: In this way, the HTTP DNS server can avoid repeatedly dispatching requests to the same IP address, preventing requests from circulating between multiple nodes (loops). Loops can cause unnecessary delays and waste of resources.
[0063] 4. Select other IPs: If the IP in the request is not in the header field information, the server will continue to select other available IP addresses for scheduling.
[0064] Big data is analyzed based on the back-to-source log (for edge nodes, back-to-source means back-to-upper layer) to determine the time when each cache_key resource is written to disk. An httpDNS service is built in advance. The back-to-source logic of the edge gateway node is changed from DNS to httpDNS. Every time the edge node MISSes and returns to the upstream to pull content, it carries the cache_key request to the httpDNS server to obtain the upstream IP (this IP may be other edge nodes), obtain the content, and add a check logic to the edge node (identified by a specific request header). By adding the IP in the header field of http, such as x_cache_miss:ip, the httpDNS server will check the header field information. If the IP is in the header field, it means that it has been scheduled and will not be selected again to prevent loops. If the request comes from other edges, and this request is still MISS, http DNS will not be used. The original method is used to return directly to the upper layer. For the upper-layer node, the local MISS directly returns to the customer's source station or a third-party upper server.
[0065] Edge node A loses content X due to disk rotation, and the upper node also rotates content X (because the upper layer is the convergence layer, the rotation speed is much faster than the edge). In fact, edge node B still has the cache of content X. At this time, edge node A directly obtains content from edge node B instead of from the customer's origin station, which will reduce back-to-origin requests.
[0066] Furthermore, the big data system uses filebeat to collect back-to-source logs, cleans and converts them through flink, and then puts the result data into clickhouse to form a result table. The result table in clickhouse is then queried to determine the time when each cache_key is written to disk.
[0067] The big data system is based on the CDN content distribution network and is a data platform for collecting, storing and analyzing CDN-related data. Its main functions and components include:
[0068] Data collection: The system collects data from each edge node and origin station, including user requests, cache hit rate, traffic statistics, error logs and other information.
[0069] Data storage: Use distributed storage technologies (such as Hadoop, NoSQL databases, etc.) to store massive amounts of data for subsequent analysis and query.
[0070] Data processing and analysis: Use data processing frameworks (such as Apache Spark, Flink, etc.) to analyze the collected data in real time or batches to extract valuable information such as traffic patterns, user behavior, performance indicators, etc.
[0071] Visualization and monitoring: Display analysis results through visualization tools (such as Grafana, Tableau, etc.) to help operation and maintenance personnel monitor CDN performance and optimize resource allocation.
[0072] Decision support: Based on the analysis results, CDN vendors can make data-driven decisions, such as adjusting caching strategies, optimizing content distribution, and improving user experience.
[0073] Figure 1 This is a flow chart of the prior art of the present invention. The prior art has the following problems: for cached content, the number of source return requests increases due to disk content rotation; the source return logic is fixed, and it is impossible to return to the nearest source, and the source return quality cannot be guaranteed.
[0074] Figure 2 It is a flow chart of the present invention, and the specific processing steps are as follows:
[0075] 1. The client sends a request to the edge node. When edge node A has cached resources, it will hit the resource and return the data directly to the client.
[0076] 2. Big data determines the time when each cache_key resource is written to disk based on the back-to-source log analysis, and builds the httpDNS service. Based on the back-to-source log analysis, big data first collects detailed information about customer requests, including time, IP, URL, and response time, and then cleans and formats the logs and stores them on the big data platform. Then, by analyzing traffic trends, performance monitoring, and content optimization, it identifies peak periods, hot content, and potential problems, and finally generates a visual report to help optimize services and improve user experience.
[0077] 3. Every time the edge node MISSes back to the upstream to pull content, it carries the cache_key request to the httpDNS server, obtains the upstream IP (this IP may be other edge nodes), and obtains the content.
[0078] 4. Check the logic at the edge node. If the request comes from other edges and this request is still MISS, httpDNS will no longer be used. The original one will be used to return directly to the upper layer. Request miss: The content requested by the user does not exist in the cache of the edge node. Request to the upper-layer node: The edge node forwards the request to the upper-layer node to pull the required content. Get content: The upper-layer node processes the request and returns the content to the edge node. Cache content: After receiving the content, the edge node will cache it so that future requests can be obtained directly from the local, reducing latency and the burden of returning to the source. Respond to the user: Finally, the edge node returns the pulled content to the user to complete the request.
[0079] 5. For the upper layer, if the local MISS occurs, directly return to the source station to obtain it.
[0080] Among them, the logic for edge node A is: the back-to-source logic of the edge gateway node is changed from DNS to httpDNS; in the case of edge node MISS, it carries the cache_key request to the httpDNS server to obtain the upstream IP (this IP may be other edge nodes) and obtain the content.
[0081] The logic of edge node B is: check the logic at the edge node. If the request comes from other edges and this request is still MISS, httpDNS will no longer be used, and the original method will be used to directly return to the upper layer; for the upper layer, the local MISS will be returned directly to the customer source station.
[0082] The back-to-source logic of the edge node is the built httpDNS. According to the schedule, it checks whether other edge nodes or upper-level nodes have cached this content within the rotation period, so as to obtain the content. A check logic is added to the edge node (identified by a specific request header) to prevent loops.
[0083] For computing data: 1. Based on big data, analyze according to the back-to-source log (for edge nodes, back-to-source means back to the upper layer); 2. Determine the time when each cache_key resource is written to the disk, and build an httpDNS service.
[0084] In the interaction process between the client and the edge node, each step is closely related.
[0085] 1. The client initiates a request: The client sends a request to the edge node. This is the beginning of the entire process. The client usually requests some data or resources. At this point, the client does not know whether the requested data has been cached.
[0086] 2. Edge node checks cache: After receiving a request, the edge node will first check whether the requested data has been cached. If the data has been cached, the edge node will extract the data from the cache, which is called a cache hit. The key here is whether the cache exists or not, and the edge node needs to check the cache. If there is no data in the cache, it will enter the cache miss step. Cache hit, return data directly: If the edge node has the requested data in the cache, it will return it directly to the client. The cache content of the edge node directly determines whether it can respond to the client quickly. If the data hits, the whole process can be completed very quickly. Cache miss, get data and cache: If the edge node does not have the requested data in the cache, the edge node usually initiates a request to the upper node to obtain the data. After obtaining the data, the edge node will cache it so that it can hit the cache the next time it is requested, improving the response speed. This requires waiting for the completion of the data acquisition and caching operations before continuing to return the data.
[0087] 3. Return data to the client: Regardless of whether the data is cached or obtained from the original data source through a request, the edge node will eventually return the data to the client.
[0088] The correlation between each step: The client's request starts the whole process. The edge node decides whether to obtain data from the upper node based on the cache status (hit or miss). If the cache hits, the data can be returned immediately. If the cache misses, it is necessary to request data from the upper node and cache the data after obtaining it so that future requests can hit the cache.
[0089] Execution order dependencies:
[0090] A request must be made before the cache can be checked;
[0091] The cache must be checked first to decide whether the cache is hit or the data needs to be obtained from the source.
[0092] The edge node back-to-source logic of the present invention relies on the internal httpdns. Based on content scheduling, if the edge node misses, it does not directly return to the fixed upper node, but checks other edge nodes or upper nodes according to the scheduling to see whether they have the cache of this content within the rotation period. If so, the content is directly obtained from the node that has not been rotated, thereby reducing the back-to-source.
[0093] Figure 3 An example of a physical structure diagram of an electronic device is shown. The electronic device may be a smart terminal, and its internal structure diagram may be as follows: Figure 3As shown. The electronic device includes a processor, an internal memory and a network interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection.
[0094] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present invention, and does not constitute a limitation on the electronic device to which the scheme of the present invention is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0095] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application.
[0096] In the above detailed description, reference is made to the accompanying drawings, which form a part of this document. In the accompanying drawings, similar symbols typically identify similar components unless the context indicates otherwise. The illustrated embodiments described in the detailed description, drawings, and claims are not meant to be limiting. Other embodiments may be used, and other changes may be made, without departing from the spirit or scope of the subject matter presented herein.
[0097] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for reducing the extra return to the source of disk cache content, characterized in that: The method comprises: The client sends a request to the edge node. When the edge node has cache resources, it will hit the cache resources and directly return the data to the client. Big data collects detailed information about customer requests based on back-to-source log analysis, including the time the request was initiated, the IP address, URL, and the server's response delay. The logs are cleaned and formatted and stored on the big data platform. Determine the time to write each cache_key resource to disk and build the httpDNS service; After receiving the request, the edge node checks whether the requested data has been cached. If the data has been cached, the edge node extracts the data from the cache, which is called a cache hit. If the data has not been cached, it enters the cache miss step, which is called a MISS. If the cache hits, the data is returned directly, that is, the edge node cache has the requested data and returns it directly to the client. If the cache misses, the edge node usually initiates a request to the upper node to obtain the data, carrying the cache_key request to the httpDNS server to obtain the upstream IP and corresponding content. The edge node checks the logic. If the request does not hit, that is, the content requested by the user does not exist in the cache of the edge node, the edge node forwards the request to the upper node to obtain the required content. The upper node processes the request and returns the content to the edge node. After receiving the content, the edge node caches it so that future requests can be directly obtained locally, reducing latency and back-to-source burden. The edge node returns the obtained corresponding content to the user to complete the request; When processing user requests, if the edge node finds that the requested content is not in the local cache, it directly sends a request to the upper-level source station to obtain the content; regardless of whether the data is a cache hit or obtained from the original data source through a request, the edge node will return the data to the client.
2. A method for reducing extra return to source of disk cache content according to claim 1, characterized in that: The step of determining the time when each cache_key resource is written to disk and setting up the httpDNS service further includes: The back-to-source logic of the edge gateway is changed from the existing DNS to httpDNS. The httpDNS builds a server based on the http protocol. When the client needs DNS resolution, it no longer sends a DNS query message to the local area, but directly accesses the httpDNS interface through a request. The server returns the nearest IP address based on the client's location and the operator it belongs to, and adds the IP in the http header field. httpDNS checks this header field. If the IP is in the header field, it will not be dispatched. A check logic is added to the edge node to prevent loops.
3. A method for reducing extra return to source of disk cache content as claimed in claim 2, characterized in that: The checking logic at the edge node further includes: Add IP in the http header field, x_cache_miss: ip, and the httpDNS server checks the header field information. If the IP is in the header field, it means that it has been scheduled and will not be selected again to prevent loops. If the request comes from other edge nodes and the request still does not hit, the http DNS will not be used, and the original one will be used to return directly to the upper layer. For the upper-layer node, if the local request does not hit, it will directly return to the customer's source station or the third-party upper server.
4. A method for reducing extra return to source of disk cache content according to claim 3, characterized in that: The httpDNS server checks the header information, further comprising: Header field information check: When the user's request reaches the HTTP DNS server, the server will check the header field information Host and X-Forwarded-For in the request. The header field information contains the source IP and related request parameters; Determine whether the IP has been scheduled: The server will check whether the IP address in the request is already in its header field information. If the IP address exists in the header field, it means that the request has been scheduled and does not need to be scheduled again; Prevent loops: HTTP DNS servers can avoid repeatedly dispatching requests to the same IP address, preventing requests from circulating between multiple nodes, which would cause unnecessary delays and waste of resources. Select other IPs: If the IP in the request is not in the header field information, the server will continue to select other available IP addresses for scheduling.
5. The method for reducing the extra return to the source of disk cache content according to claim 1, characterized in that: The step of determining the time when each cache_key resource is written to disk further includes: The big data system uses filebeat to collect back-to-source logs, cleans and converts them through flink, and puts the result data into clickhouse to form a result table. The result table in clickhouse is queried to determine the time when each cache_key is written to disk.
6. A method for reducing extra return to source of disk cache content according to claim 5, characterized in that: The big data system is based on the content distribution network CDN, which is a data platform for collecting, storing and analyzing CDN-related data, and is used to realize data collection, data storage, data processing and analysis, visualization and monitoring, and decision support. Data collection: collecting data from each edge node and source station, including user requests, cache hit rate, traffic statistics and error log information; The data storage: using distributed storage technology Hadoop and NoSQL database to store massive data for subsequent analysis and query; Data processing and analysis: using data processing frameworks such as Apache Spark and Flink to analyze the collected data in real time or in batches to extract valuable information, such as traffic patterns, user behaviors, and performance indicators; Visualization and monitoring: Use visualization tools such as Grafana and Tableau to display analysis results, helping operation and maintenance personnel monitor CDN performance and optimize resource allocation; The decision support: Based on the analysis results, CDN vendors can make data-driven decisions to adjust cache strategies, optimize content distribution, and improve user experience.
7. A device for reducing the extra return of disk cache content, characterized in that: The device comprises: Send request module: The client sends a request to the edge node. When the edge node has cache resources, it will hit the cache resources and directly return the data to the client; Log analysis module: Big data collects detailed information about customer requests based on back-to-source log analysis, including the time the request was initiated, the IP address, URL, and the server's response delay. The logs are cleaned and formatted and stored on the big data platform. Time determination module: determines the time when each cache_key resource is written to disk and builds httpDNS service; Cache check module: After receiving a request, the edge node checks whether the requested data has been cached. If the data has been cached, the edge node extracts the data from the cache, which is called a cache hit. If the data has not been cached, it enters the cache miss step, which is called a MISS. If the cache hits, the data is returned directly, that is, the edge node cache has the requested data and returns it directly to the client. If the cache misses, the edge node usually initiates a request to the upper node to obtain the data, carrying the cache_key request to the httpDNS server to obtain the upstream IP and corresponding content. Logic check module: Check the logic at the edge node. If the request does not hit, that is, the content requested by the user does not exist in the cache of the edge node, the edge node forwards the request to the upper node to obtain the required content. The upper node processes the request and returns the content to the edge node. After receiving the content, the edge node caches it so that future requests can be directly obtained locally to reduce latency and back-to-source burden. The edge node returns the corresponding content obtained to the user to complete the request; Request processing module: When processing user requests, if the edge node finds that the requested content is not in the local cache, it directly sends a request to the upper-level source station to obtain the content. Regardless of whether the data is cache hit or obtained from the original data source through a request, the edge node will return the data to the client.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for reducing the additional return to the source of disk cache content described in any one of claims 1 to 6 are implemented.
9. A computer device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the method for reducing additional re-source of disk cache content as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Hotspot equalization method and system for cache nodes of content delivery network
CN112104752A
Cold access back-to-source scheduling system and processing method thereof
CN112287259A
Data back-to-source method and device, equipment and storage medium
CN114006943A
Method and device for supporting batch refreshing of CDN (Content Delivery Network) caches
CN115883659A
CDN source returning method and device
CN116233252A