A file acquisition method, device, system, equipment, medium and product

By building a consistent hash ring, it ensures that target nodes on different lines request the same multi-line node, solving the problem of a large number of multi-line nodes returning to the origin, improving the hit rate and reducing the origin site load.

CN116248632BActive Publication Date: 2024-09-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211736473.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2024-09-27
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Edge nodes of different operators obtain different upper-layer multi-line node IPs through DNS resolution, causing the same URL file to be requested to different multi-line nodes, resulting in multiple origin returns and putting pressure on the origin site load.

Method used

By requesting the multi-line node information associated with the URL from the DNS scheduling system, a consistent hash ring is constructed to ensure that target nodes on different lines request the same multi-line node, thereby achieving the only return to the source of the file.

Benefits of technology

It improves the hit rate of multi-line nodes, reduces the back-to-origin load of the origin site, and ensures that files only need to be returned to the origin once.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116248632B
    Figure CN116248632B
Patent Text Reader

Abstract

The present application provides a file acquisition method, device, system and equipment, medium and product, which aims to reduce the back-to-source load of the source station. The method includes: requesting the node information of each multi-line node associated with the URL from the DNS scheduling system; receiving the node information returned by the DNS scheduling system, the node information at least including the target domain name and weight; constructing a consistent hash ring according to the target domain name and weight of each multi-line node; determining the target multi-line node from the multi-line nodes according to the URL and the consistent hash ring; requesting the file corresponding to the URL from the target multi-line node through the line where the target node is located.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a file acquisition method, device, system and equipment, medium and product. Background Art

[0002] Multi-line nodes are mainly used to complete the network connection conversion from edge node operator A to source server operator B, so as to achieve the purpose of reducing transmission delay. In order to share the traffic pressure, content delivery network (CDN) manufacturers often have multiple multi-line nodes, and assign different numbers of node IPs to different multi-line nodes to achieve the effect of weighted traffic sharing.

[0003] However, the upper-level multi-line node IPs resolved by the edge nodes of different operators through the Domain Name System (DNS) are different from each other (the upper-level node IP and the client IP are from the same operator), so that the same Uniform Resource Locator (URL) file may be requested to different multi-line nodes, resulting in multiple back-to-source requests, which puts a lot of pressure on the source station load. Summary of the invention

[0004] In view of the above problems, embodiments of the present application provide a file acquisition method, apparatus, system and device, medium and product to overcome the above problems or at least partially solve the above problems.

[0005] In a first aspect of an embodiment of the present application, a file acquisition method is provided, which is applied to a target node, where the target node is a node at a next level of a multi-line node, and the method includes:

[0006] Requesting the DNS scheduling system for node information of each multi-line node associated with the URL, wherein the target node of each multi-line node associated with the URL is the same;

[0007] Receive the node information returned by the DNS scheduling system, wherein the node information includes at least a target domain name and a weight, wherein the target domain name is determined according to a unique label of the multi-line node, and the weight is determined according to the carrying capacity of the multi-line node, and the carrying capacity of the multi-line node on different lines is the same;

[0008] Constructing a consistent hash ring according to the target domain name and weight of each multi-line node;

[0009] Determine a target multi-line node from among the multi-line nodes according to the URL and the consistent hash ring;

[0010] The file corresponding to the URL is requested from the target multi-line node through the line where the target node is located.

[0011] A second aspect of the embodiments of the present application provides a file acquisition method, which is applied to a DNS scheduling system, and the method includes:

[0012] Receive an SRV request carrying an acceleration domain name sent by a target node, where the target node is a node at a lower level than the multi-line node;

[0013] Determine the target SRV record of each multi-line node corresponding to the acceleration domain name from the SRV records stored in the DNS scheduling system;

[0014] According to each target SRV record, the node information of each multi-line node is generated and sent to the target node, so that

[0015] The target node constructs a consistent hash ring according to the target domain name and weight in the information of each node, and determines the target multi-line node for requesting the file corresponding to the acceleration domain name according to the consistent hash ring.

[0016] In a third aspect of an embodiment of the present application, a file acquisition device is provided, which is applied to a target node, where the target node is a node at a next level of a multi-line node, and the device includes:

[0017] A first request module is used to request the DNS scheduling system for node information of each multi-line node associated with the URL, wherein the target node of each multi-line node associated with the URL is the same;

[0018] A first receiving module is used to receive each node information returned by the DNS scheduling system, wherein the node information at least includes a target domain name and a weight, wherein the target domain name is determined according to a unique label of the multi-line node, and the weight is determined according to the carrying capacity of the multi-line node, and the carrying capacity of the multi-line node on different lines is the same;

[0019] A first construction module is used to construct a consistent hash ring according to the target domain name and weight of each multi-line node;

[0020] A first processing module, configured to determine a target multi-line node from among the multi-line nodes according to the URL and the consistent hash ring;

[0021] The second request module is used to request the file corresponding to the URL from the target multi-line node through the line where the target node is located.

