CN113497817B - Traffic scheduling method and device, edge node of CDN (content delivery network) and server - Google Patents
Traffic scheduling method and device, edge node of CDN (content delivery network) and server Download PDFInfo
- Publication number
- CN113497817B CN113497817B CN202010205012.3A CN202010205012A CN113497817B CN 113497817 B CN113497817 B CN 113497817B CN 202010205012 A CN202010205012 A CN 202010205012A CN 113497817 B CN113497817 B CN 113497817B
- Authority
- CN
- China
- Prior art keywords
- edge node
- access request
- resource access
- node
- traffic
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a traffic scheduling method, a traffic scheduling device, an edge node of a CDN (content delivery network) and a server; wherein, the method comprises the following steps: receiving a resource access request of a user; and determining a target node according to a flow scheduling strategy prestored in the edge node, and returning resource data corresponding to the resource access request to the user through the target node. In the invention, after receiving the resource access request of a user, the edge node directly determines that the edge node or other edge nodes indicated by the flow scheduling policy provide resource data corresponding to the resource access request according to the flow scheduling policy prestored by the edge node. Compared with the central 302 scheduling, the invention can realize the traffic scheduling at the edge node without accessing all the requests to the scheduling server, thereby improving the traffic scheduling efficiency.
Description
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a traffic scheduling method and apparatus, an edge node of a CDN network, and a server.
Background
In the related art, a traffic scheduling manner of an edge node in a Content Delivery Network (CDN) generally adopts DNS (Domain Name System) scheduling or center 302 scheduling; the DNS scheduling has high dependence on local DNS (local recursive domain name server), and the scheduling accuracy of the traffic is low; when the central 302 scheduling method is adopted, the user requests all need to access the scheduling server, and the delay of the first packet of the requested data is long, which results in the reduction of the traffic scheduling efficiency.
Disclosure of Invention
In view of this, the present invention provides a traffic scheduling method and apparatus, an edge node of a CDN network, and a server, so as to improve efficiency and accuracy of traffic scheduling of the edge node.
In a first aspect, an embodiment of the present invention provides a traffic scheduling method, where the method is applied to an edge node of a CDN network; the method comprises the following steps: receiving a resource access request of a user; determining a target node according to a flow scheduling strategy prestored in the edge node, and returning resource data corresponding to the resource access request to the user through the target node; the flow scheduling policy is used for indicating an edge node providing resource data corresponding to the resource access request; the target node is: and providing the edge node of the resource data corresponding to the resource access request.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the edge node is in communication connection with a preset scheduling server; the traffic scheduling policy is obtained by the following steps: inquiring a scheduling server whether a traffic scheduling strategy of the current edge node exists or not; and if the traffic scheduling strategy of the current edge node exists, acquiring the traffic scheduling strategy of the current edge node from the scheduling server, and storing the acquired traffic scheduling strategy.
With reference to the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where the determining, according to a traffic scheduling policy prestored in an edge node, a target node includes: and determining the current edge node as a target node according to a flow scheduling strategy prestored in the edge node, or determining the target node from the edge nodes except the current edge node.
With reference to the second possible implementation manner of the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where the determining, according to a traffic scheduling policy pre-stored by an edge node, a current edge node as a target node, or determining a target node from edge nodes other than the current edge node includes: judging whether the resource access request is matched with a flow scheduling strategy prestored by the edge node; and if the current edge node is matched with the target node, determining the current edge node as the target node according to the traffic scheduling strategy, or determining the target node from the edge nodes except the current edge node.
With reference to the third possible implementation manner of the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where the traffic scheduling policy includes: the request condition of the resource access request needing flow scheduling; the request condition comprises a specified access domain name and specified line information; before the step of determining whether the resource access request matches a traffic scheduling policy pre-stored in the edge node, the method further includes: obtaining line information of a resource access request; the step of determining whether the resource access request matches a traffic scheduling policy pre-stored in the edge node includes: judging whether an access domain name and line information corresponding to the resource access request can be inquired from a flow scheduling strategy prestored from the edge node; and if the query is received, determining that the resource access request is matched with a traffic scheduling policy prestored by the edge node.
With reference to the third possible implementation manner of the first aspect, an embodiment of the present invention provides a fifth possible implementation manner of the first aspect, where the traffic scheduling policy includes: the request condition of the resource access request needing flow scheduling; providing a first traffic weight of resource data corresponding to the resource access request meeting the request condition through the current edge node, and providing a second traffic weight of the resource data corresponding to the resource access request meeting the request condition through a specified edge node except the current edge node; the request condition comprises a specified access domain name and specified line information; the step of determining the current edge node as the target node according to the traffic scheduling policy, or determining the target node from edge nodes other than the current edge node, includes: and determining the current edge node as a target node or determining the designated edge node as the target node according to the first traffic weight and the second traffic weight.
With reference to the fourth possible implementation manner of the first aspect, an embodiment of the present invention provides a sixth possible implementation manner of the first aspect, where the step of determining, by using a traffic scheduling policy, a target node from edge nodes other than a current edge node includes: and determining the edge node corresponding to the access domain name and the line information inquired from the flow scheduling strategy as a target node.
With reference to the third possible implementation manner of the first aspect, an embodiment of the present invention provides a seventh possible implementation manner of the first aspect, where the method further includes: and if the resource access request is not matched with the flow scheduling strategy prestored in the edge node, determining the current edge node as a target node.
With reference to the second possible implementation manner of the first aspect, an embodiment of the present invention provides an eighth possible implementation manner of the first aspect, where the method further includes: if the target node is determined from the edge nodes except the current edge node and the type of the resource access request is an http request, returning a node domain name of the target node to the user so that the user can obtain resource data corresponding to the resource access request through the target node; and if the target node is determined from the edge nodes except the current edge node and the type of the resource access request is an Http request, returning the IP address of the target node to the user so that the user can obtain resource data corresponding to the resource access request through the target node.
With reference to the second possible implementation manner of the first aspect, an embodiment of the present invention provides a ninth possible implementation manner of the first aspect, where the step of determining, according to a traffic scheduling policy prestored in an edge node, a current edge node as a target node, or determining a target node from edge nodes other than the current edge node, includes: inquiring whether the resource access request carries a specified identifier or not; the designation is used to indicate: the resource access request is sent by the edge nodes except the current edge node; if the designated identifier is not carried, determining the current edge node as a target node according to a flow scheduling strategy prestored in the edge node, or determining the target node from the edge nodes except the current edge node; and if the target node is determined from the edge nodes except the current edge node, adding the specified identification in the resource access request.
With reference to the ninth possible implementation manner of the first aspect, an embodiment of the present invention provides a tenth possible implementation manner of the first aspect, where the method further includes: and if the resource access request carries the specified identifier, determining the current edge node as the target node.
In a second aspect, an embodiment of the present invention provides a traffic scheduling method, where the method is applied to a scheduling server; the scheduling server is in communication connection with the edge node of the CDN network; the method comprises the following steps: acquiring current flow and preset planning flow of each edge node in the CDN; generating a flow scheduling strategy of the edge nodes according to the current flow and the preset planning flow of each edge node in the CDN; providing a flow scheduling strategy corresponding to the edge node for the edge node, so that after the edge node receives a resource access request of a user, the edge node determines a target node according to the provided flow scheduling strategy, and returns resource data corresponding to the resource access request to the user through the target node; the flow scheduling policy is used for indicating an edge node which provides resource data corresponding to the resource access request; the target node is: and providing the edge node of the resource data corresponding to the resource access request.
With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where the step of generating a traffic scheduling policy of an edge node according to a current traffic and a preset planning traffic of each edge node in the CDN network includes: for each edge node, if the current flow of the current edge node is greater than or equal to the preset planning flow, generating a flow scheduling strategy of the current edge node; the flow scheduling strategy comprises a request condition of a resource access request needing flow scheduling and an edge node corresponding to the request condition; wherein the request condition includes a specified access domain name and a specified line.
With reference to the first possible implementation manner of the second aspect, an embodiment of the present invention provides a second possible implementation manner of the second aspect, where the step of generating a traffic scheduling policy of a current edge node includes: determining a first traffic weight of resource data corresponding to the resource access request meeting the request condition provided by the current edge node according to the difference value between the current traffic of the current edge node and the preset planning traffic, and determining a second traffic weight of the resource data corresponding to the resource access request meeting the request condition provided by the specified edge node except the current edge node; and storing the first traffic weight and the second traffic weight in association with the request condition.
In a third aspect, an embodiment of the present invention provides a traffic scheduling apparatus, where the apparatus is disposed at an edge node of a CDN network; the device includes: the request receiving module is used for receiving a resource access request of a user; the target node determining module is used for determining a target node according to a flow scheduling strategy prestored by the edge node so as to return resource data corresponding to the resource access request to the user through the target node; the flow scheduling policy is used for indicating an edge node providing resource data corresponding to the resource access request; the target node is: and providing the edge node of the resource data corresponding to the resource access request.
In a fourth aspect, an embodiment of the present invention provides a traffic scheduling apparatus, where the apparatus is disposed in a scheduling server; the scheduling server is in communication connection with the edge node of the CDN network; the device comprises: the flow obtaining module is used for obtaining the current flow and the preset planning flow of each edge node in the CDN; the policy generation module is used for generating a traffic scheduling policy of the edge node according to the current traffic and preset planning traffic of each edge node in the CDN network; the policy providing module is used for providing a traffic scheduling policy corresponding to the edge node, so that after the edge node receives a resource access request of a user, the edge node determines a target node according to the provided traffic scheduling policy, and returns resource data corresponding to the resource access request to the user through the target node; wherein, the target node is: and providing the edge node of the resource data corresponding to the resource access request.
In a fifth aspect, an embodiment of the present invention provides an edge node of a CDN network, including a processor and a memory, where the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the traffic scheduling method.
In a sixth aspect, an embodiment of the present invention provides a server, including a processor and a memory, where the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the traffic scheduling method.
In a seventh aspect, an embodiment of the present invention provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above traffic scheduling method.
The embodiment of the invention has the following beneficial effects:
when the edge node of the CDN receives a resource access request of a user, a target node is determined according to a traffic scheduling strategy prestored by the edge node, so that resource data corresponding to the resource access request is returned to the user through the target node; the target node is an edge node which provides resource data corresponding to the resource access request. In this way, after receiving a resource access request of a user, an edge node of the CDN network directly determines, according to a traffic scheduling policy pre-stored by the edge node, that the current edge node or another edge node indicated by the traffic scheduling policy provides corresponding resource data to the resource access request. Compared with the mode of central 302 scheduling, the above mode can realize traffic scheduling at the edge node without making all requests access the scheduling server, thereby improving the traffic scheduling efficiency.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention as set forth hereinafter.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic view of an application scenario of traffic scheduling applied to authorized DNS scheduling according to an embodiment of the present invention;
fig. 2 is a schematic view of an application scenario of traffic scheduling applied to the center 302 scheduling according to an embodiment of the present invention;
fig. 3 is a schematic view of an application scenario of another traffic scheduling according to an embodiment of the present invention;
fig. 4 is a flowchart of a traffic scheduling method according to an embodiment of the present invention;
fig. 5 is a flowchart of another traffic scheduling method according to an embodiment of the present invention;
fig. 6 is a flowchart of another traffic scheduling method according to an embodiment of the present invention;
fig. 7 is a flowchart of another traffic scheduling method according to an embodiment of the present invention;
fig. 8 is a schematic diagram illustrating an interaction process of a user terminal, a DNS scheduling policy service, an edge 302 scheduling policy service, and a CDN edge node in another traffic scheduling method according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a traffic scheduling apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another traffic scheduling apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
For the sake of understanding, an application scenario of traffic scheduling is first shown, and as shown in fig. 1, the scenario is applicable to a process of DNS scheduling of an edge node; the scene comprises a user terminal, a local DNS, an authorized DNS and a CDN edge node. The user terminal may be a computer or a mobile terminal (such as a tablet computer, a mobile phone, etc.), and the user terminal is installed with a client or a browser. The local DNS is a local recursive domain name server, and after a user terminal sends a resource access request, the local DNS in communication connection with the user terminal processes the resource access request to obtain an access address of the server corresponding to the resource access request. The authoritative DNS is an authoritative domain name server (also called an authoritative domain name server), and domain name information of the setting server is stored in the authoritative DNS. The CDN edge node belongs to a content delivery network; the content distribution network is an intelligent virtual network established on the basis of the existing network, and users can obtain required content nearby by means of functional modules such as load balancing, content distribution, scheduling and the like of a central platform by means of edge servers (equivalent to the CDN edge nodes) deployed in various places, so that network congestion is reduced, and the access response speed and hit rate of the users are improved.
After a user terminal sends a resource access request, a local DNS firstly acquires a website which the user terminal wants to access, such as www.xyz.123.com, from the resource access request, sequentially inquires (firstly inquires the website) each level of domain name servers in a domain name system or reads historical data (not firstly inquires the website) from a cache to obtain an access address of an authorized domain name server of the website, and finally inquires to the authorized domain name server to obtain a server access address corresponding to the website which the user terminal wants to access; and the user terminal directly accesses the server access address to obtain resource data corresponding to the resource access request.
In the case where the resource acquisition process is combined with a content delivery network, a server access address corresponding to a web address that the user terminal wants to access is an access address of an edge node, and in order for a user to acquire a desired content nearby, CDN edge nodes of a set website are generally set in a plurality of regions, and resource data of the set website is synchronously stored in each CDN edge node. The scheduling server can generate a corresponding scheduling strategy according to the planned flow and the actual flow of the CDN edge node, and send the scheduling strategy to a corresponding authorized DNS, after receiving the inquiry of the local DNS on the access address of a set website, the authorized DNS can return the access address of a certain CDN edge node to the local DNS according to the scheduling strategy, and the process is the process of DNS scheduling of the edge node; in the method, the local DNS is used for communicating with the authorized DNS, and the authorized DNS is mainly used for distributing CDN edge nodes according to the IP address of the local DNS instead of the IP address of the user terminal, so that the method has high dependence on the local DNS and is not suitable for accurate flow control, and the error between actual scheduling flow and expected flow is large.
As shown in fig. 2, it is another application scenario of traffic scheduling, which is applicable to the central 302 scheduling process; the method comprises the steps that when a user terminal, a Local DNS (domain name server), a scheduling server and a CDN (content delivery network) edge node user terminal resolve a domain name through the Local DNS, an IP address is obtained, wherein the IP address is not an access address of the CDN edge node but an IP address of the scheduling server in a CDN (in practice, the scheduling server can be a scheduling machine of a CDN service manufacturer); when a user terminal sends a resource access request to a scheduling server, an accurate IP address of the user terminal is provided, and the scheduling server returns an access address of a currently most appropriate CDN edge node to the user terminal according to a set strategy (the strategy is set according to node flow, file heat, bandwidth redundancy and the like); at this time, the user terminal obtains 302 a response, and re-initiates a resource access request to the CDN edge node, thereby obtaining resource data corresponding to the resource access request. The central 302 scheduling can meet the requirement of accurate flow control, and has the defects that each request needs to access a scheduling server, the first packet delay is increased, and the error rate is increased to a certain extent.
Based on the above problems, embodiments of the present invention provide a traffic scheduling method and apparatus, an edge node of a CDN network, and a server, which may be applied to a traffic control process of a content delivery network or other distributed networks.
Firstly, the embodiment of the invention provides a traffic scheduling method, which is applied to an edge node of a CDN network and is realized based on an application scene shown in FIG. 3; the application scene comprises a user terminal, a local DNS, an authorized DNS, a CDN edge node and a scheduling server; as shown in fig. 4, the method comprises the steps of:
step S200, receiving a resource access request of a user.
The resource access request can be sent by a user through a user terminal; the resource access request usually includes the contents of access domain name, the related information of the resource to be accessed, the IP address of the user terminal sending the request, and the like; the related information of the resource to be accessed may include a storage location of the resource to be accessed, a basic description of the resource to be accessed, and the like.
Step S202, determining a target node according to a flow scheduling strategy prestored in an edge node, and returning resource data corresponding to a resource access request to a user through the target node; the flow scheduling policy is used for indicating an edge node providing resource data corresponding to the resource access request; the target node is: and providing the edge node of the resource data corresponding to the resource access request.
The traffic scheduling policy may be generally generated by a scheduling server in communication connection with the edge node, and obtained and stored by the edge node; the method comprises the steps that under the condition that a scheduling server obtains the current flow of an edge node, the scheduling server combines a preset load balancing algorithm to generate according to the current flow and the planning flow of the edge node; common load balancing algorithms include a polling method, a random polling method, a source address hashing method and the like; each algorithm has corresponding application scenes and advantages and disadvantages, for example, a polling method is suitable for services with the same machine performance, once a certain machine has poor performance, a barrel effect is likely to be generated, and machines with poor performance cannot carry more traffic. When the traffic scheduling policy is generated, a more appropriate load balancing algorithm may be selected, or several algorithms may be used in combination. In order to schedule the traffic of the edge node in a timely manner, the traffic scheduling policy is usually updated at a set frequency, such as once every minute.
In general, the traffic scheduling policy generally includes access addresses of the current edge node and other target nodes and traffic weights corresponding to the nodes; the traffic weight may be determined according to the planned traffic (also referred to as planned bandwidth) of the current edge node and the historical actual traffic. For example, the monthly planned traffic of the current edge node is 40G, while the historical actual traffic is 50G per month, in order to make the monthly actual traffic of the current edge node closer to the planned traffic, the traffic weight of the current edge node may be set to 0.8, and the traffic weights of other target nodes may be set to 0.2; when a plurality of other target nodes are provided, in the traffic scheduling policy, the sum of the traffic weights of the plurality of other target nodes is 0.2; the traffic weight of each other target node may be determined based on the planned traffic and the historical actual traffic of the node. After the current edge node determines the target node according to the pre-stored traffic scheduling policy and responds to the resource access request, the ratio of the actual traffic processed by the current edge node to the actual traffic processed by other target nodes is similar to the traffic weight ratio of each node in the traffic scheduling policy, so that the adjustment of the actual traffic of the current edge node is realized, and the actual traffic is closer to the planned traffic.
When other edge nodes are used as target nodes according to a traffic scheduling policy, sending an access address of the target node to a user terminal, which may be referred to as primary edge 302 scheduling; after obtaining the corresponding 302 response, the user terminal sends a resource access request to the target node to obtain resource data corresponding to the request.
In conjunction with the above description, the resource access request received by the current edge node may be a resource access request scheduled at the edge 302; at this time, the resource access request usually carries the contract identifier scheduled by the edge 302. In the traffic scheduling policy, the number of times a resource access request can be scheduled by the edge 302 may be set; since edge 302 scheduling also consumes a certain amount of time and resources, it is usually set that a resource access request can be scheduled by edge 302 at most once. In this case, when the resource access request received by the current edge node has been scheduled by the edge 302, the current edge node is directly determined as the target node, and corresponding resource data is provided for the resource access request.
In the traffic scheduling method, when the edge node receives a resource access request of a user, a target node is determined according to a traffic scheduling policy pre-stored by the edge node, so that resource data corresponding to the resource access request is returned to the user through the target node; the target node is an edge node which provides resource data corresponding to the resource access request. In this way, after receiving a resource access request of a user, an edge node of the CDN network directly determines, according to a traffic scheduling policy pre-stored by the edge node, that the edge node or another edge node indicated by the traffic scheduling policy provides corresponding resource data to the resource access request. Compared with the mode of central 302 scheduling, the above mode can realize traffic scheduling at the edge node without making all requests access the scheduling server, thereby improving the traffic scheduling efficiency.
The embodiment of the invention also provides another flow scheduling method, which is realized on the basis of the method of the embodiment; the method mainly describes a specific implementation process of determining a target node according to a traffic scheduling policy prestored in an edge node (implemented by the following steps S304-S306), and as shown in fig. 5, the method includes the following steps:
step S300, receiving a resource access request of a user.
Step S302, inquiring whether the resource access request carries a specified identifier; the designation of the identity is used to indicate: the resource access request is sent through the edge nodes except the current edge node; if so, executing step S304; if not, go to step S306.
The specified identifier can be an identifier such as a specified character arranged at an appointed position of the resource access request; when the specified identifier is found in the resource access request, it indicates that the resource access request was sent to an edge node other than the current edge node, that is, the resource access request has been scheduled by the edge 302; the above specified identities may be added to the resource access request by the edge node performing edge 302 scheduling.
And step S304, determining the current edge node as a target node, and returning resource data corresponding to the resource access request to the user through the target node. And (6) ending.
If the current edge node can provide resource data corresponding to the resource access request, determining the current edge node as a target node; and returning resource data corresponding to the data access request according to the related information of the resource to be accessed in the resource access request, such as a storage position or basic description.
Step S306, according to the flow scheduling strategy pre-stored by the edge node, determining the current edge node as the target node, or determining the target node from the edge nodes except the current edge node, so as to return the resource data corresponding to the resource access request to the user through the target node.
In a content distribution network, an edge node is in communication connection with a preset scheduling server; the edge node can directly inquire and obtain the flow scheduling strategy from the scheduling server; specifically, the traffic scheduling policy may be obtained by:
(1) Inquiring a scheduling server whether a traffic scheduling strategy of the current edge node exists or not; the current edge node can inquire the scheduling server at a certain preset frequency, and the preset frequency can be consistent with the frequency of the traffic scheduling strategy generated by the scheduling server or set according to requirements.
(2) If the traffic scheduling strategy of the current edge node exists, the traffic scheduling strategy of the current edge node is obtained from a scheduling server, and the obtained traffic scheduling strategy is stored; in general, the scheduling server generates a traffic scheduling policy for an edge node whose current traffic equals or exceeds the planned traffic, and for an edge node that does not generate a corresponding traffic scheduling policy, the edge nodes acquire the traffic scheduling policy from the scheduling server, and the acquired policy is a blank policy.
The traffic scheduling policy generally includes access addresses of the current edge node and other target nodes and traffic weights corresponding to the nodes; and when the current edge node is determined to be the target node or other edge nodes are determined to be the target nodes according to the traffic scheduling strategy prestored in the edge node, allocating response work of the resource access request to the current edge node or other edge nodes according to the proportion of the traffic weight. For example, when 10 resource access requests are received, if the traffic weights of the current edge node and other edge nodes are 0.8 and 0.2, respectively, it is determined that the current edge node serves as a target node of 8 resource access requests and responds to the 8 resource access requests, and other edge nodes serve as target nodes of the remaining 2 resource access requests and respond to the 2 resource access requests.
If, after receiving a resource access request, a target node is determined from the edge nodes except the current edge node based on the step S306, a specific identifier needs to be added to the resource access request to indicate that the resource access request has been scheduled by the edge 302.
And if the target node is determined from the edge nodes except the current edge node, the current edge node needs to determine that the type of the resource access request is an Http request or an Http request. The http request is Hypertext Transfer over Secure Socket Layer or Hypertext Transfer Protocol Secure; the Http request is a hypertext Transfer Protocol (hypertext Transfer Protocol). The URL (Uniform Resource Locator) of the HTTPS request is started with HTTPS:// and the URL of the HTTP is started with HTTP:// so that the type of the Resource access request can be determined by the URL at the start of the Resource access request.
If the target node is determined from the edge nodes except the current edge node and the type of the resource access request is an http request, returning a node domain name of the target node to the user so that the user can obtain resource data corresponding to the resource access request through the target node; specifically, when the type of the resource access request is an http request, the security requirement is high, and correspondingly, the node domain name of the target node may be returned to the user, so that the user accesses the target node according to the node domain name, thereby obtaining resource data corresponding to the resource access request.
If the target node is determined from the edge nodes except the current edge node and the type of the resource access request is an Http request, returning the IP address of the target node to the user so that the user can obtain resource data corresponding to the resource access request through the target node; when the type of the resource access request is an http request, the security requirement is low, and correspondingly, the IP address of the target node can be directly returned to the user, so that the user can access the target node to obtain the resource data corresponding to the resource access request.
After receiving a resource access request of a user, the traffic scheduling method queries whether the resource access request carries an assigned identifier, judges whether the resource access request has been scheduled by the edge 302, and directly provides corresponding resource data by taking a current edge node as a target node if the resource access request carries the assigned identifier; if not, judging whether the current edge node can provide resource data corresponding to the resource access request or not according to a flow scheduling strategy prestored by the edge node and the flow of the current edge node; if the current edge node can be provided, the current edge node is used as a target node to provide corresponding resource data; if the resource data can not be provided, determining other edge nodes capable of providing the resource data as target nodes; at the moment, when the type of the resource access request is an http request, returning a node domain name of the target node to the user; the type of the resource access request is an Http request, and an IP address of a target node is returned to the user; and the user can obtain the resource data corresponding to the resource access request through the target node. In this way, the edge node determines whether to provide corresponding resource data by itself according to the edge 302 scheduling condition of the received resource access request, the current traffic condition, and a preset traffic policy, without requiring all requests to access the scheduling server, thereby improving traffic scheduling efficiency.
The embodiment of the invention also provides another flow scheduling method which is realized on the basis of the method of the embodiment; the method mainly describes a specific implementation process for determining whether a resource access request matches a traffic scheduling policy pre-stored by an edge node (implemented by the following steps S404 and S406), and a specific implementation process for determining a target node according to the traffic scheduling policy pre-stored by the edge node (implemented by the following step S408), as shown in fig. 6, the method includes the following steps:
step S400, receiving a resource access request of a user.
In step S402, route information of the resource access request is acquired.
The line information includes which operator the user terminal adopts and which geographical area the user terminal belongs to; the line information can be Beijing Unicom, shanghai telecom, and the like. The line information may be obtained from the user IP address contained in the resource access request; the user IP address may be an IP address of a user terminal that sends the resource access request; the line information of the user terminal can be determined by inquiring the information of the IP address in a preset IP library.
Step S404, judging whether the access domain name and the line information corresponding to the resource access request can be inquired from the flow scheduling strategy pre-stored by the edge node; if yes, executing step S406; if not, step S410 is executed.
The above-mentioned judging process is mainly used for judging whether the resource access request is matched with the traffic scheduling policy prestored in the edge node. The edge node may save the resource data of more than one website, and the traffic scheduling policy pre-stored by the edge node may only address the resource access request of one or several websites. If a website only has the edge node as its server, the traffic scheduling policy does not include the scheduling policy for the request for accessing the website resource.
The access domain name and the line information can be obtained from a resource access request; the traffic scheduling policy comprises a request condition of a resource access request needing traffic scheduling; the request condition includes a specified access domain name and specified route information. In the flow scheduling strategy, whether the access domain name and the line information in the resource access request exist is searched; if yes, the flow scheduling strategy contains a scheduling strategy aiming at the resource access request; if not, the traffic scheduling policy does not contain the scheduling policy for the resource access request.
Step S406, determining that the resource access request matches a traffic scheduling policy pre-stored by the edge node.
In the traffic scheduling policy, if the access domain name and the line information edge node in the resource access request are found, it is determined that the resource access request is matched with the traffic scheduling policy pre-stored by the edge node. Next, it is determined whether the current edge node can provide the resource data corresponding to the resource access request according to the current traffic of the current edge node.
In addition to the request condition of the resource access request requiring traffic scheduling, the traffic scheduling policy generally includes: and providing a first traffic weight of the resource data corresponding to the resource access request meeting the request condition through the current edge node, and providing a second traffic weight of the resource data corresponding to the resource access request meeting the request condition through a specified edge node except the current edge node.
Step S408, according to the first traffic weight and the second traffic weight in the traffic scheduling policy, determining the current edge node as a target node, or determining the designated edge node as the target node, so as to return resource data corresponding to the resource access request to the user through the target node. And (6) ending.
Specifically, the first traffic weight may represent a proportion of resource data corresponding to resource access requests that can be provided by the current edge node and satisfy the request condition in the resource data corresponding to the resource access request received by the current edge node, and similarly, the second traffic weight may represent a proportion of resource data corresponding to resource access requests that can be provided by a specific edge node other than the current edge node and satisfy the request condition in the resource data corresponding to the resource access request received by the current edge node. After receiving the resource access request meeting the request condition, the resource access request can be combined with the resource data provided by the current edge node and other designated edge nodes, and the current edge node or the designated edge node is selected to be determined as the target node according to the proportion of the provided resource data represented by the first traffic weight and the second traffic weight.
In the flow scheduling strategy, an edge node corresponding to an access domain name and line information in a current resource access request is a designated edge node; therefore, when the target node is determined from the edge nodes except the current edge node through the traffic scheduling policy, the edge node corresponding to the access domain name and the line information queried in the traffic scheduling policy may be determined as the target node.
Step S410, determining that the resource access request is not matched with a flow scheduling strategy pre-stored by the edge node, determining the current edge node as a target node, and returning resource data corresponding to the resource access request to the user through the target node.
After receiving a resource access request of a user, the traffic scheduling method firstly determines whether the resource access request is matched with a traffic scheduling policy prestored by an edge node according to an access domain name, line information and the type of a user IP address corresponding to the request; if the current flow is matched with the preset planning flow, determining whether the current edge node can provide the resource data corresponding to the resource access request or not by judging whether the current flow is smaller than the preset planning flow of the current edge node or not; if the current edge node can be provided, the current edge node is used as a target node to provide corresponding resource data; if the resource data can not be provided, other edge nodes which can provide the resource data are determined to be used as target nodes, so that the user can obtain the resource data corresponding to the resource access request through the target nodes. In the method, before the scheduling judgment of the edge 302 is carried out, whether the resource access request is matched with the traffic scheduling strategy prestored by the edge node is judged, and if the resource access request is not matched with the traffic scheduling strategy prestored by the edge node, scheduling is not needed, so that the traffic scheduling efficiency is improved.
The embodiment of the invention also provides another flow scheduling method, which is applied to a scheduling server; the scheduling server is in communication connection with an edge node of the CDN network; the method is realized on the basis of the method of the embodiment; as shown in fig. 7, the method comprises the steps of:
step S500, obtaining current traffic and preset planning traffic of each edge node in the CDN network.
Specifically, a query request may be sent to each edge node, and a current traffic returned by the edge node is received; the preset planning flow of each edge node may be stored in a preset storage location of the scheduling server in advance, or may be input to the scheduling server by a relevant technician through a human-computer interaction device such as a mouse and a keyboard.
Step S502, generating a flow scheduling strategy of the edge node according to the current flow and the preset planning flow of each edge node in the CDN;
specifically, for each edge node, if the current flow of the current edge node is greater than or equal to the preset planning flow, a flow scheduling strategy of the current edge node is generated; the flow scheduling strategy comprises a request condition of a resource access request needing flow scheduling and an edge node corresponding to the request condition; wherein the request condition includes a specified access domain name and a specified line. The generated traffic scheduling can be generated based on a preset load balancing algorithm, such as a polling method, a random polling method, a source address hashing method and the like; each algorithm has corresponding application scenes and advantages and disadvantages, and a more appropriate load balancing algorithm can be selected or combined for use. In order to schedule the traffic of the edge node in a timely manner, the traffic scheduling policy is usually updated at a set frequency, such as once every minute.
The step S502 is specifically implemented by the following steps:
(1) And determining a first traffic weight of the resource data corresponding to the resource access request meeting the request condition provided by the current edge node according to the difference value between the current traffic of the current edge node and the preset planning traffic, and determining a second traffic weight of the resource data corresponding to the resource access request meeting the request condition provided by the specified edge node except the current edge node.
(2) And storing the first traffic weight and the second traffic weight in association with the request condition.
Step S504, providing a traffic scheduling policy corresponding to the edge node, so that after the edge node receives the resource access request of the user, the edge node determines a target node according to the provided traffic scheduling policy, and returns resource data corresponding to the resource access request to the user through the target node; wherein, the target node is: and providing the edge node of the resource data corresponding to the resource access request.
When receiving the query of the edge node about the traffic scheduling policy of the edge node, sending the generated traffic scheduling policy corresponding to the edge node; when the edge node receives a resource access request of a user, a target node is determined according to a flow scheduling strategy provided by a scheduling server, and resource data corresponding to the resource access request is returned to the user through the target node.
After the current flow and the preset planning flow of each edge node in the CDN are obtained, a flow scheduling strategy of the edge node is generated according to the current flow and the preset planning flow of each edge node in the CDN, and the flow scheduling strategy corresponding to the edge node is provided for the edge node, so that after the edge node receives a resource access request of a user, a target node is determined according to the provided flow scheduling strategy, and resource data corresponding to the resource access request is returned to the user through the target node. In the method, the scheduling server provides the scheduling policy to the edge node with the current flow greater than or equal to the preset planning flow, and after receiving the resource access request of the receiving user, the edge node directly determines that the edge node or other edge nodes indicated by the flow scheduling policy provide corresponding resource data to the resource access request according to the flow scheduling policy prestored in the edge node, so that the scheduling efficiency of the flow of the edge node is improved, and meanwhile, the accuracy of the flow is also improved.
The embodiment of the invention also provides another flow scheduling method, which is realized on the basis of the method of the embodiment; the method combines DNS scheduling and the edge 302 scheduling to act on CDN edge nodes; DNS scheduling may be implemented by a DNS scheduling policy module and edge 302 scheduling may be implemented by an edge 302 scheduling policy module.
In the related art, when only the DNS scheduling policy is used for traffic scheduling, the DNS scheduling policy module generates the DNS scheduling policy according to the node bandwidth plan, and issues the DNS scheduling policy to the authorized DNS, so that a relatively coarse traffic scheduling effect is achieved, and the actual bandwidth and the expected planned bandwidth of the node are still relatively different after the policy execution is completed. In the method provided by the embodiment of the present invention, the edge 302 scheduling policy module will continue to find all nodes whose bandwidths exceed the plan, and generate a scheduling policy for each node, where the policy is to schedule the bandwidths that exceed the plan to nodes that do not reach the plan. The policy is issued to the CDN edge node, and the edge node schedules the small number of request edges 302 to the underdeveloped nodes according to the scheduling policy.
When the method is applied to the application scenario shown in fig. 3, the interaction process of the user terminal, the DNS scheduling policy service, the edge 302 scheduling policy service, and the CDN edge node is shown in fig. 8; the DNS scheduling policy service and the edge 302 scheduling policy service can be arranged in a scheduling server, and the DNS service comprises an authorized DNS and a local DNS; the method specifically comprises the following steps:
1. a central DNS scheduling policy service generates a scheduling policy and sends the scheduling policy to a DNS; specifically, the DNS scheduling policy service will generate a global scheduling plan according to the planned bandwidth (equivalent to the planned traffic) of each node and the current actual traffic bandwidth (equivalent to the actual traffic), and the scheduling plan will issue to the authoritative DNS; the scheduling plan indicates from which edge node the user can obtain resources.
2. After a user sends a resource access request through a user terminal, domain name resolution is firstly carried out through a local DNS, and the local DNS acquires an access address of a corresponding CDN edge node 1 from a cache (under the condition that the website is not inquired for the first time and the cache is not overdue) or acquires an IP address of the CDN edge node 1 through authorized DNS resolution.
3. The user terminal transmits an access request to the CND edge node 1.
4. The CND edge node 1 determines to directly serve the request according to the scheduling policy provided by the edge 302 scheduling policy module, or performs edge 302 scheduling on the request to other CDN edge nodes; if edge 302 scheduling is not needed, end.
5. The edge 302 scheduling policy service provides edge 302 scheduling policies to CDN edge nodes at a certain frequency.
Specifically, the edge 302 scheduling policy service reads the planned bandwidth and the actual bandwidth of each edge node, and for edge nodes with inconsistent actual bandwidths and planned bandwidths, scheduling policies are generated for the edge nodes, the scheduling policies are generated according to node dimensions, each edge node policy is different, and the scheduling policies are issued to the nodes for execution. The format of the scheduling policy may be the following format:
wherein, "domain": a.com "indicates that the access domain name in the policy is" a.com "; regions represent network areas, and the "line information" represents actual line information, such as beijing unicom; default _ weight is a policy weight, the specific value is 20000, servers are other edge nodes except the current edge node and can correspond to the current resource access request, and the edge nodes are equivalent to the designated edge node; in the strategy, when the request is an http request, the http request node address can be redirected to the edge node, and when the request is an https request, the htweight can be redirected to the https request node address 500. The format is only an example, and can be set according to requirements when being implemented specifically.
The default _ weight may be understood as the first traffic weight in the foregoing embodiment, and the weight may be understood as the second traffic weight in the foregoing embodiment; com, for the resource access request with the access domain name of a.com and the line information conforming to the value of the region, the weight of acquiring the resource through the current edge node is 20000, and the weight of acquiring the resource through the servers edge node corresponding to the http request node address or the https request node address is 500, that is, only about 2.4% of the resource needs to be acquired through other edge nodes, that is, about 2.4% of the resource access request needs to be scheduled 302.
6. If edge 302 scheduling is needed, CDN edge node 1 calculates which edge node the request needs to be scheduled by edge 302 to (assuming that the request is scheduled to CDN edge node 2) according to an edge 302 scheduling policy, and returns an access address (also referred to as 302 address) of the redirected edge node.
The process of the edge node executing the edge 302 scheduling policy includes the following steps:
(1) And after receiving a resource access request of a user, acquiring the requested line information through an IP library on the node.
(2) Determining whether the request was dispatched by the edge 302; if the edge 302 is scheduled, directly skipping a 302 scheduling link, namely directly returning the resource corresponding to the resource access request to the user; if not scheduled by the edge 302, the following steps continue.
(3) Searching the access domain name and the line information corresponding to the request in the edge 302 scheduling policy, and judging whether the request is matched with the edge 302 scheduling policy; skipping if not matching; if so, the following steps are continued.
(4) If the request is matched with the strategy, judging whether the request needs to be subjected to edge 302 scheduling; if the edge 302 scheduling is not needed, directly skipping the 302 scheduling link; if necessary, the following steps are continued. The above process of whether edge 302 scheduling is required can be calculated according to the policy weight, and usually only a small percentage of requests need to be rescheduled by edge 302.
(5) If the edge 302 scheduling is needed, judging whether the request is an https request or not; the http request and the https request are returned according to different formats; for example, when the request is an Https request, https:// node domain name/domain/uri is returned; when the request is an Http request, returning Http:// node IP/domain/uri.
7. The user redirects the request to a new edge node (i.e. accesses CDN edge node 2) according to the content returned by the current edge node.
In practical application, DNS scheduling errors are usually 5% -10%, edge 302 scheduling correction is only performed on the error part, most requests are scheduled according to DNS, the delay change of the whole first packet is not large, the actual scheduling effect can reach expectation, the accuracy of edge node flow scheduling is improved, and the scheduling efficiency is also improved. Furthermore, the above DNS scheduling may be replaced by the central 302 scheduling, and may be set by a technician according to requirements.
Corresponding to the embodiment of the traffic scheduling method, the embodiment of the invention also provides a traffic scheduling device, which is arranged at the edge node of the CDN network; as shown in fig. 9, the apparatus includes:
a request receiving module 700, configured to receive a resource access request of a user;
a first target node determining module 702, configured to determine a target node according to a traffic scheduling policy pre-stored in an edge node, so as to return resource data corresponding to a resource access request to a user through the target node; the flow scheduling policy is used for indicating an edge node providing resource data corresponding to the resource access request; the target node is: and providing the edge node of the resource data corresponding to the resource access request.
When an edge node of the CDN network receives a resource access request of a user, the traffic scheduling device determines a target node according to a traffic scheduling policy pre-stored in the edge node, so as to return resource data corresponding to the resource access request to the user through the target node; the target node is an edge node which provides resource data corresponding to the resource access request. In this way, after receiving a resource access request of a user, an edge node of the CDN network directly determines, according to a traffic scheduling policy pre-stored by the edge node, that the edge node or another edge node indicated by the traffic scheduling policy provides corresponding resource data to the resource access request. Compared with the mode of central 302 scheduling, the above mode can realize traffic scheduling at the edge node without making all requests access the scheduling server, thereby improving the traffic scheduling efficiency.
Specifically, the edge node is in communication connection with a preset scheduling server; the traffic scheduling policy is obtained by the following steps: inquiring whether a traffic scheduling strategy of the current edge node exists in a scheduling server; and if the traffic scheduling strategy of the current edge node exists, acquiring the traffic scheduling strategy of the current edge node from the scheduling server, and storing the acquired traffic scheduling strategy.
Specifically, the first target node determining module is further configured to: and determining the current edge node as a target node according to a flow scheduling strategy prestored in the edge node, or determining the target node from the edge nodes except the current edge node.
Specifically, the first target node determining module is further configured to: judging whether the resource access request is matched with a flow scheduling strategy prestored by the edge node; and if the current edge node is matched with the target node, determining the current edge node as the target node according to the traffic scheduling strategy, or determining the target node from the edge nodes except the current edge node.
In an actual implementation process, the traffic scheduling policy includes: the request condition of the resource access request needing flow scheduling; the request condition comprises a specified access domain name and specified line information; further, the above apparatus further comprises: the information acquisition module is used for acquiring the user IP address and the line information of the resource access request; the target node is further configured to: judging whether an access domain name and line information corresponding to the resource access request can be inquired from a flow scheduling strategy prestored from the edge node; and if the query is received, determining that the resource access request is matched with a traffic scheduling policy prestored by the edge node.
Further, the traffic scheduling policy includes: the request condition of the resource access request needing flow scheduling; providing a first traffic weight of resource data corresponding to the resource access request meeting the request condition through the current edge node, and providing a second traffic weight of the resource data corresponding to the resource access request meeting the request condition through a specified edge node except the current edge node; wherein the request condition comprises a specified access domain name and specified line information; the first target node determining module is further configured to: and determining the current edge node as a target node or determining the designated edge node as the target node according to the first traffic weight and the second traffic weight.
Further, the first target node determining module is further configured to: and determining the edge node corresponding to the access domain name and the line information inquired from the flow scheduling strategy as a target node.
Further, the above apparatus further comprises: and the second target node determining module is used for determining the current edge node as the target node if the resource access request is not matched with the flow scheduling strategy prestored by the edge node.
Further, the above apparatus further comprises: the node domain name returning module is used for returning the node domain name of the target node to the user if the target node is determined from the edge nodes except the current edge node and the type of the resource access request is an http request, so that the user can obtain resource data corresponding to the resource access request through the target node; and the IP address returning module is used for returning the IP address of the target node to the user if the target node is determined from the edge nodes except the current edge node and the type of the resource access request is an Http request, so that the user can obtain the resource data corresponding to the resource access request through the target node.
Further, the first target node determining module is further configured to: inquiring whether the resource access request carries a specified identifier or not; the designation is used to indicate: the resource access request is sent by the edge nodes except the current edge node; if the designated identifier is not carried, determining the current edge node as a target node according to a flow scheduling strategy prestored by the edge node, or determining the target node from the edge nodes except the current edge node; if the target node is determined from the edge nodes except the current edge node, the specified identification is added in the resource access request.
Further, the above apparatus further comprises: and the third target node determining module is used for determining the current edge node as the target node if the resource access request carries the specified identifier.
The traffic scheduling apparatus provided in the embodiment of the present invention has the same implementation principle and technical effect as those of the foregoing traffic scheduling method embodiment, and for brief description, reference may be made to corresponding contents in the foregoing traffic scheduling method embodiment for a part not mentioned in the embodiment of the traffic scheduling apparatus.
Corresponding to the embodiment of the traffic scheduling method, the embodiment of the invention also provides a traffic scheduling device, which is arranged in the scheduling server; the scheduling server is in communication connection with the edge node of the CDN network; as shown in fig. 10, the apparatus includes:
a traffic obtaining module 800, configured to obtain current traffic and preset planning traffic of each edge node in the CDN network;
a policy generation module 802, configured to generate a traffic scheduling policy for an edge node according to current traffic and preset planning traffic of each edge node in the CDN network;
a policy providing module 804, configured to provide a traffic scheduling policy corresponding to an edge node to the edge node, so that after the edge node receives a resource access request of a user, the edge node determines a target node according to the provided traffic scheduling policy, and returns resource data corresponding to the resource access request to the user through the target node; wherein, the target node is: and providing the edge node of the resource data corresponding to the resource access request.
After the current flow and the preset planning flow of each edge node in the CDN are obtained, the flow scheduling policy of the edge node is generated according to the current flow and the preset planning flow of each edge node in the CDN, and the flow scheduling policy corresponding to the edge node is provided for the edge node, so that after the edge node receives the resource access request of the user, the target node is determined according to the provided flow scheduling policy, and the resource data corresponding to the resource access request is returned to the user through the target node. In the method, the scheduling server provides the scheduling policy to the edge node with the current flow greater than or equal to the preset planning flow, and after receiving the resource access request of the receiving user, the edge node directly determines that the edge node or other edge nodes indicated by the flow scheduling policy provide corresponding resource data to the resource access request according to the flow scheduling policy prestored in the edge node, so that the scheduling efficiency of the flow of the edge node is improved, and meanwhile, the accuracy of the flow is also improved.
Specifically, the policy generation module is further configured to: for each edge node, if the current flow of the current edge node is greater than or equal to the preset planning flow, generating a flow scheduling strategy of the current edge node; the flow scheduling strategy comprises a request condition of a resource access request needing flow scheduling and an edge node corresponding to the request condition; wherein the request condition includes a specified access domain name and a specified line.
Further, the policy generation module is further configured to: determining a first traffic weight of resource data corresponding to the resource access request meeting the request condition provided by the current edge node according to the difference value between the current traffic of the current edge node and the preset planning traffic, and determining a second traffic weight of the resource data corresponding to the resource access request meeting the request condition provided by the specified edge node except the current edge node; and storing the first traffic weight and the second traffic weight in association with the request condition.
The traffic scheduling apparatus provided in the embodiment of the present invention has the same implementation principle and technical effect as those of the traffic scheduling method embodiment, and for brief description, reference may be made to corresponding contents in the traffic scheduling method embodiment for a part not mentioned in the traffic scheduling apparatus embodiment.
An embodiment of the present invention further provides an edge node of a CDN network, which is shown in fig. 11 and includes a processor and a memory, where the memory stores a machine executable instruction that can be executed by the processor, and the processor executes the machine executable instruction to implement the traffic scheduling method.
An embodiment of the present invention further provides a server, which has a structure the same as that of the edge node of the CDN network, and as shown in fig. 11, the server includes a processor and a memory, where the memory stores a machine executable instruction that can be executed by the processor, and the processor executes the machine executable instruction to implement the traffic scheduling method.
Further, the server shown in fig. 11 further includes a bus 132 and a communication interface 133, and the processor 130, the communication interface 133 and the memory 131 are connected through the bus 132.
The Memory 131 may include a Random Access Memory (RAM) and a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 133 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 132 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 11, but that does not indicate only one bus or one type of bus.
The processor 130 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 130. The Processor 130 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in ram, flash, rom, prom, or eprom, registers, etc. as is well known in the art. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131, and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present invention further provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the traffic scheduling method.
The traffic scheduling method and apparatus and the computer program product of the gateway server provided in the embodiments of the present invention include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: those skilled in the art can still make modifications or changes to the embodiments described in the foregoing embodiments, or make equivalent substitutions for some features, within the scope of the disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (19)
1. A flow scheduling method is characterized in that the method is applied to an edge node of a CDN network; the method comprises the following steps:
receiving a resource access request of a user;
determining a target node according to a flow scheduling policy prestored in the edge node, so as to return resource data corresponding to the resource access request to the user through the target node;
the traffic scheduling policy is used for indicating an edge node providing resource data corresponding to the resource access request; the target node is as follows: the edge node provides resource data corresponding to the resource access request;
the traffic scheduling policy comprises: the request condition of the resource access request needing flow scheduling; providing a first traffic weight of resource data corresponding to the resource access request meeting the request condition through a current edge node, and providing a second traffic weight of the resource data corresponding to the resource access request meeting the request condition through a specified edge node except the current edge node; wherein the request condition includes a specified access domain name and specified route information;
the first traffic weight represents the proportion of resource data corresponding to the resource access request which meets the request condition and is provided by the current edge node in the resource data corresponding to the resource access request received by the current edge node; the second traffic weight represents a proportion of resource data corresponding to the resource access request which can provide the resource access request meeting the request condition and is received by the current edge node in the resource data corresponding to the resource access request, wherein the resource data is provided by the designated edge node except the current edge node.
2. The method of claim 1, wherein the edge node is communicatively connected to a predetermined dispatch server; the traffic scheduling policy is obtained by:
inquiring whether a traffic scheduling strategy of the current edge node exists in the scheduling server;
and if the traffic scheduling policy of the current edge node exists, acquiring the traffic scheduling policy of the current edge node from the scheduling server, and storing the acquired traffic scheduling policy.
3. The method according to claim 1, wherein the step of determining the target node according to the traffic scheduling policy pre-stored in the edge node comprises:
and determining the current edge node as a target node according to a flow scheduling strategy prestored in the edge node, or determining the target node from the edge nodes except the current edge node.
4. The method according to claim 3, wherein the step of determining a current edge node as a target node or determining a target node from edge nodes other than the current edge node according to a traffic scheduling policy pre-stored by the edge node comprises:
judging whether the resource access request is matched with a flow scheduling strategy prestored by the edge node;
and if the current edge node is matched with the target node, determining the current edge node as the target node according to the flow scheduling strategy, or determining the target node from the edge nodes except the current edge node.
5. The method of claim 4, wherein the traffic scheduling policy comprises: the request condition of the resource access request needing flow scheduling; the request condition comprises a specified access domain name and specified line information;
before the step of determining whether the resource access request matches a traffic scheduling policy pre-stored by an edge node, the method further includes: obtaining line information of the resource access request;
the step of judging whether the resource access request is matched with a traffic scheduling policy prestored in the edge node includes: judging whether an access domain name and line information corresponding to the resource access request can be inquired from a flow scheduling strategy prestored in an edge node; and if the query is received, determining that the resource access request is matched with a traffic scheduling policy prestored by the edge node.
6. The method according to claim 4, wherein the step of determining a current edge node as a target node or determining a target node from edge nodes other than the current edge node according to the traffic scheduling policy comprises: and determining the current edge node as a target node or determining the designated edge node as the target node according to the first traffic weight and the second traffic weight.
7. The method according to claim 5, wherein the step of determining a target node from the edge nodes other than the current edge node by the traffic scheduling policy comprises: and determining the access domain name inquired from the flow scheduling strategy and the edge node corresponding to the line information as a target node.
8. The method of claim 4, further comprising: and if the resource access request is not matched with the flow scheduling strategy pre-stored by the edge node, determining the current edge node as a target node.
9. The method of claim 3, further comprising:
if a target node is determined from the edge nodes except the current edge node and the type of the resource access request is an http request, returning a node domain name of the target node to the user so that the user can obtain resource data corresponding to the resource access request through the target node;
and if a target node is determined from the edge nodes except the current edge node and the type of the resource access request is an Http request, returning the IP address of the target node to the user so that the user can obtain the resource data corresponding to the resource access request through the target node.
10. The method according to claim 3, wherein the step of determining a current edge node as a target node or determining a target node from edge nodes other than the current edge node according to a traffic scheduling policy pre-stored by the edge node comprises:
inquiring whether the resource access request carries a specified identifier; the specified identification is used for indicating that: the resource access request is sent by the edge nodes except the current edge node; if the designated identifier is not carried, determining the current edge node as a target node according to a traffic scheduling policy prestored in the edge node, or determining the target node from edge nodes except the current edge node;
and if the target node is determined from the edge nodes except the current edge node, adding the specified identification in the resource access request.
11. The method of claim 10, further comprising: and if the resource access request carries the specified identification, determining the current edge node as a target node.
12. A flow scheduling method is characterized in that the method is applied to a scheduling server; the scheduling server is in communication connection with an edge node of the CDN network; the method comprises the following steps:
acquiring the current flow and the preset planning flow of each edge node in the CDN;
generating a flow scheduling strategy of the edge node according to the current flow and the preset planning flow of each edge node in the CDN;
providing a traffic scheduling policy corresponding to the edge node, so that after receiving a resource access request of a user, the edge node determines a target node according to the provided traffic scheduling policy, and returns resource data corresponding to the resource access request to the user through the target node; the traffic scheduling policy is used for indicating an edge node providing resource data corresponding to the resource access request; the target node is as follows: the edge node provides resource data corresponding to the resource access request;
the traffic scheduling policy comprises: the request condition of the resource access request needing flow scheduling; providing a first traffic weight of resource data corresponding to the resource access request meeting the request condition through a current edge node, and providing a second traffic weight of the resource data corresponding to the resource access request meeting the request condition through a specified edge node except the current edge node; wherein the request condition includes a specified access domain name and specified route information;
the first traffic weight represents the proportion of resource data corresponding to the resource access request which meets the request condition and is provided by the current edge node in the resource data corresponding to the resource access request received by the current edge node; the second traffic weight represents a proportion of resource data corresponding to the resource access request which can provide the resource access request meeting the request condition and is corresponding to the resource access request received by the current edge node in the resource data corresponding to the resource access request, except for the current edge node.
13. The method according to claim 12, wherein the step of generating a traffic scheduling policy for an edge node according to a current traffic and a preset planning traffic of each edge node in the CDN network includes:
for each edge node, if the current flow of the current edge node is greater than or equal to the preset planning flow, generating a flow scheduling strategy of the current edge node; the traffic scheduling strategy comprises a request condition of a resource access request needing traffic scheduling and an edge node corresponding to the request condition; wherein the request condition includes a specified access domain name and specified routing information.
14. The method of claim 13, wherein the step of generating the traffic scheduling policy for the current edge node comprises:
determining a first traffic weight of resource data corresponding to the resource access request meeting the request condition provided by the current edge node according to a difference value between the current traffic of the current edge node and a preset planning traffic, and determining a second traffic weight of resource data corresponding to the resource access request meeting the request condition provided by a specified edge node except the current edge node;
and storing the first traffic weight and the second traffic weight in association with the request condition.
15. The traffic scheduling device is characterized in that the device is arranged at an edge node of a CDN network; the device comprises:
the request receiving module is used for receiving a resource access request of a user;
a first target node determining module, configured to determine a target node according to a traffic scheduling policy pre-stored in the edge node, so as to return resource data corresponding to the resource access request to the user through the target node; the traffic scheduling policy is used for indicating an edge node providing resource data corresponding to the resource access request; the target node is as follows: the edge node provides resource data corresponding to the resource access request;
the traffic scheduling policy comprises: the request condition of the resource access request needing flow scheduling; providing a first traffic weight of resource data corresponding to the resource access request meeting the request condition through a current edge node, and providing a second traffic weight of the resource data corresponding to the resource access request meeting the request condition through a specified edge node except the current edge node; wherein the request condition includes a specified access domain name and specified route information;
the first traffic weight represents the proportion of resource data corresponding to the resource access request which meets the request condition and is provided by the current edge node in the resource data corresponding to the resource access request received by the current edge node; the second traffic weight represents a proportion of resource data corresponding to the resource access request which can provide the resource access request meeting the request condition and is corresponding to the resource access request received by the current edge node in the resource data corresponding to the resource access request, except for the current edge node.
16. The flow scheduling device is characterized in that the device is arranged on a scheduling server; the scheduling server is in communication connection with an edge node of the CDN network; the device comprises:
the flow obtaining module is used for obtaining the current flow and the preset planning flow of each edge node in the CDN;
the policy generation module is used for generating a traffic scheduling policy of the edge node according to the current traffic and preset planning traffic of each edge node in the CDN network;
a policy providing module, configured to provide a traffic scheduling policy corresponding to the edge node, so that after receiving a resource access request of a user, the edge node determines a target node according to the provided traffic scheduling policy, and returns resource data corresponding to the resource access request to the user through the target node; the traffic scheduling policy is used for indicating an edge node providing resource data corresponding to the resource access request; the target node is: the edge node provides resource data corresponding to the resource access request;
the traffic scheduling policy comprises: the request condition of the resource access request needing flow scheduling; providing a first traffic weight of resource data corresponding to the resource access request meeting the request condition through a current edge node, and providing a second traffic weight of the resource data corresponding to the resource access request meeting the request condition through a specified edge node except the current edge node; wherein the request condition includes a specified access domain name and specified route information;
the first traffic weight represents the proportion of resource data corresponding to the resource access request which meets the request condition and is provided by the current edge node in the resource data corresponding to the resource access request received by the current edge node; the second traffic weight represents a proportion of resource data corresponding to the resource access request which can provide the resource access request meeting the request condition and is received by the current edge node in the resource data corresponding to the resource access request, wherein the resource data is provided by the designated edge node except the current edge node.
17. An edge node of a CDN network, comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the traffic scheduling method of any of claims 1 to 11.
18. A server comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the traffic scheduling method of any of claims 12-14.
19. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the traffic scheduling method of any of claims 1 to 14.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010205012.3A CN113497817B (en) | 2020-03-20 | 2020-03-20 | Traffic scheduling method and device, edge node of CDN (content delivery network) and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010205012.3A CN113497817B (en) | 2020-03-20 | 2020-03-20 | Traffic scheduling method and device, edge node of CDN (content delivery network) and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113497817A CN113497817A (en) | 2021-10-12 |
CN113497817B true CN113497817B (en) | 2023-04-07 |
Family
ID=77993155
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010205012.3A Active CN113497817B (en) | 2020-03-20 | 2020-03-20 | Traffic scheduling method and device, edge node of CDN (content delivery network) and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113497817B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114338705B (en) * | 2021-11-24 | 2023-12-01 | 阿里巴巴(中国)有限公司 | Resource water level control method, equipment and medium for CDN node of content delivery network |
CN116208556A (en) * | 2021-11-30 | 2023-06-02 | 中兴通讯股份有限公司 | Flow balancing method, electronic device, and computer-readable storage medium |
CN114301848B (en) * | 2021-12-10 | 2023-08-29 | 阿里巴巴(中国)有限公司 | CDN-based communication method, system, equipment and storage medium |
CN114285753B (en) * | 2021-12-27 | 2024-04-26 | 上海七牛信息技术有限公司 | CDN scheduling method and system |
CN114448960A (en) * | 2021-12-27 | 2022-05-06 | 天翼云科技有限公司 | Scheduling system, method, device, equipment and medium |
CN114598701B (en) * | 2022-02-16 | 2023-08-22 | 阿里巴巴(中国)有限公司 | CDN scheduling method, CDN scheduling system, computing device and storage medium |
CN114785794B (en) * | 2022-03-29 | 2024-07-12 | 北京字节跳动网络技术有限公司 | Resource allocation method, device, equipment, medium and system |
CN114884880B (en) * | 2022-04-06 | 2024-03-08 | 阿里巴巴(中国)有限公司 | Data transmission method and system |
CN116684468B (en) * | 2023-08-02 | 2023-10-20 | 腾讯科技(深圳)有限公司 | Data processing method, device, equipment and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105577714B (en) * | 2014-10-13 | 2019-12-13 | 中兴通讯股份有限公司 | Method and system for realizing content distribution network based on software defined network |
CN109547517B (en) * | 2017-09-22 | 2021-11-09 | 贵州白山云科技股份有限公司 | Method and device for scheduling bandwidth resources |
CN108306971B (en) * | 2018-02-02 | 2020-06-23 | 网宿科技股份有限公司 | Method and system for sending acquisition request of data resource |
CN110830564B (en) * | 2019-10-30 | 2022-11-01 | 北京金山云网络技术有限公司 | CDN scheduling method, device, system and computer readable storage medium |
-
2020
- 2020-03-20 CN CN202010205012.3A patent/CN113497817B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113497817A (en) | 2021-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113497817B (en) | Traffic scheduling method and device, edge node of CDN (content delivery network) and server | |
US11811657B2 (en) | Updating routing information based on client location | |
EP2356577B1 (en) | Request routing and updating routing information utilizing client location information | |
US9444759B2 (en) | Service provider registration by a content broker | |
US10404790B2 (en) | HTTP scheduling system and method of content delivery network | |
US20180205697A1 (en) | Managing content delivery network service providers by a content broker | |
US9734472B2 (en) | Request routing utilizing cost information | |
JP5389153B2 (en) | Method and system for requesting routing based on class | |
US10601767B2 (en) | DNS query processing based on application information | |
US8688837B1 (en) | Dynamically translating resource identifiers for request routing using popularity information | |
US9525659B1 (en) | Request routing utilizing point of presence load information | |
US20130346534A1 (en) | Point of presence managment in request routing | |
WO2021057369A1 (en) | Httpdns scheduling method and apparatus, medium, and device | |
CN117527809A (en) | Resource acquisition method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |