Cdn access method, apparatus, electronic device, and storage medium
By selecting the target response node for access based on the cumulative number of accesses in the CDN system, the problem of reduced accessibility caused by IP address restrictions is solved, achieving more efficient IP address management and cost reduction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAT COMP NETWORK & INFORMATION SECURITY MANAGEMENT CENT
- Filing Date
- 2023-02-02
- Publication Date
- 2026-04-21
AI Technical Summary
Once an IP address is restricted in a CDN system, its accessibility will be greatly reduced. Existing technologies that maintain IP address availability through proxy pools suffer from high costs and low efficiency.
By obtaining the cumulative number of accesses to each candidate response node from the IP address of the request initiator, and selecting the target response node for access based on the cumulative number of accesses, the IP address limit is avoided, thus reducing the access restriction on IP addresses.
It improves the accessibility of IP addresses, reduces the cost of maintaining proxy pools, and achieves more efficient IP address management.
Smart Images

Figure CN116260639B_ABST
Abstract
Description
Technical Field
[0001] This application relates to communication technology, and more particularly to a CDN access method, apparatus, electronic device, and storage medium. Background Technology
[0002] CDN (Content Delivery Network) uses streaming media server cluster technology to overcome the shortcomings of insufficient output bandwidth and concurrency of single-machine systems. It can greatly increase the number of concurrent streams supported by the system and reduce or avoid the adverse effects of single point of failure.
[0003] CDNs address the various traffic scrubbing services provided by DDoS (Distributed Denial of Service) and DOS (Denial of Service), which essentially limit access rates. This typically requires setting up an IP address (Internet Protocol Address) proxy pool.
[0004] However, IP address proxy pools need to store a large number of IP addresses while ensuring the availability of the stored IP addresses. Once an IP address is restricted, its accessibility will be greatly reduced. Summary of the Invention
[0005] This application provides a CDN access method, apparatus, electronic device, and storage medium to improve the accessibility of IP addresses.
[0006] In a first aspect, embodiments of this application provide a CDN access method applied to edge nodes, the CDN access method comprising:
[0007] Obtain the Content Delivery Network (CDN) access request for accessing the target URL; the CDN access request includes the Internet Protocol (IP) address of the request initiator.
[0008] Get the cumulative number of times the request initiator's IP address accessed each candidate response node;
[0009] Based on the cumulative number of visits, a target response node is selected from the candidate response nodes to access the target URL.
[0010] Secondly, embodiments of this application also provide a CDN access device configured at an edge node, the CDN access device comprising:
[0011] The CDN access request acquisition module is used to acquire content delivery network (CDN) access requests for accessing a target URL; the CDN access request includes the Internet Protocol address (IP address) of the request initiator.
[0012] The cumulative access count acquisition module is used to obtain the cumulative access count of the request initiator's IP address to each candidate response node;
[0013] The target response node selection module is used to select the target response node from the candidate response nodes based on the cumulative number of accesses, so that the target URL can be accessed through the target response node.
[0014] Thirdly, embodiments of this application also provide an electronic device, which includes:
[0015] One or more processors;
[0016] Storage device for storing one or more programs;
[0017] When one or more programs are executed by one or more processors, the one or more processors implement any of the CDN access methods provided in the embodiments of this application.
[0018] Fourthly, embodiments of this application also provide a storage medium including computer-executable instructions, which, when executed by a computer processor, are used to perform any of the CDN access methods provided in embodiments of this application.
[0019] This application obtains Content Delivery Network (CDN) access requests for accessing a target website. The CDN access request includes the Internet Protocol (IP) address of the requester. It obtains the cumulative number of accesses made by the requester's IP address to each candidate response node. Based on the cumulative access count, a target response node is selected from the candidate response nodes to access the target website. By determining the cumulative response count for each candidate response node based on the cumulative access count, the target response node is determined. This distributes CDN access requests evenly across the candidate response nodes, avoiding IP address access restrictions due to reaching CDN access limits. It eliminates the need to maintain a proxy pool, reducing maintenance costs. Therefore, the technical solution of this application solves the problem of significantly reduced accessibility of IP addresses once they are restricted, achieving the effect of improving IP address accessibility. Attached Figure Description
[0020] Figure 1 This is a flowchart of a CDN access method according to Embodiment 1 of this application;
[0021] Figure 2 This is a flowchart of a CDN access method according to Embodiment 2 of this application;
[0022] Figure 3 This is a schematic diagram of the structure of a CDN access device according to Embodiment 3 of this application;
[0023] Figure 4 This is a schematic diagram of the structure of an electronic device according to Embodiment 4 of this application. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first" and "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] Example 1
[0027] Figure 1 This is a flowchart of a CDN access method provided in Embodiment 1 of this application. This embodiment can be applied to situations where access restrictions occur during CDN access. The method can be executed by a CDN access device, which can be implemented in software and / or hardware and specifically configured in an edge node.
[0028] See Figure 1 The CDN access method shown is applied to edge nodes and includes the following steps:
[0029] S110. Obtain the Content Delivery Network (CDN) access request for accessing the target URL; wherein the CDN access request includes the IP address of the request initiator.
[0030] CDN is a distributed content delivery network built on a data network. It can use streaming media server cluster technology to overcome the shortcomings of insufficient output bandwidth and concurrency of single-machine systems, increase the number of concurrent streams supported by the system, and reduce or avoid the adverse effects of single point of failure.
[0031] A CDN access request can be a request to access content on websites corresponding to various domains within a CDN. The target URL can be the domain name of the website to be accessed. The CDN access request includes the IP address of the requesting party.
[0032] S120. Obtain the cumulative number of visits to each candidate response node by the IP address of the request initiator.
[0033] Each candidate response node can be any edge node in the CDN, used to respond to CDN access requests. In other words, it provides a corresponding IP address for each CDN access request, allowing access to the target URL via that IP address. The cumulative response count can be a threshold for the number of responses to the target URL within a preset time period, which can be per second or per minute, etc.
[0034] Optionally, different candidate response nodes are set in different regions. In order to improve response speed, CDN sets edge nodes as candidate response nodes in different regions to quickly respond to CDN access requests from different locations and improve user experience.
[0035] In one alternative embodiment, each candidate response node is a public node.
[0036] Edge nodes are mainly divided into two types: private nodes and public nodes. Private nodes typically run on HP's embedded operating system, and each node is configured with its own user certificate, allowing access only for specific domains. Public nodes run on Linux 5.x operating systems, and all public nodes are configured with a unified certificate. Users can request access from any website using the CDN through a public node; in other words, all public nodes can respond to CDN access requests.
[0037] Each candidate response node is a public node, which can provide a basis for each candidate response node to respond to CDN access requests.
[0038] S130. Based on the cumulative number of visits, select the target response node from the candidate response nodes to access the target URL through the target response node.
[0039] The target response node can be an edge node that responds to CDN access requests and is used to provide an IP address for CDN access requests.
[0040] CDNs employ rate limiting rules, meaning there's a cap on the number of times a single IP address can access websites within a preset timeframe. Exceeding this cap will restrict access to websites within the CDN for a certain period. Based on the cumulative number of accesses, the candidate response node with the lowest cumulative number of accesses is selected as the target response node, allowing access to the target website through that node.
[0041] In existing technologies, proxy pools are typically used to address rate limiting rules in CDNs. For example, 10 servers control a proxy pool with N available IP addresses. When a large number of CDN access requests are initiated, if an IP address is unable to initiate a CDN access request due to CDN limitation, a new IP address will be retrieved from the proxy pool, and the server's traffic will be proxied to the new IP address to continue initiating CDN access requests.
[0042] A proxy pool needs to store a large number of IP addresses and ensure their availability. In addition, there are certain bandwidth requirements for the IP addresses within the proxy pool. DDoS attacks typically involve a burst of CDN access requests sent in a short period, which necessitates that the proxy pool have the highest possible uplink bandwidth to ensure uninterrupted traffic flow.
[0043] The biggest problem with DDoS attacks is that they easily expose IP addresses, leading to CDN interception and IP address restrictions, which prevents them from lasting long. Proxy pools can alleviate this problem, but once an IP address has been restricted, the CDN will mark it as a risk and synchronize it across all edge nodes. Subsequently, when using this IP to request websites protected by the CDN, the restriction threshold is very low, and even slight abnormal request behavior will be restricted, exacerbating the problem of low IP address availability of proxy pool IPs in a short period of a large number of CDN access requests.
[0044] The technical solution of this embodiment obtains a Content Delivery Network (CDN) access request for accessing a target website. The CDN access request includes the Internet Protocol (IP) address of the request initiator. The cumulative number of accesses by the request initiator's IP address to each candidate response node is obtained. Based on the cumulative access count, a target response node is selected from the candidate response nodes to access the target website. By determining the cumulative response count of each candidate response node based on the cumulative access count, the target response node is determined. This distributes CDN access requests evenly across the candidate response nodes, avoiding restrictions on IP address access due to reaching CDN access limits. It eliminates the need to maintain a proxy pool, reducing maintenance costs. Therefore, the technical solution of this application solves the problem that the accessibility of an IP address is significantly reduced once restricted, achieving the effect of improving IP address accessibility.
[0045] Example 2
[0046] Figure 2 This is a flowchart of a CDN access method provided in Embodiment 2 of this application. The technical solution of this embodiment is further refined based on the above technical solution.
[0047] Furthermore, the phrase "select the target response node from each candidate response node based on the cumulative number of visits" is refined to "select the target response node from each candidate response node based on the cumulative number of visits and the preset access threshold" in order to select the target response node.
[0048] See Figure 2 The CDN access method shown includes:
[0049] S210. Obtain the Content Delivery Network (CDN) access request for accessing the target URL; wherein, the CDN access request includes the Internet Protocol (IP) address of the request initiator.
[0050] S220. Obtain the cumulative number of visits to each candidate response node by the IP address of the request initiator.
[0051] S230. Select the target response node from each candidate response node based on the cumulative number of visits and the preset access threshold.
[0052] The preset access threshold can be the access rate of the initiator's IP address, i.e., the number of accesses within a preset time period, used to select the target response node. Specifically, the target response node can be selected from candidate response nodes based on the difference between the cumulative number of accesses and the preset access threshold. For example, candidate response nodes with a cumulative number of accesses less than the preset access threshold can be selected as the target response node.
[0053] In an optional embodiment, a preset access threshold is determined according to a distributed denial-of-service protocol and / or a denial-of-service protocol.
[0054] Distributed Denial-of-Service (DDoS) protocols and Denial-of-Service (DoS) protocols are used to provide various traffic scrubbing services, distinguishing between normal and abnormal traffic. Once abnormal traffic is identified, its IP address is restricted to "inaccessible," and this restriction can be synchronized to edge nodes globally or in specific regions. Specifically, the minimum access rate limit set in the DDoS and DoS protocols can be used to determine a preset access threshold.
[0055] Determining a preset access threshold based on a distributed denial-of-service protocol and / or a denial-of-service protocol can accurately determine the preset access threshold, ensuring the accuracy of the target response node determined subsequently based on the cumulative number of accesses and the preset access threshold.
[0056] In one optional embodiment, selecting a target response node from each candidate response node based on each cumulative access count and a preset access threshold includes: determining the difference between each cumulative access count and the preset access threshold; and selecting a target response node from each candidate response node based on each difference.
[0057] The difference can be a preset access threshold minus the cumulative number of accesses, used to determine the responsiveness of each candidate response node for the given IP address, i.e., the number of times the IP address can access each candidate response node within a preset time. If the difference is positive, the IP address will not be restricted from making CDN access requests to the corresponding candidate response node, and the larger the positive difference, the stronger the responsiveness of the candidate response node, i.e., the more times it can respond. For example, candidate response nodes with positive differences can be randomly selected as target response nodes. Alternatively, the target response node can be selected from among the candidate response nodes with positive differences according to preset rules. For instance, the preset rule could be to sort the differences by size and select the candidate response node corresponding to a specific difference value as the target response node.
[0058] By determining the difference between each cumulative access count and a preset access threshold, and selecting a target response node from each candidate response node based on each difference, it can be ensured that the IP address will not be restricted when making CDN access requests through the target response node, thus guaranteeing the availability of the IP address. The method is simple in logic and easy to implement.
[0059] In one optional embodiment, selecting a target response node from each candidate response node based on each difference includes: selecting the candidate response node corresponding to the larger value among the differences as the target response node.
[0060] A larger difference indicates that the candidate response node can respond to CDN access requests from the initiating IP address more times, and is less likely to be restricted. Specifically, the differences can be sorted in descending order, and the largest difference among the first M values in the sorted list is selected randomly or at a specified position. Preferably, the candidate response node corresponding to the largest difference is selected as the target response node.
[0061] By selecting the candidate response node corresponding to the larger difference value as the target response node, the averaging of each candidate response node with respect to the initiator's corresponding IP address can be achieved, reducing the possibility that the initiator's corresponding IP address is restricted and improving the accessibility of the initiator's corresponding IP address.
[0062] In an optional embodiment, after selecting a target response node from each candidate response node based on the number of accesses and a preset access threshold to access the target URL through the target response node, the method further includes: updating the cumulative number of accesses corresponding to the target response node.
[0063] After determining the target response node, the CDN access request corresponding to the initiator's IP address is responded to through the target response node, and the cumulative access count corresponding to the target response node is incremented by 1 to update the cumulative access count, providing accurate data for the next selection of the target response node.
[0064] By updating the cumulative access count corresponding to the target response node, the real-time nature of each cumulative access count is ensured, providing accurate data for the selection of the next target response node.
[0065] The technical solution of this embodiment selects a target response node from each candidate response node based on the number of accesses and a preset access threshold, thereby preventing the access of the initiator's corresponding IP address from reaching the limit and being restricted, thus improving the accessibility of the IP address.
[0066] Example 3
[0067] Figure 3 The diagram shown is a schematic representation of a CDN access device according to Embodiment 3 of this application. This embodiment is applicable to situations where access restrictions occur during CDN access. It is configured at an edge node, and the specific structure of the CDN access device is as follows:
[0068] CDN access request acquisition module 310 is used to acquire content delivery network (CDN) access requests for accessing a target domain name; wherein, the CDN access request includes the Internet Protocol address (IP address) of the target domain name;
[0069] The cumulative access count acquisition module 320 is used to obtain the cumulative access count of the IP address of the requested target domain name to each candidate response node;
[0070] The target response node selection module 330 is used to select a target response node from each candidate response node based on the cumulative number of accesses, so as to access the target domain name through the target response node.
[0071] The technical solution of this embodiment obtains a Content Delivery Network (CDN) access request for accessing a target website through a CDN access request acquisition module. The CDN access request includes the Internet Protocol (IP) address of the request initiator. A cumulative access count acquisition module obtains the cumulative number of accesses made by the request initiator's IP address to each candidate response node. A target response node selection module selects a target response node from the candidate response nodes based on the cumulative access count, allowing access to the target website through the target response node. By determining the cumulative response count for each candidate response node based on the cumulative access count, the target response node is determined. This distributes CDN access requests evenly across the candidate response nodes, avoiding restrictions on IP address access due to reaching CDN access limits. It eliminates the need to maintain a proxy pool, reducing maintenance costs. Therefore, the technical solution of this application solves the problem that the accessibility of an IP address is significantly reduced once restricted, achieving the effect of improving IP address accessibility.
[0072] Optionally, the target response node selection module 330 includes:
[0073] Each access count comparison unit is used to select the target response node from each candidate response node based on the cumulative access count and the preset access threshold.
[0074] Optional, each access count comparison unit includes:
[0075] The difference determination subunit is used to determine the difference between each cumulative access count and a preset access threshold;
[0076] The difference comparison subunit is used to select the target response node from each candidate response node based on the difference values.
[0077] Optionally, the difference comparison sub-unit is used to select the candidate response node corresponding to the larger value among the differences as the target response node.
[0078] Optionally, the target response node selection module 330 includes:
[0079] The preset access threshold determination unit is used to determine the preset access threshold according to the Distributed Denial-of-Service Protocol and / or Denial-of-Service Protocol.
[0080] Optionally, the CDN access device also includes:
[0081] The access count update unit is used to update the cumulative access count corresponding to the target response node.
[0082] Optionally, each candidate response node can be a public node.
[0083] The CDN access device provided in this application embodiment can execute the CDN access method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the CDN access method.
[0084] Example 4
[0085] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application, as shown below. Figure 4 As shown, the electronic device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of processors 410 in the electronic device can be one or more. Figure 4 Taking a processor 410 as an example; the processor 410, memory 420, input device 430, and output device 440 in the electronic device can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0086] The memory 420, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the CDN access method in this embodiment (e.g., CDN access request acquisition module 310, cumulative access count acquisition module 320, and target response node selection module 330). The processor 410 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 420, thereby implementing the aforementioned CDN access method.
[0087] The memory 420 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 420 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 420 may further include memory remotely located relative to the processor 410, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0088] Input device 430 can be used to receive input character information and generate key signal inputs related to user settings and function control of the electronic device. Output device 440 may include display devices such as a display screen.
[0089] Example 5
[0090] Embodiment 5 of this application also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute a CDN access method applied to an edge node. The method includes: obtaining a Content Delivery Network (CDN) access request for accessing a target URL; wherein the CDN access request includes the Internet Protocol (IP) address of the request initiator; obtaining the cumulative number of accesses to each candidate response node by the IP address of the request initiator; and selecting a target response node from each candidate response node based on the cumulative number of accesses, so as to access the target URL through the target response node.
[0091] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the method operations described above, but can also perform related operations in the CDN access method provided in any embodiment of this application.
[0092] Based on the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0093] It is worth noting that in the embodiments of the search device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of this application.
[0094] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.
Claims
1. A CDN access method, characterized in that, Applied to edge nodes, including: Obtain a Content Delivery Network (CDN) access request for accessing a target URL; wherein the CDN access request includes the Internet Protocol (IP) address of the request initiator; Obtain the cumulative number of times the IP address of the request initiator accesses each candidate response node; Based on the cumulative number of visits, a target response node is selected from the candidate response nodes to access the target URL through the target response node; The step of selecting a target response node from the candidate response nodes based on the cumulative access count includes: selecting a target response node from the candidate response nodes whose cumulative access count is lower than the preset access threshold based on the cumulative access count and a preset access threshold.
2. The method according to claim 1, characterized in that, The step of selecting a target response node from candidate response nodes whose cumulative access counts are lower than the preset access threshold, based on the cumulative access counts and the preset access threshold, includes: Determine the difference between the cumulative number of visits and the preset access threshold; The target response node is selected from the candidate response nodes based on the differences described.
3. The method according to claim 2, characterized in that, The step of selecting the target response node from the candidate response nodes based on the differences includes: Sort the differences in descending order, and select the largest difference from the first M values in the sorted list, either randomly or at a specified position. The candidate response node corresponding to the larger value among the differences is selected as the target response node.
4. The method according to claim 1, characterized in that, The method further includes: The preset access threshold is determined according to the Distributed Denial-of-Service Protocol and / or the Denial-of-Service Protocol.
5. The method according to claim 1, characterized in that, After selecting the target response node from the candidate response nodes based on the cumulative number of visits, the method further includes: Update the cumulative access count corresponding to the target response node.
6. The method according to any one of claims 1-5, characterized in that, Each of the candidate response nodes is a public node.
7. A CDN access device, characterized in that, Configured on edge nodes, including: The CDN access request acquisition module is used to acquire content delivery network (CDN) access requests for accessing a target domain name; wherein, the CDN access request includes the Internet Protocol address (IP address) of the target domain name. The cumulative access count acquisition module is used to acquire the cumulative access count of the IP address of the requested target domain name to each candidate response node; The target response node selection module is used to select a target response node from the candidate response nodes based on the cumulative number of accesses, so as to access the target domain name through the target response node; The step of selecting a target response node from the candidate response nodes based on the cumulative access count includes: selecting a target response node from the candidate response nodes whose cumulative access count is lower than the preset access threshold based on the cumulative access count and a preset access threshold.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the CDN access method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the CDN access method as described in any one of claims 1-6.
Citation Information
Patent Citations
Network content resource scheduling method, domain name scheduling server and electronic equipment
CN111614736A
Proxy IP address allocation method and device, computer equipment and readable storage medium
CN111683163A