[0022] In a fourth aspect of the embodiments of the present application, a file acquisition device is provided, which is applied to a DNS scheduling system, and the device includes:

[0023] A receiving module, used to receive an SRV request carrying an acceleration domain name sent by a target node, wherein the target node is a node at a lower level than the multi-line node;

[0024] A processing module, used to determine the target SRV record of each multi-line node corresponding to the acceleration domain name from the SRV records stored in the DNS scheduling system;

[0025] A sending module is used to generate and send the node information of each multi-line node to the target node according to each target SRV record, so that the target node builds a consistent hash ring according to the target domain name and weight in the each node information, and determines the target multi-line node for requesting the file corresponding to the acceleration domain name according to the consistent hash ring.

[0026] According to a fifth aspect of an embodiment of the present application, a file acquisition system is provided, the system comprising a plurality of multi-line nodes, a next-level node of the plurality of multi-line nodes, and a DNS scheduling system, wherein:

[0027] Among the next-level nodes of the multiple multi-line nodes, the next-level node that receives the file request carrying the URL executes the file acquisition method as described in the first aspect, to construct a consistent hash ring based on the target domain name and weight returned by the DNS scheduling system, and determines the multi-line node used to request the file corresponding to the URL through the consistent hash ring.

[0028] In a sixth aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the file acquisition method described in the first aspect or the second aspect are implemented.

[0029] In a seventh aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the file acquisition method described in the first aspect or the second aspect are implemented.

[0030] In an eighth aspect of the embodiments of the present application, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the steps of the file acquisition method described in the first aspect or the second aspect.

[0031] The embodiments of the present application include the following advantages:

[0032] In this embodiment, the target node uses the target domain name and weight of each multi-line node to construct a consistent hash ring, which can ensure that the consistent hash rings constructed by the target nodes on different lines are the same, so that when the target nodes on different lines request the file of the same URL, they all request the same multi-line node (that is, the target multi-line node), thereby improving the hit rate of the multi-line node and reducing the return load of the source station. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0034] Figure 1 is an implementation flow chart of a file acquisition method of an embodiment of the present application;

[0035] Figure 2 It is a schematic diagram of a business process of a file acquisition method in an embodiment of the present application;

[0036] Figure 3 is a schematic diagram of a consistent hash ring in an embodiment of the present application;

[0037] Figure 4 is an implementation flow chart of another file acquisition method of an embodiment of the present application;

[0038] Figure 5 It is a structural schematic diagram of a file acquisition device in an embodiment of the present application;

[0039] Figure 6 is a structural schematic diagram of another file acquisition device according to an embodiment of the present application;

[0040] Figure 7 It is a schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0042] The main purpose of the content distribution network is to build a layer of network architecture in the existing Internet to distribute the content of the source server to the edge nodes that are closest to the users and widely distributed, so that users can obtain the content nearby, thereby improving the efficiency of source station distribution, optimizing user experience, and reducing network congestion and the load on the corresponding source server.

[0043] Since the end users access various operators (i.e. lines), cross-operator transmission will cause network delay, so the CDN vendors' edge node operators are also distributed in various ways. The source server is often deployed in only one or two operators, so before the CDN edge node returns to the source station to obtain content, it will pass through another layer of internal multi-line nodes, which will complete the network connection conversion from edge node operator A to source server operator B, thereby achieving the purpose of reducing transmission delay.

[0044] In order to share the traffic pressure, CDN manufacturers often have multiple multi-line nodes, and allocate different numbers of node IPs to different multi-line nodes to achieve the effect of sharing the traffic by weight.

[0045] In the related technology, in order to improve the hit rate of URL files in multi-line nodes, the next-level nodes of the multi-line nodes (such as edge nodes or intermediate nodes) will guide the requests for the same URL file to the same multi-line computer room (ie, multi-line node) via a consistent hashing algorithm, thereby achieving a hit on the multi-line nodes.

[0046] However, the upper-level multi-line node IPs resolved by DNS for edge nodes on different lines are different from each other (the upper-level node IP and the client IP are from the same operator). If the edge node builds a consistent hash ring based on the upper-level multi-line node IP, it will cause inconsistencies in the consistent hash rings built by edge nodes on different lines. Ultimately, edge nodes on different lines will request the same URL file from different multi-line nodes, resulting in multiple return to the source, which cannot achieve the effect of returning a file to the source only once, causing greater pressure on the source station load.

[0047] In response to the problems existing in the above-mentioned related technologies, the present application proposes a method for reducing the amount of multi-line node return to the source, so that when edge nodes or intermediate nodes of different lines return to the source through multiple multi-line nodes, the same URL file can be obtained through the same multi-line node, thereby achieving the effect of only one multi-line node obtaining a file from the source station once (i.e., only returning to the source once), thereby fully reducing the return load of the source station.

[0048] The following is a detailed description of the file acquisition method provided by the embodiment of the present application through some embodiments and their application scenarios in combination with the accompanying drawings.

[0049] First, refer to Figure 1 FIG. 1 is a flowchart of an implementation method of a file acquisition method provided in an embodiment of the present application. The method is applied to a target node, which is a node at the next level of a multi-line node, and may include the following steps:

[0050] Step S11: Requesting the DNS scheduling system for node information of each multi-line node associated with the URL, wherein the target node of each multi-line node associated with the URL is the same.

[0051] The target node may be an edge node or an intermediate node.

[0052] In a specific implementation, the target node may be an intermediate node, capable of receiving a request from an edge node to obtain a file corresponding to the URL, or the target node may be an edge node, capable of receiving a request from a terminal to obtain a file corresponding to the URL.

[0053] When the target node receives a request to obtain the file corresponding to the URL but does not store the file corresponding to the URL, the target node requests the DNS scheduling system for the node information (i.e., upper-level node information) of each multi-line node associated with the URL through recursive DNS, so that the target node can subsequently request the corresponding file from a multi-line node associated with the URL.

[0054] Step S12: Receive the node information returned by the DNS scheduling system, the node information at least including the target domain name and weight, the target domain name is determined according to the unique label of the multi-line node, the weight is determined according to the carrying capacity of the multi-line node, and the carrying capacity of the multi-line node is the same on different lines.

[0055] The unique label of the multi-line node is the hardware identifier of the device (such as a server group, etc.) of the multi-line node, and the unique label is associated with information such as the carrying capacity and IP address of each line of the multi-line node.

[0056] Step S13: construct a consistent hash ring according to the target domain name and weight of each multi-line node.

[0057] The target domain name is the unique domain name of the multi-line node.

[0058] In specific implementation, the DNS scheduling system will ensure that the target nodes of each multi-line node associated with the URL are the same (that is, the multi-line node coverage of all areas of the corresponding accelerated domain name is consistent), so that when the lower-level nodes of different lines of each multi-line node request the file corresponding to the same URL, the multi-line nodes corresponding to the node information received are the same (that is, the target domain names received by the lower-level nodes of different lines are the same), and the DNS scheduling system will ensure that the carrying capacity of the multi-line nodes on different lines is the same, that is, the weights of the same multi-line node on different lines are the same, so that the weights received by the lower-level nodes of different lines are the same, so that the consistency hash rings constructed by the lower-level nodes of different lines when requesting the file corresponding to the same URL are the same.

[0059] Step S14: Determine a target multi-line node from among the multi-line nodes according to the URL and the consistent hash ring.

[0060] In specific implementation, after constructing a consistent hash ring, the target node can hash the URL file request to the target domain name of a multi-line node, thereby obtaining the target multi-line node. It can be understood that since the consistent hash rings constructed by the target nodes of different lines when requesting the file corresponding to the same URL are the same, the URL file requests of the target nodes of different lines can all be hashed to the target domain name of the same multi-line node, thereby improving the hit rate of the multi-line node.

[0061] Step S15: Requesting the file corresponding to the URL from the target multi-line node through the line where the target node is located.

[0062] In the specific implementation, based on the consistent hash ring constructed above, the target nodes of different lines will request the same target multi-line node for the file corresponding to the same URL. When the target multi-line node first receives the file request corresponding to the URL, it will first return to the source once to obtain the file corresponding to the URL from the source station. Then the target multi-line node will store the file corresponding to the URL, so that when it receives the file corresponding to the URL subsequently, it can directly return the file corresponding to the URL based on its own storage without returning to the source again, thereby achieving the effect of only returning to the source once for a file.

[0063] By adopting the technical solution of the embodiment of the present application, the target node adopts the target domain name and weight of each multi-line node to construct a consistent hash ring, which can ensure that the consistent hash rings constructed by the target nodes on different lines are the same, so that when the target nodes on different lines request the file of the same URL, they all request the same multi-line node (i.e., the target multi-line node), thereby improving the hit rate of the multi-line node and reducing the return load of the source station.

[0064] The following combination Figure 2 , the above technical solution is further explained. Figure 2 As shown, the embodiment of the present application provides a file acquisition method, including:

[0065] 1. The user sends a user request carrying the URL http: / / a.com / 1.mp4 to edge node A of line 1.

[0066] In this example, edge node A is an edge node that communicates with the user, and the upper-layer nodes of edge nodes A and B are both multi-line nodes 1 and 2.

[0067] 2. Edge node A initiates an SRV request carrying the acceleration domain name to the DNS scheduling system.

[0068] In this embodiment, edge node A determines the acceleration domain name a.com.up.com based on the URL, and generates an SRV request carrying the acceleration domain name, and sends the SRV request to the DNS scheduling system so that the DNS scheduling system generates and returns the node information of each multi-line node based on each SRV record associated with the acceleration domain name.

[0069] 3. The DNS scheduling system returns the node information of multi-line nodes 1 and 2 to edge node A. The node information of multi-line nodes 1 and 2 includes at least: the target domain name duox1.com of multi-line node 1, the weight value 3 of multi-line node 1, the target domain name duox2.com of multi-line node 2, and the weight value 2 of multi-line node 2.

[0070] In this embodiment, the resource planning system maintains multi-line node information, creates a unique label for each multi-line node, maintains its carrying capacity information, and the mapping relationship between multi-line IPs, as follows:

[0071] Multi-line node 1: 1.1.1.1 (IP address of line 1), 2.2.2.2 (IP address of line 2), 3.3.3.3 (IP address of line 3), carrying capacity 300Gbps;

[0072] Multi-line node 2: 4.4.4.4 (IP address of line 1), 5.5.5.5 (IP address of line 2), 6.6.6.6 (IP address of line 3), carrying capacity 200Gbps.

[0073] The DNS scheduling system will pre-configure the regional coverage of multi-line nodes to ensure that the multi-line node coverage corresponding to edge node A of line 1 and edge node B of line 2 is the same. After obtaining the unique labels and carrying capacity of multi-line nodes 1 and 2 from the resource planning system, the DNS scheduling system converts the unique labels of multi-line nodes 1 and 2 into unique domain names (i.e., target domain names) duox1.com and duox2.com according to the set rules, and generates weight information of 3 and 2 respectively with reference to the carrying capacity of multi-line nodes 1 and 2, and generates and stores SRV records (also known as service location records, ServiceRecord) and A records of multi-line nodes 1 and 2 based on the above information.

[0074] For example, the SRV records of multi-line nodes 1 and 2 may be: a.com.up.com, SRV, priority 0, weight 3, time to live (TTL), port 80, duox1.com; a.com.up.com, SRV, priority 0, weight 2, TTL, port 80, duox2.com.

[0075] The A records of multi-line nodes 1 and 2 can be: duox1.com, 1.1.1.1, 2.2.2.2, 3.3.3.3; duox2.com, 4.4.4.4, 5.5.5.5, 6.6.6.6.

[0076] As a possible implementation method, when edge node A requests upper-level node information from the DNS scheduling system through recursive DNS, the DNS scheduling system can return the unique domain name, weight, TTL and other node information of multi-line nodes 1 and 2 to edge node A through its own stored SRV records.

[0077] In this embodiment, when the coverage of multi-line nodes changes, the DNS scheduling system does not need to adjust the edge node cache configuration and the number of multi-line node IPs. It only needs to update the target domain name or weight in the SRV record stored in the DNS scheduling system, thereby simplifying the change operation and improving the scheduling adjustment efficiency.

[0078] The target node (such as edge node A) can determine whether the node information of multi-line nodes 1 and 2 cached by itself is expired based on the TTL in the node information. If the cached node information is not expired, edge node A can directly build a consistent hash ring based on the cached node information to determine the target multi-line node; if the cached node information is expired, edge node A requests the node information of multi-line nodes 1 and 2 from the DNS scheduling system.

[0079] It is understandable that before the TTL of the SRV record of the corresponding accelerated domain name expires, the cache system in the target node will record the information and use the consistent hash ring built based on the information. If there is a change in the multi-line node, whether it is an addition, deletion, or modification operation or a change in the original node weight, only the SRV record stored in the DNS scheduling system needs to be updated accordingly. The node information associated with the updated SRV record will take effect on the target node after the TTL expires, without the need to re-send the configuration to all edge nodes, thereby greatly improving the deployment and scheduling efficiency.

[0080] In addition, since the SRV records stored in the DNS scheduling system are set with weight information, when the carrying capacity of the multi-line nodes changes, there is no need to change the number of VIPs of the multi-line nodes. The DNS scheduling system only needs to change the weight of the corresponding target domain name in the SRV record, which effectively saves the number of VIPs, reduces costs and improves operational efficiency.

[0081] 4. Based on the received target domain name, edge node A sends an A record request carrying the target domain names duox1.com and duox2.com to the DNS scheduling system.

[0082] 5. The DNS scheduling system returns the IP address 1.1.1.1 of multi-line node 1 on line 1 and the IP address 4.4.4.4 of multi-line node 2 on line 1 based on the A records stored in itself.

[0083] 6. Edge node A builds a consistent hash ring, requests to match multi-line node 2, and connects to multi-line node 2 via IP address 4.4.4.4.

[0084] In specific implementation, edge node A can determine the number of multi-line nodes distributed on the consistent hash ring according to the weights of multi-line nodes 1 and 2. For example, if the weights of multi-line nodes 1 and 2 are 3 and 2, the number of multi-line nodes 1 and 2 can be determined as 3 and 2, and then the distribution positions of multi-line nodes 1 and 2 on the consistent hash ring can be determined according to the target domain names and distribution numbers of multi-line nodes 1 and 2, and a consistent hash ring can be constructed based on the distribution positions.

[0085] For example, the consistent hash ring constructed is as follows Figure 3 As shown, multi-line node 1 has 3 distribution positions on the ring, and multi-line node 1 has 2 distribution positions on the ring, and the distribution positions correspond to the target domain name one by one. Among them, the specific distribution position of the multi-line node on the consistent hash ring can be set manually, or it can be calculated based on the target domain name of the multi-line node.

[0086] After building the consistent hash ring, edge node A can determine the mapping position of the user request on the consistent hash ring according to the URL carried by the user request, and start from the mapping position in a clockwise direction according to the target domain name corresponding to the first distribution position encountered (i.e. Figure 3 duox2.com), matches the target multi-line node (i.e., multi-line node 2).

[0087] After matching the target multi-line node, edge node A can determine the IP address of the target multi-line node from the IP addresses of each multi-line node received, and establish a network connection with the target multi-line node based on the IP address of the target multi-line node, and request the file corresponding to the URL from the target multi-line node.

[0088] 7.1. Since multi-line node 2 receives the file acquisition request corresponding to the URL for the first time and does not have the cache of the file corresponding to the URL (i.e., the first miss), it needs to obtain the corresponding file content from the origin site.

[0089] 7.2. The source station returns the file corresponding to the URL to multi-line node 2.

[0090] 7.3. Multi-line node 2 returns the file corresponding to the URL to edge node A.

[0091] 8. The user initiates a file request with a unified URL to edge node B of line 2.

[0092] 9. Edge node B requests the SRV record and A record from the DNS scheduling system, and the DNS scheduling system returns the SRV record and the A record result corresponding to the line where edge node B is located. It can be understood that the SRV record received by edge node B is the same as the SRV record received by edge node A.

[0093] Exemplarily, the SRV record and A record results received by edge node B are as follows:

[0094] SRV records: SRV, 0, 3, 80, duox1.com; SRV, 0, 2, 80, duox2.com;

[0095] A record results: duox1.com, 2.2.2.2; duox2.com, 5.5.5.5.

[0096] 10. Edge node B builds the same consistent hash ring as node A, and hashes to the same multi-line node 2, finds the A record result 5.5.5.5 of the corresponding line as the upper-level node target IP, and establishes a network connection with multi-line node 2 based on the upper-level node target IP. At this time, the cache is hit, and multi-line node 2 does not need to go back to the source again.

[0097] Based on the above embodiment, the resource planning system first assigns a globally unique label to each multi-line node, and maintains the carrying capacity of the multi-line node, the IP address of each line and other information; the DNS scheduling system converts the unique label and carrying capacity of the multi-line node into the target domain name and weight information in the SRV record, and records the mapping relationship between the relevant domain name of the multi-line node and the IP address of each line, and the DNS scheduling system needs to ensure that the multi-line node coverage of all regions corresponding to the accelerated domain name is the same, and the weight of the multi-line node in each line is the same, so as to ensure that the consistent hash rings constructed by the target nodes of different lines are the same.

[0098] When the target node requests the upper node information from the DNS scheduling system, the DNS returns the target domain names and weight information of multiple multi-line nodes to the target node through SRV records, and gives the A record results of each multi-line node in the corresponding line.

[0099] The cache system of the target node builds a consistent hash ring based on the received SRV record-related information, hashes the corresponding URL file request to the target domain name of a multi-line node, reads the A record resolution result of the target domain name, obtains the IP address of the multi-line node, and initiates a request to the IP address to obtain the file content, thereby ensuring that when edge nodes on different lines request the same URL file, they can all request the same multi-line node, thereby improving the hit rate and reducing the amount of return to the source.

[0100] In addition, if the coverage of more online nodes needs to be changed (such as adding, deleting, or changing the weight of more online nodes), the DNS scheduling system can directly operate the changes, and they will take effect in the CDN node cache system after the SRV record TTL expires. There is no need to re-issue the configuration on all edge nodes. The adjustment time is greatly shortened, and the deployment and scheduling efficiency is greatly improved.

[0101] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the order of the actions described, because according to the embodiments of the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0102] Second, refer to Figure 4 As shown, it is an implementation flow chart of another file acquisition method provided in an embodiment of the present application. The method is applied to a DNS scheduling system and may include the following steps:

[0103] Step S21: receiving an SRV request carrying an acceleration domain name sent by a target node, where the target node is a node at a lower level than the multi-line node;

[0104] Step S22: Determine the target SRV record of each multi-line node corresponding to the acceleration domain name from the SRV records stored in the DNS scheduling system;

[0105] Step S23: Generate and send the node information of each multi-line node to the target node according to each target SRV record, so that the target node builds a consistent hash ring according to the target domain name and weight in the node information, and determines the target multi-line node for requesting the file corresponding to the acceleration domain name according to the consistent hash ring.

[0106] By adopting the technical solution of the embodiment of the present application, the target node adopts the target domain name and weight of each multi-line node to construct a consistent hash ring, which can ensure that the consistent hash rings constructed by the target nodes on different lines are the same, so that when the target nodes on different lines request the file of the same URL, they all request the same multi-line node (i.e., the target multi-line node), thereby improving the hit rate of the multi-line node and reducing the return load of the source station.

[0107] As a possible implementation, the method further includes:

[0108] Obtaining the unique label and carrying capacity of each multi-line node from the resource planning system;

[0109] Generating a target domain name of each multi-line node according to the unique label of each multi-line node;

[0110] Determining the weight of each multi-line node according to the carrying capacity of each multi-line node, wherein the carrying capacity of each multi-line node on different lines is the same;

[0111] According to the target domain name and weight of each multi-line node, an SRV record of each multi-line node is generated and stored.

[0112] As a possible implementation, the SRV record includes: an acceleration domain name, a priority, a weight, a TTL, a port, and a target domain name.

[0113] As a possible implementation, the method further includes:

[0114] When the coverage of the multi-line node changes, the SRV record stored in the DNS scheduling system is updated.

[0115] Thirdly, Figure 5 : is a structural schematic diagram of a file acquisition device according to an embodiment of the present application, the device is applied to a target node, the target node is a node at the next level of a multi-line node, and the device includes:

[0116] A first request module, used for requesting node information of each multi-line node associated with a URL from a DNS scheduling system, wherein the target node of each multi-line node associated with the URL is the same;

[0117] A first receiving module is used to receive each node information returned by the DNS scheduling system, wherein the node information at least includes a target domain name and a weight, wherein the target domain name is determined according to a unique label of the multi-line node, and the weight is determined according to the carrying capacity of the multi-line node, and the carrying capacity of the multi-line node on different lines is the same;

[0118] A first construction module is used to construct a consistent hash ring according to the target domain name and weight of each multi-line node;

[0119] A first processing module, configured to determine a target multi-line node from among the multi-line nodes according to the URL and the consistent hash ring;

[0120] The second request module is used to request the file corresponding to the URL from the target multi-line node through the line where the target node is located.

[0121] By adopting the technical solution of the embodiment of the present application, the target node adopts the target domain name and weight of each multi-line node to construct a consistent hash ring, which can ensure that the consistent hash rings constructed by the target nodes on different lines are the same, so that when the target nodes on different lines request the file of the same URL, they all request the same multi-line node (i.e., the target multi-line node), thereby improving the hit rate of the multi-line node and reducing the return load of the source station.

[0122] Optionally, the first building block includes:

[0123] A first construction submodule is used to determine the distribution quantity of each multi-line node on the consistent hash ring according to the weight of each multi-line node;

[0124] The second construction submodule is used to determine the distribution position of each multi-line node on the consistent hash ring according to the target domain name and distribution quantity of each multi-line node;

[0125] The third construction submodule is used to construct a consistent hash ring according to the distribution positions of the multi-line nodes on the consistent hash ring.

[0126] Optionally, the first request module includes:

[0127] A first request submodule, used to determine the acceleration domain name according to the URL;

[0128] The second request submodule is used to send an SRV request carrying the acceleration domain name to the DNS scheduling system, so that the DNS scheduling system generates and returns the node information of each multi-line node according to each SRV record associated with the acceleration domain name.

[0129] Optionally, the node information also includes TTL;

[0130] The device also includes:

[0131] A second processing module, configured to determine whether the cached node information is expired according to the TTL in the node information associated with the URL cached by the target node;

[0132] A third processing module is used to determine the target multi-line node by constructing a consistent hash ring based on the cached node information when the cached node information is not expired;

[0133] The first request module includes:

[0134] The third request submodule is used to request the node information of each multi-line node associated with the URL from the DNS scheduling system when the cached node information expires.

[0135] Optionally, after receiving the information of each node returned by the DNS scheduling system, the device further includes:

[0136] A third request module is used to send an A record request carrying the target domain name of each multi-line node to the DNS scheduling system, so that the DNS scheduling system returns the IP address of each multi-line node corresponding to the line where the target node is located according to the A record of each multi-line node stored in the DNS scheduling system;

[0137] The second request module includes:

[0138] A fourth request submodule, used to determine the IP address of the target multi-line node from the IP addresses of the multi-line nodes corresponding to the line where the target node is located;

[0139] The fifth request submodule is used to request the file corresponding to the URL from the target multi-line node according to the IP address of the target multi-line node.

[0140] Fourthly, Figure 6 : is a structural schematic diagram of another file acquisition device according to an embodiment of the present application, wherein the device is applied to a DNS scheduling system and comprises:

[0141] A receiving module, used to receive an SRV request carrying an acceleration domain name sent by a target node, wherein the target node is a node at a lower level than the multi-line node;

[0142] A processing module, used to determine the target SRV record of each multi-line node corresponding to the acceleration domain name from the SRV records stored in the DNS scheduling system;

[0143] A sending module is used to generate and send the node information of each multi-line node to the target node according to each target SRV record, so that the target node builds a consistent hash ring according to the target domain name and weight in the each node information, and determines the target multi-line node for requesting the file corresponding to the acceleration domain name according to the consistent hash ring.

[0144] By adopting the technical solution of the embodiment of the present application, the target node adopts the target domain name and weight of each multi-line node to construct a consistent hash ring, which can ensure that the consistent hash rings constructed by the target nodes on different lines are the same, so that when the target nodes on different lines request the file of the same URL, they all request the same multi-line node (i.e., the target multi-line node), thereby improving the hit rate of the multi-line node and reducing the return load of the source station.

[0145] Optionally, the device further comprises:

[0146] An acquisition module, used for acquiring the unique label and carrying capacity of each multi-line node from a resource planning system;

[0147] A generating module, configured to generate a target domain name of each multi-line node according to a unique label of each multi-line node;

[0148] An analysis module, used to determine the weight of each multi-line node according to the carrying capacity of each multi-line node, and the carrying capacity of each multi-line node on different lines is the same;

[0149] The storage module is used to generate and store the SRV records of each multi-line node according to the target domain name and weight of each multi-line node.

[0150] Optionally, the SRV record includes: an acceleration domain name, a priority, a weight, a TTL, a port, and a target domain name.

[0151] Optionally, the device further comprises:

[0152] The update module is used to update the SRV record stored in the DNS scheduling system when the coverage of the multi-line node changes.

[0153] In a fifth aspect, an embodiment of the present application further provides a file acquisition system, the system comprising a plurality of multi-line nodes, a next-level node of the plurality of multi-line nodes, and a DNS scheduling system, wherein:

[0154] Among the next-level nodes of the multiple multi-line nodes, the next-level node that receives the file request carrying the URL executes the file acquisition method as described in the first aspect, to construct a consistent hash ring based on the target domain name and weight returned by the DNS scheduling system, and determines the multi-line node used to request the file corresponding to the URL through the consistent hash ring.

[0155] It should be noted that the device embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.

[0156] The present application also provides an electronic device, referring to Figure 7 , Figure 7 Schematic diagram of an electronic device proposed in an embodiment of the present application. Figure 7 As shown, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus communication. A computer program is stored in the memory 110. The computer program can be run on the processor 120 to implement the steps in the file acquisition method disclosed in the embodiment of the present application.

[0157] The embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the file acquisition method disclosed in the embodiment of the present application is implemented.

[0158] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the file acquisition method disclosed in the embodiment of the present application.

[0159] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0160] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0161] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, systems, devices, storage media, and program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0162] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0163] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0164] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0165] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0166] The above is a detailed introduction to a file acquisition method, device, system and equipment, medium and product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for a person skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for obtaining a file, It is characterized in that Applied to a target node, the target node being a node at a next level of a multi-line node, the method comprises: Requesting the DNS scheduling system for node information of each multi-line node associated with the URL, wherein the target node of each multi-line node associated with the URL is the same; Receive the node information returned by the DNS scheduling system, wherein the node information includes at least a target domain name and a weight, wherein the target domain name is determined according to a unique label of the multi-line node, and the weight is determined according to the carrying capacity of the multi-line node, and the carrying capacity of the multi-line node on different lines is the same; Constructing a consistent hash ring according to the target domain name and weight of each multi-line node; Determine a target multi-line node from among the multi-line nodes according to the URL and the consistent hash ring; Requesting the file corresponding to the URL from the target multi-line node through the line where the target node is located; The node information of each multi-line node associated with the URL requested from the DNS scheduling system includes: Determine the acceleration domain name according to the URL; An SRV request carrying the acceleration domain name is sent to the DNS scheduling system, so that the DNS scheduling system determines the target SRV records of each multi-line node corresponding to the acceleration domain name from the SRV records stored in itself, and generates and returns the node information of each multi-line node based on the determined target SRV records.

2. The method according to claim 1, It is characterized in that The step of constructing a consistent hash ring according to the target domain name and weight of each multi-line node includes: Determine the distribution quantity of each multi-line node on the consistent hash ring according to the weight of each multi-line node; Determine the distribution position of each multi-line node on the consistent hash ring according to the target domain name and distribution quantity of each multi-line node; A consistent hash ring is constructed according to the distribution positions of the multi-line nodes on the consistent hash ring.

3. The method according to claim 1, It is characterized in that The node information also includes TTL; the method also includes: Determine whether the cached node information is expired according to the TTL in the node information associated with the URL cached by the target node; In the case where the cached node information is not expired, determining the target multi-line node through a consistent hash ring constructed based on the cached node information; The step of requesting the DNS scheduling system for the node information of each multi-line node associated with the URL includes: When the cached node information is expired, the node information of each multi-line node associated with the URL is requested from the DNS scheduling system.

4. The method according to any one of claims 1 to 3, It is characterized in that After receiving the information of each node returned by the DNS scheduling system, the method further includes: Send an A record request carrying the target domain name of each multi-line node to the DNS scheduling system so that The DNS scheduling system returns the IP addresses of the multi-line nodes corresponding to the line where the target node is located according to the A records of the multi-line nodes stored in the DNS scheduling system; The requesting the target multi-line node for the file corresponding to the URL through the line where the target node is located includes: Determine the IP address of the target multi-line node from the IP addresses of the multi-line nodes corresponding to the line where the target node is located; According to the IP address of the target multi-line node, request the target multi-line node for the file corresponding to the URL.

5. A method for obtaining a file, It is characterized in that Applied to a DNS scheduling system, the method includes: Receive an SRV request carrying an acceleration domain name sent by a target node, where the target node is a node at a lower level than the multi-line node; Determine the target SRV record of each multi-line node corresponding to the acceleration domain name from the SRV records stored in the DNS scheduling system; According to each target SRV record, the node information of each multi-line node is generated and sent to the target node, so that The target node constructs a consistent hash ring according to the target domain name and weight in the information of each node, and determines the target multi-line node for requesting the file corresponding to the acceleration domain name according to the consistent hash ring, and requests the file corresponding to the acceleration domain name from the target multi-line node through the line where the target node is located.

6. The method according to claim 5, It is characterized in that The method further comprises: Acquire the unique label and carrying capacity of each multi-line node from the resource planning system; Generating a target domain name of each multi-line node according to the unique label of each multi-line node; Determining the weight of each multi-line node according to the carrying capacity of each multi-line node, wherein the carrying capacity of each multi-line node on different lines is the same; According to the target domain name and weight of each multi-line node, an SRV record of each multi-line node is generated and stored.

7. The method according to claim 6, It is characterized in that The SRV record includes: acceleration domain name, priority, weight, TTL, port, and target domain name.

8. The method according to any one of claims 5 to 7, It is characterized in that The method further comprises: When the coverage of the multi-line node changes, the SRV record stored in the DNS scheduling system is updated.

9. A file acquisition device, It is characterized in that Applied to a target node, the target node is a node at a next level of a multi-line node, the device comprises: The first request module is used to determine the acceleration domain name according to the URL, and send an SRV request carrying the acceleration domain name to the DNS scheduling system, so that the DNS scheduling system determines the target SRV record of each multi-line node corresponding to the acceleration domain name from the SRV record stored in the DNS scheduling system, and generates and returns the node information of each multi-line node according to each determined target SRV record, and the target node of each multi-line node associated with the URL is the same; A first receiving module is used to receive each node information returned by the DNS scheduling system, wherein the node information at least includes a target domain name and a weight, wherein the target domain name is determined according to a unique label of the multi-line node, and the weight is determined according to the carrying capacity of the multi-line node, and the carrying capacity of the multi-line node on different lines is the same; A first construction module is used to construct a consistent hash ring according to the target domain name and weight of each multi-line node; A first processing module, configured to determine a target multi-line node from among the multi-line nodes according to the URL and the consistent hash ring; The second request module is used to request the file corresponding to the URL from the target multi-line node through the line where the target node is located.

10. A file acquisition device, It is characterized in that Applied to a DNS scheduling system, the device comprises: A receiving module, used to receive an SRV request carrying an acceleration domain name sent by a target node, wherein the target node is a node at a lower level than the multi-line node; A processing module, used to determine the target SRV record of each multi-line node corresponding to the acceleration domain name from the SRV records stored in the DNS scheduling system; A sending module is used to generate and send the node information of each multi-line node to the target node according to each target SRV record, so that the target node builds a consistent hash ring according to the target domain name and weight in the each node information, and determines the target multi-line node for requesting the file corresponding to the acceleration domain name according to the consistent hash ring, and requests the file corresponding to the acceleration domain name from the target multi-line node through the line where the target node is located.

11. A file acquisition system, It is characterized in that The system includes a plurality of multi-line nodes, nodes at a next level of the plurality of multi-line nodes, and a DNS scheduling system, wherein: Among the next-level nodes of the multiple multi-line nodes, the next-level node that receives the file request carrying the URL executes the file acquisition method described in any one of claims 1 to 4, to construct a consistent hash ring based on the target domain name and weight returned by the DNS scheduling system, determine the multi-line node used to request the file corresponding to the URL through the consistent hash ring, and request the file corresponding to the URL from the determined multi-line node through the line where the target node is located.

12. An electronic device comprising a memory, a processor and a computer program stored in the memory, It is characterized in that The processor executes the computer program to implement the file acquisition method according to any one of claims 1 to 4, or the processor executes the computer program to implement the file acquisition method according to any one of claims 5 to 8.

13. A computer-readable storage medium having a computer program / instructions stored thereon, It is characterized in that When the computer program / instruction is executed by a processor, the file acquisition method according to any one of claims 1 to 4 is implemented; or, when the computer program / instruction is executed by a processor, the file acquisition method according to any one of claims 5 to 8 is implemented.

14. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instruction is executed by a processor, the file acquisition method according to any one of claims 1 to 4 is implemented; or, when the computer program / instruction is executed by a processor, the file acquisition method according to any one of claims 5 to 8 is implemented.