CN116431321A - Resource scheduling method, device, equipment and computer readable storage medium - Google Patents

Resource scheduling method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN116431321A
CN116431321A CN202210001629.2A CN202210001629A CN116431321A CN 116431321 A CN116431321 A CN 116431321A CN 202210001629 A CN202210001629 A CN 202210001629A CN 116431321 A CN116431321 A CN 116431321A
Authority
CN
China
Prior art keywords
resource
resource request
scheduling
quota
preset
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.)
Pending
Application number
CN202210001629.2A
Other languages
Chinese (zh)
Inventor
蒲文宾
年彦东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202210001629.2A priority Critical patent/CN116431321A/en
Publication of CN116431321A publication Critical patent/CN116431321A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/15Use in a specific computing environment
    • G06F2212/154Networked environment
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure relates to a resource scheduling method, apparatus, device, and computer-readable storage medium. The method comprises the following steps: receiving a resource request; determining whether a first remaining scheduling quota matched with the resource request exists, wherein the first remaining scheduling quota is determined based on the total number of other requests which are received in a preset time period and are associated with the resource request; and if the first remaining scheduling quota matched with the resource request exists, scheduling the resource request through a preset scheduling policy so that other servers respond to the resource request. The quality of service of the first server is improved.

Description

Resource scheduling method, device, equipment and computer readable storage medium
Technical Field
The disclosure relates to the field of information technology, and in particular, to a resource scheduling method, device, equipment, computer readable storage medium and system.
Background
The content delivery network (Content Delivery Network, CDN) is an intelligent virtual network built on top of an existing network. The network enables users to obtain required resources nearby through load balancing, content distribution, scheduling and other functional modules, reduces network congestion, and improves response speed and hit rate of resource requests.
The scheduling strategies commonly used by CDNs are: user requests aiming at preset domain names in user requests reaching the current CDN node (a server in the CDN is called as CDN node) are scheduled to other CDN nodes so as to prevent more user requests from being congested in the current CDN node, and therefore service quality of the current CDN node is reduced.
However, the user request is uncontrollable, and the scheduling policy commonly used in the case of user traffic burst is prone to inaccurate scheduling, resulting in reduced response speed of individual CDN nodes, thereby affecting quality of service.
Disclosure of Invention
To solve or at least partially solve the above technical problems, the present disclosure provides a resource scheduling method, apparatus, device, and computer readable storage medium to ensure the quality of service of a first server.
In a first aspect, an embodiment of the present disclosure provides a resource scheduling method, applied to a first server, where the method includes:
receiving a resource request;
determining whether a first remaining scheduling quota matched with the resource request exists, wherein the first remaining scheduling quota is determined based on the total number of other requests which are received in a preset time period and are associated with the resource request;
and if the first remaining scheduling quota matched with the resource request exists, scheduling the resource request through a preset scheduling policy so that other servers respond to the resource request.
In a second aspect, an embodiment of the present disclosure provides a resource scheduling apparatus, including:
the first receiving module is used for receiving the resource request;
a first determining module, configured to determine whether a first remaining scheduling quota matched with the resource request exists, where the first remaining scheduling quota is determined based on a total number of other requests associated with the resource request that are received within a preset period of time;
and the first scheduling module is used for scheduling the resource request through a preset scheduling strategy if a first residual scheduling quota matched with the resource request exists, so that other servers respond to the resource request.
In a third aspect, an embodiment of the present disclosure provides a resource scheduling apparatus, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method according to the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having stored thereon a computer program for execution by a processor to implement the method of the first aspect.
The embodiment of the disclosure provides a resource scheduling method, a device, equipment and a computer readable storage medium, when a resource request is received, determining whether a first residual scheduling quota matched with the resource request exists, wherein the first residual scheduling quota is determined based on the total number of other requests which are received in a preset time period and are associated with the resource request; and if the first remaining scheduling quota matched with the resource request exists, scheduling the resource request through a preset scheduling policy so that other servers respond to the resource request. In other words, when the first server receives the resource request, it searches whether there is a first remaining scheduling quota matched with the resource request, if so, it schedules the resource request to other servers, so that the other servers respond to the resource request, and the purpose of reducing the service pressure of the first server is achieved, thereby ensuring the service quality of the first server. The first remaining scheduling quota is determined based on the total number of other requests associated with the resource request and received within a preset time period; for example, if the total number of other requests associated with the resource request received in the preset time period is more, the first remaining scheduling quota is higher, so that more resource requests are scheduled to other servers, the purpose of determining the scheduling number according to the request amount of the resource request is achieved, and under the condition that the resource request is uncontrollable, the accurate scheduling of the resource request can be achieved, so that the problems that the pressure of the first server is too high, the bandwidth specification is exceeded, and the service quality is affected are avoided; the rate of responding to the request of the client for the resource is improved, so that the user experience is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a flowchart of a resource scheduling method provided in an embodiment of the present disclosure;
fig. 2 is a schematic architecture diagram of a three-layer CDN according to an embodiment of the present disclosure;
fig. 3 is a schematic view of an application scenario provided in an embodiment of the present disclosure;
fig. 4 is a schematic diagram of another application scenario provided in an embodiment of the present disclosure;
FIG. 5 is a flowchart of another resource scheduling method according to an embodiment of the present disclosure;
FIG. 6 is a flowchart of another resource scheduling method according to an embodiment of the present disclosure;
FIG. 7 is a flowchart of another resource scheduling method according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of a resource request system according to an embodiment of the disclosure;
fig. 9 is a schematic structural diagram of another resource scheduling device according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of another resource scheduling device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
Typically, the scheduling policies used by CDNs are: user requests aiming at preset domain names in user requests reaching the current CDN node (a server in the CDN is called as CDN node) are scheduled to other CDN nodes so as to prevent more user requests from being congested in the current CDN node, and therefore service quality of the current CDN node is reduced. However, the user request is not controllable, and in the case of a user service burst (for example, there are fewer user requests for preset domain names and more user requests for non-preset domain names), the common scheduling policy cannot accurately schedule the user requests for the non-preset domain names to other CDN nodes, so that the pressure of the current CDN node is higher, and the service quality of the current CDN node is further reduced. That is, the conventional scheduling policy is prone to inaccurate scheduling, resulting in a decrease in response speed of individual CDN nodes, thereby affecting quality of service.
In view of the foregoing, embodiments of the present disclosure provide a resource scheduling method, which is described below with reference to specific embodiments.
Fig. 1 is a flowchart of a resource scheduling method provided in an embodiment of the present disclosure. The method is applied to a first server, which is any edge CDN node, and is a three-layer CDN architecture shown in fig. 2, and includes an edge node 210, a middle layer node 220, an upper layer node 230, and a source station 240. The edge CDN nodes refer to servers capable of accessing resource requests issued by netizens, and the edge CDN nodes are typically deployed in each region, so that resource requests issued by netizens can be received by edge CDN nodes closest to netizens. When the edge CDN node does not have the target resource corresponding to the cache resource request, the edge CDN node requests the target resource from the middle CDN node in communication connection with the edge CDN node; if the middle CDN node does not have the target resource corresponding to the cache resource request, the middle CDN node requests the target resource to the upper CDN node; if the upper CDN node does not have the target resource corresponding to the cache resource request, the upper CDN node acquires the target resource from the source station and sends the target resource to the middle CDN node, the middle CDN node sends the target resource to the edge CDN node, and the edge CDN node sends the target resource to the client. In general terms, the first server and other servers described below are CDN nodes.
As shown in fig. 1, the specific steps of the resource scheduling method are as follows:
s101, receiving a resource request.
The resource request is a request which is sent by a user through a client for requesting resources. As shown in fig. 3, the client may be an application or a module in the terminal device 21, or the client may be the terminal device 21 itself. In particular, the client may send a resource request to the first server 22, the resource request requesting the target resource.
S102, determining whether a first residual scheduling quota matched with the resource request exists, wherein the first residual scheduling quota is determined based on the total number of other requests which are received in a preset time period and are associated with the resource request.
And S103, if a first residual scheduling quota matched with the resource request exists, scheduling the resource request through a preset scheduling strategy so that other servers respond to the resource request.
The first remaining scheduling quota refers to the number of resource requests allowed to be scheduled at the current moment, and specifically, the resource requests reaching the first server are scheduled to other servers so as to reduce the pressure of the first server. For example, the first remaining scheduling quota is 1000, then it indicates that the 1000 resource requests arriving at the first server are allowed to be scheduled to other servers at the current time, and the other servers respond to the 1000 resource requests. The preset scheduling policy may be a 302 scheduling policy.
The first remaining schedule quota is determined based on a total number of other requests associated with the resource request received within a preset time period. For example, if the total number of other requests associated with the resource request received within 1 minute is 1 million, then the first remaining schedule quota may be 1000; if the total number of other requests associated with the resource request received within 1 minute is 1000, the first remaining schedule quota may be 100; the first remaining scheduling quota is in direct proportion to the total number of other requests which are received in a preset time period and are associated with the resource request, the more the total number of other requests which are received in the preset time period and are associated with the resource request is, the larger the first remaining scheduling quota is, so that the purpose of determining the scheduling number according to the number of the resource requests is realized, the accurate scheduling of the resource requests can be realized under the condition that the resource requests are uncontrollable, and the problems that the pressure of a first server is overlarge and exceeds a bandwidth regulation line and the service quality is influenced are avoided; the rate of responding to the request of the client for the resource is improved, so that the user experience is improved.
The other requests associated with the resource request include requests requesting the same domain name.
The other servers responding to the resource request, including: if the other servers have the cache resources matched with the resource requests, the cache resources are sent to the client through the other servers; and if the other servers do not have the cache resources matched with the resource request, forwarding the resource request according to preset configuration information. The preset configuration information may refer to a topological relation between servers in the CDN network, or a communication connection relation between servers. As shown in fig. 4, the client 410 sends a resource request to the first server 420, when the first server 420 receives the resource request, and when determining that there is a first remaining scheduling quota matched with the resource request, the first server 420 schedules the resource request to the second server 430 through a preset scheduling policy, and the second server 430 responds to the resource request. Specifically, if the second server 430 has a cache resource matching the resource request, the cache resource is fed back to the client, and if the second server 430 does not have a cache resource matching the resource request, the second server 430 forwards the resource request to the third server 440 communicatively connected with the second server, and the third server 440 responds to the resource request. When the resource request is scheduled to other servers, the other servers do not schedule the resource request any more and respond to the resource request directly, so that one resource request is guaranteed to be scheduled only once, and the response speed of the resource request is prevented from being influenced due to the fact that the resource request is scheduled for many times.
It should be noted that, if there is no first remaining scheduling quota matched with the resource request, the resource request is not scheduled, but the first server responds to the resource request, specifically, if there is a cached resource corresponding to the resource request in the first server, the cached resource is directly fed back to the client, if there is no cached resource corresponding to the resource request in the first server, the first server requests a resource corresponding to the resource request to a middle CDN node (as shown in FIG. 2), if the middle CDN node does not cache the resource corresponding to the resource request, the middle CDN node requests the resource to the upper CDN node, and if the upper CDN node does not cache the resource corresponding to the resource request, the upper CDN node requests the resource to the source station, and feeds back the resource to the client through the middle CDN node and the first server.
According to the resource scheduling method provided by the embodiment, when a first server receives a resource request, whether a first residual scheduling quota matched with the resource request exists or not is searched, if the first residual scheduling quota exists, the resource request is scheduled to other servers, so that the other servers respond to the resource request, the purpose of reducing the service pressure of the first server is achieved, and the service quality of the first server is guaranteed. The first remaining scheduling quota is determined based on the total number of other requests associated with the resource request and received within a preset time period; for example, if the total number of other requests associated with the resource request received in the preset time period is more, the first remaining scheduling quota is higher, so that more resource requests are scheduled to other servers, the purpose of determining the scheduling number according to the request amount of the resource request is achieved, and under the condition that the resource request is uncontrollable, the accurate scheduling of the resource request can be achieved, so that the problems that the pressure of the first server is too high, the bandwidth specification is exceeded, and the service quality is affected are avoided; the rate of responding to the request of the client for the resource is improved, so that the user experience is improved.
Fig. 5 is a flowchart of another resource scheduling method according to an embodiment of the present disclosure. The embodiment further optimizes the resource scheduling method based on the embodiment, specifically, performs individual scheduling on the hot spot resources, so as to improve the hit rate of the CDN and reduce the source return rate. As shown in fig. 5, the method specifically comprises the following steps:
s501, receiving a resource request, and determining whether a first residual scheduling quota matched with the resource request exists.
The first remaining schedule quota is determined based on a total number of other requests associated with the resource request received within a preset time period.
S502, if a first residual scheduling quota matched with the resource request exists, determining whether a target resource corresponding to the resource request is a preset resource or not.
The preset resource may refer to a hot spot resource. A hotspot resource may refer to a resource that is requested more than a threshold number of times within a period of time, or may refer to a pre-marked resource, e.g., determined based on historical requested times.
S503, if the target resource corresponding to the resource request is determined to be the preset resource, determining a first target server through a consistent hash algorithm.
The purpose of determining the first target server through the consistent hash algorithm is to schedule the request for requesting the preset resource to a fixed server or a plurality of servers, so that the hit rate is improved, and the source return rate is reduced. For example, the preset resource is a resource a, a resource request of the first request resource a is scheduled to the first target server B by the first server, if the first target server B does not have the cache resource a, the first target server B requests the resource a from a middle layer CDN node (shown in fig. 2), if the middle layer CDN node does not have the cache resource a, the middle layer CDN node requests the resource a from an upper layer CDN node, and if the upper layer CDN node does not have the cache resource a, the upper layer CDN node requests the resource a from the source station. Through the first round source, the resource A is cached in the upper CDN node, the middle CDN node and the first target server B, when the resource request of the second request resource A reaches the first server, the first server hopes to dispatch the resource request of the second request resource A to the first target server B, because the first target server B is cached with the resource A, the resource A can be fed back to the client through the first target server B, so that the hit rate is improved, the return source rate is reduced, the speed of responding to the client to acquire the resource A is improved, and the user experience is improved. The first target server is determined by a consistent hashing algorithm for a resource request where the requested target resource is a preset resource.
S504, the resource request is sent to the first target server, so that the first target server responds to the resource request.
According to the resource scheduling method provided by the embodiment, when the first server has the first residual scheduling quota matched with the resource request, the first target server is determined by the consistent hash algorithm for the resource request requesting the preset resource, and the resource request is scheduled to the first target server, so that the first target server responds to the resource request, the hit rate can be improved, the source return rate can be reduced, the speed of acquiring the preset resource by the response client can be improved, and the user experience can be improved.
Fig. 6 is a flowchart of another resource scheduling method according to an embodiment of the present disclosure. The embodiment further optimizes the resource scheduling method based on the embodiment, specifically sets a second remaining scheduling quota for the hot spot resource, so as to prevent all the resource requests in a certain time period from being requests for the hot spot resource, and if all the requests are scheduled to other servers, the pressure of the other servers is increased, so that the scheduling number needs to be limited to a certain extent, and the stability of the whole CDN network is ensured. As shown in fig. 6, the method specifically comprises the following steps:
s601, receiving a resource request, and determining whether a first residual scheduling quota matched with the resource request exists.
The first remaining schedule quota is determined based on a total number of other requests associated with the resource request received within a preset time period.
S602, if a first residual scheduling quota matched with the resource request exists, determining whether a target resource corresponding to the resource request is a preset resource or not.
The preset resource may refer to a hot spot resource. A hotspot resource may refer to a resource that is requested more than a threshold number of times within a period of time, or may refer to a pre-marked resource, e.g., determined based on historical requested times.
In some embodiments, the determining whether the target resource corresponding to the resource request is a preset resource includes: determining a resource identifier according to the resource request; determining whether record information corresponding to the resource identifier exists in a preset file; if the record information corresponding to the resource identifier exists, determining that the target resource corresponding to the resource request is a preset resource; and if the record information corresponding to the resource identifier does not exist, determining that the target resource corresponding to the resource request is not the preset resource.
The preset file is a file which is issued to the first server by the central server in real time, so the method further comprises: and receiving the preset file sent by a central server, wherein the central server determines the preset file based on the occurrence frequency of the resource request. For example, the central server counts the number of resource requests which are sent by the client and request a certain resource in a certain time period in real time, and when the number exceeds a preset value, the certain resource is considered as a hot spot resource. Or determining whether a resource is a hot spot resource based on the historical number of requests for the resource. The preset file is issued to the first server, so that the time for the netizen to request the hot spot resource for the first time can be reduced, namely, the resource request sent by the netizen can be directly processed at the first server to determine whether the request is the request for requesting the hot spot resource, and the resource request sent by the netizen is not required to be further forwarded to the server specially responsible for determining whether the request is the request for requesting the hot spot resource for determination, namely, the complexity of the whole process from the resource initiating request to the target resource accessing process of the client is reduced, the time required by the client to request the target resource is reduced, and the initial package time is reduced.
S603, if the target resource corresponding to the resource request is determined to be the preset resource, determining whether a second residual scheduling quota matched with the resource request exists, and if the second residual scheduling quota matched with the resource request exists, determining a first target server through a consistent hash algorithm.
Wherein the second remaining scheduling quota is determined based on a total number of other requests associated with the resource request received within a preset time period. For example, if the total number of other requests associated with the resource request received within 1 minute is 1 ten thousand, then the second remaining schedule quota may be 8000; if the total number of other requests associated with the resource request received within 1 minute is 1000, the second remaining schedule quota may be 800. By setting the second remaining scheduling quota, all resource requests requesting preset resources can be prevented from being completely scheduled, so that the pressure of other servers is overlarge and exceeds bandwidth regulation lines and the like. The aim of moderate scheduling and accurate scheduling is achieved, so that the stability, availability and service quality of the whole CDN are improved.
Optionally, if there is no second remaining scheduling quota matched with the resource request, the resource request is randomly scheduled based on the setting information, so that other servers respond to the resource request. The setting information is, for example, operator information, that is, CDN nodes are divided according to operators, and the resource request is randomly scheduled among CDN nodes belonging to the same operator, so as to implement a resource scheduling policy without cross-network.
S604, the resource request is sent to the first target server, so that the first target server responds to the resource request.
According to the resource scheduling method provided by the embodiment, the second remaining scheduling quota is set for the hot spot resources, so that all the resource requests in a certain time period are requests for requesting the hot spot resources, if all the requests are scheduled to other servers, the pressure of the other servers is increased, so that the scheduling number is limited to a certain extent, the excessive pressure of the other servers and exceeding the bandwidth regulation line are avoided, the purposes of moderate scheduling and accurate scheduling are achieved, and the stability, the usability and the service quality of the whole CDN network are improved.
Fig. 7 is a flowchart of another resource scheduling method according to an embodiment of the present disclosure. The embodiment further optimizes the resource scheduling method based on the embodiment, and particularly provides an optional implementation mode for the step of determining whether a first remaining scheduling quota matched with the resource request exists; the advantage of this alternative embodiment is that: lock contention among the plurality of processes after the introduction of the first remaining schedule quota may be avoided from causing a performance degradation of the first server.
As shown in fig. 7, the method specifically comprises the following steps:
s701, receiving a resource request, and determining a current time window according to a time stamp corresponding to the resource request; and determining the remaining scheduling quota corresponding to each time window before the current time window.
S702, determining a first residual scheduling quota matched with the resource request according to the residual scheduling quota corresponding to the current time window and the residual scheduling quota corresponding to each time window before the current time window.
The initial scheduling quota corresponding to each time window is determined according to the total scheduling quota, and the total scheduling quota is determined by the central server. The first server and the other servers are CDN nodes, the central server acquires bandwidth planning of each CDN node and the total number of resource requests received by each CDN node in real time, determines proper total scheduling quota according to the bandwidth planning of each CDN node and the total number of the resource requests received by each CDN node, balances the pressure of each CDN node, and issues the determined total scheduling quota to each CDN node.
In order to avoid performance degradation of a first server caused by lock competition among a plurality of processes after quota introduction, when a resource request arrives at the first server for the first time, dividing the total scheduling quota of a domain name corresponding to the resource request into each process, and after each process obtains the scheduling quota, evenly distributing the scheduling quota into each time window according to the number of time windows and a preset time period. For example, the total scheduling quota is 1000, the first server has 10 processes, each process obtains 100 scheduling quotas, the preset time period is 5 minutes (i.e. the total number of resource requests is counted in a period of 5 minutes), the time windows are 5, and the number of the scheduling quotas obtained in each time window is 20, namely, the first time window 0-1, the second time window 1-2, the third time window 2-3, the fourth time window 3-4 and the fifth time window 4-5 are respectively. The first remaining scheduling quota is calculated in the following manner: determining which time window the resource request belongs to according to the timestamp of the resource request, for example, the resource request belongs to the third time window 2-3, and then the first remaining scheduling quota=the remaining scheduling quota of the third time window+the remaining scheduling quota of the second time window+the remaining scheduling quota of the first time window, where the remaining scheduling quota of the fourth time window is the initial scheduling quota allocated to the fourth time window, as in 20 above, and the remaining scheduling quota of the fifth time window is the initial scheduling quota allocated to the fifth time window, as in 20 above. After the resource request is scheduled, the first remaining scheduling quota needs to be updated, and a specific updating mode is as follows: starting from the first time window, finding a first time window with the remaining scheduling quota, and subtracting 1 from the scheduling quota corresponding to the time window. Specifically, the remaining scheduling quota of the first time window is determined first, and the remaining scheduling quota of the first time window is assumed to be 0; then determining the remaining scheduling quota of the second time window, assuming that the remaining scheduling quota of the second time window is 2, the second time window is the first time window with the remaining scheduling quota, subtracting 1 from the remaining scheduling quota of the second time window when updating, and updating to obtain the remaining scheduling quota of the second time window as 1. It should be noted that, if the first remaining scheduling quota matched with the resource request is not zero, the remaining scheduling quota of the third time window, the remaining scheduling quota of the fourth time window, and the remaining scheduling quota of the fifth time window should be the allocated initial scheduling quota, as described in 20 above.
In summary, the first remaining scheduling quota is updated in the following specific update manner: sequentially traversing each time window (namely traversing the first time window, then traversing the second time window and then traversing the third time window) from the beginning time window (namely the first time window) to the current time window (namely the third time window), and determining the time window (namely the second time window) with the residual scheduling quota which is traversed for the first time and is not zero as a target time window; and subtracting one from the remaining scheduling quota corresponding to the target time window. S703, if the first remaining scheduling quota is not 0, scheduling the resource request through a preset scheduling policy, so that other servers respond to the resource request.
S704, sequentially traversing all the time windows according to the sequence from the starting time window to the current time window, and determining the time window with the residual scheduling quota which is not zero and is traversed for the first time as a target time window; and subtracting one from the remaining scheduling quota corresponding to the target time window.
In the technical solution of this embodiment, in order to avoid performance degradation of the first server caused by lock contention among multiple processes after quota is introduced, when a resource request arrives at the first server for the first time, the total scheduling quota of a domain name corresponding to the resource request is split into each process, and after each process obtains the scheduling quota, the scheduling quota is evenly distributed to each time window according to the number of time windows and a preset time period.
In the above embodiment, referring to a resource request flow diagram combined with the CDN architecture as shown in fig. 8, the central server may specifically be a scheduling policy center, and the first server may be a cache (cache) node or a CDN edge node, which is denoted as a gateway. The signaling interaction process among the scheduling policy center, gateway and client is shown in fig. 8, and the process includes the following steps: the scheduling policy center pulls bandwidth planning of each CDN edge node and total number of resource requests for each domain name in real time or periodically, determines total scheduling quota suitable for each CDN edge node according to the bandwidth planning of each CDN edge node and the total number of resource requests, and sends the total scheduling quota to each CDN edge node respectively, for example, the total scheduling quota suitable for the edge node A is sent to the edge node A, specifically to a gateway corresponding to the edge node A, and the total scheduling quota suitable for the edge node B is sent to the edge node B, specifically to a gateway corresponding to the edge node B. And simultaneously, the number of time windows adapting to each CDN edge node and the policy effective time (for example, the policy effective time is 1 minute) are respectively sent to each CDN edge node. After receiving the total scheduling quota, each CDN edge node splits the total scheduling quota to each time window according to the policy effective time and the time window number. When the resource request reaches the CDN edge node, a 302 scheduling policy based on the first remaining scheduling quota is executed, specifically: and determining whether a first remaining scheduling quota of a domain name corresponding to the resource request exists, and if so, scheduling the resource request through a preset scheduling policy so that other CDN nodes respond to the resource request. Further, the scheduling policy center is also responsible for counting the hot spot resources in the current period, generating an identifier corresponding to the hot spot resources, transmitting the identifier to each CDN edge node, and when each CDN edge node receives a resource request, judging whether the resource requested by the resource request is the hot spot resource or not further based on the identifier corresponding to the hot spot resources transmitted by the scheduling policy center under the condition that a first residual scheduling quota exists, if the resource is the hot spot resource, scheduling the resource request through a consistent hash algorithm so as to schedule the resource request requesting the hot spot resource to the unified CDN node, thereby achieving the purposes of improving the hit rate and reducing the return source rate.
Fig. 9 is a schematic structural diagram of a resource scheduling device according to an embodiment of the present disclosure. The resource scheduling means may in particular be the first server or a component in the first server as described above. The resource scheduling device provided in the embodiment of the present disclosure may execute the processing flow provided in the embodiment of the resource scheduling method, as shown in fig. 9, where the resource scheduling device 900 includes: a first receiving module 910, a first determining module 920, and a first scheduling module 930.
Wherein, the first receiving module 910 is configured to receive a resource request; a first determining module 920, configured to determine whether there is a first remaining scheduling quota matched with the resource request, where the first remaining scheduling quota is determined based on a total number of other requests associated with the resource request received within a preset period of time; and the first scheduling module 930 is configured to schedule the resource request according to a preset scheduling policy if there is a first remaining scheduling quota matched with the resource request, so that other servers respond to the resource request.
Optionally, the first scheduling module 930 includes: a first determining unit, configured to determine whether a target resource corresponding to the resource request is a preset resource; the second determining unit is used for determining the first target server through a consistent hash algorithm if the target resource corresponding to the resource request is determined to be the preset resource; and the sending unit is used for sending the resource request to the first target server so as to respond to the resource request through the first target server.
Optionally, the first scheduling module 930 further includes: a third determining unit, configured to determine whether a second remaining scheduling quota matched with the resource request exists or not after determining that a target resource corresponding to the resource request is a preset resource and before determining that a first target server by a consistent hashing algorithm, where the second remaining scheduling quota is determined based on a total number of other requests that are received in a preset time period and are associated with the resource request; the second determining unit is configured to: if a second residual scheduling quota matched with the resource request exists, determining the operation of the first target server through a consistent hash algorithm; and the scheduling unit is used for randomly scheduling the resource request based on the setting information if the second remaining scheduling quota matched with the resource request does not exist, so that other servers respond to the resource request.
Optionally, the first determining unit includes: a first determining subunit, configured to determine a resource identifier according to the resource request; a second determining subunit, configured to determine whether record information corresponding to the resource identifier exists in a preset file; a third determining subunit, configured to determine, if there is record information corresponding to the resource identifier, that a target resource corresponding to the resource request is a preset resource; and the fourth determination subunit is configured to determine that the target resource corresponding to the resource request is not a preset resource if the record information corresponding to the resource identifier does not exist.
Optionally, the system further includes a second receiving module, configured to receive the preset file sent by the central server, where the central server determines the preset file based on the frequency of occurrence of the resource request.
Optionally, the first determining module 920 includes: a first determining unit, configured to determine a current time window according to a timestamp corresponding to the resource request; the second determining unit is used for determining remaining scheduling quotas corresponding to each time window before the current time window; a third determining unit, configured to determine the first remaining scheduling quota according to a remaining scheduling quota corresponding to the current time window and remaining scheduling quotas corresponding to time windows before the current time window; the initial scheduling quota corresponding to each time window is determined according to the total scheduling quota, and the total scheduling quota is determined by the central server.
Optionally, the method further comprises: the updating module is used for sequentially traversing each time window according to the sequence from the starting time window to the current time window after the resource request is scheduled through a preset scheduling strategy, and determining the time window with the residual scheduling quota which is not zero and is traversed for the first time as a target time window; and subtracting one from the remaining scheduling quota corresponding to the target time window.
Optionally, the first scheduling module 930 is specifically configured to: if the other servers have the cache resources matched with the resource requests, the cache resources are sent to the client through the other servers; and if the other servers do not have the cache resources matched with the resource request, forwarding the resource request according to preset configuration information.
Optionally, the other requests associated with the resource request include requests requesting the same domain name.
Optionally, the first server and the other servers are content delivery network CDN nodes.
The resource scheduling device of the embodiment shown in fig. 9 may be used to implement the technical solution of the above method embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
Fig. 10 is a schematic structural diagram of a resource scheduling device according to an embodiment of the present disclosure. The resource scheduling device may in particular be a first server as described above. The resource scheduling device provided by the embodiment of the present disclosure may execute the processing flow provided by the embodiment of the resource scheduling method, as shown in fig. 10, where the resource scheduling device 150 includes: memory 151, processor 152, computer programs, and communications interface 153; wherein the computer program is stored in the memory 151 and configured to be executed by the processor 152 for performing the resource scheduling method as described above.
In addition, the embodiment of the present disclosure also provides a computer readable storage medium having stored thereon a computer program that is executed by a processor to implement the resource scheduling method described in the above embodiment.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (13)

1. A method for scheduling resources, applied to a first server, the method comprising:
receiving a resource request;
determining whether a first remaining scheduling quota matched with the resource request exists, wherein the first remaining scheduling quota is determined based on the total number of other requests which are received in a preset time period and are associated with the resource request;
and if the first remaining scheduling quota matched with the resource request exists, scheduling the resource request through a preset scheduling policy so that other servers respond to the resource request.
2. The method of claim 1, wherein scheduling the resource request by a preset scheduling policy to cause other servers to respond to the resource request comprises:
determining whether a target resource corresponding to the resource request is a preset resource;
if the target resource corresponding to the resource request is determined to be the preset resource, determining a first target server through a consistent hash algorithm;
and sending the resource request to the first target server to respond to the resource request through the first target server.
3. The method according to claim 2, wherein after determining that the target resource corresponding to the resource request is a preset resource, before determining the first target server by a consistent hashing algorithm, the scheduling the resource request by a preset scheduling policy to enable other servers to respond to the resource request, further comprises:
determining whether a second remaining scheduling quota matched with the resource request exists, wherein the second remaining scheduling quota is determined based on the total number of other requests which are received in a preset time period and are associated with the resource request;
if a second residual scheduling quota matched with the resource request exists, continuing to execute the operation of determining the first target server through the consistent hash algorithm;
and if the second remaining scheduling quota matched with the resource request does not exist, carrying out random scheduling on the resource request based on the setting information so as to enable other servers to respond to the resource request.
4. The method of claim 2, wherein determining whether the target resource corresponding to the resource request is a preset resource comprises:
determining a resource identifier according to the resource request;
determining whether record information corresponding to the resource identifier exists in a preset file;
if the record information corresponding to the resource identifier exists, determining that the target resource corresponding to the resource request is a preset resource;
and if the record information corresponding to the resource identifier does not exist, determining that the target resource corresponding to the resource request is not the preset resource.
5. The method as recited in claim 4, further comprising:
and receiving the preset file sent by a central server, wherein the central server determines the preset file based on the occurrence frequency of the resource request.
6. The method of any of claims 1-5, wherein the determining whether there is a first remaining scheduling quota that matches the resource request comprises:
determining a current time window according to the timestamp corresponding to the resource request;
determining the remaining scheduling quota corresponding to each time window before the current time window;
determining the first residual scheduling quota according to the residual scheduling quota corresponding to the current time window and the residual scheduling quota corresponding to each time window before the current time window;
the initial scheduling quota corresponding to each time window is determined according to the total scheduling quota, and the total scheduling quota is determined by the central server.
7. The method of claim 6, wherein after the scheduling of the resource request by the preset scheduling policy, the method further comprises:
sequentially traversing all the time windows according to the sequence from the starting time window to the current time window, and determining the time window with the residual scheduling quota which is not zero and traversed for the first time as a target time window;
and subtracting one from the remaining scheduling quota corresponding to the target time window.
8. The method of any of claims 1-5, wherein the other servers responding to the resource request comprises:
if the other servers have the cache resources matched with the resource requests, the cache resources are sent to the client through the other servers;
and if the other servers do not have the cache resources matched with the resource request, forwarding the resource request according to preset configuration information.
9. The method of any of claims 1-5, wherein the other requests associated with the resource request include requests requesting the same domain name.
10. The method according to any of claims 1-5, wherein the first server and the other servers are content distribution network nodes.
11. A resource scheduling apparatus, comprising:
the first receiving module is used for receiving the resource request;
a first determining module, configured to determine whether a first remaining scheduling quota matched with the resource request exists, where the first remaining scheduling quota is determined based on a total number of other requests associated with the resource request that are received within a preset period of time;
and the first scheduling module is used for scheduling the resource request through a preset scheduling strategy if a first residual scheduling quota matched with the resource request exists, so that other servers respond to the resource request.
12. A resource scheduling apparatus, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-10.
13. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any of claims 1-10.
CN202210001629.2A 2022-01-04 2022-01-04 Resource scheduling method, device, equipment and computer readable storage medium Pending CN116431321A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210001629.2A CN116431321A (en) 2022-01-04 2022-01-04 Resource scheduling method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210001629.2A CN116431321A (en) 2022-01-04 2022-01-04 Resource scheduling method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116431321A true CN116431321A (en) 2023-07-14

Family

ID=87091287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210001629.2A Pending CN116431321A (en) 2022-01-04 2022-01-04 Resource scheduling method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116431321A (en)

Similar Documents

Publication Publication Date Title
EP3547649B1 (en) Method and system for sending request for acquiring data resource
CN106888270B (en) Method and system for back source routing scheduling
US10681127B2 (en) File upload method and system
EP3595268A1 (en) Streaming media resource distribution method, system, edge node and central dispatching system
US9954941B2 (en) Global server load balancer apparatus and method for dynamically controlling time-to-live
US8320916B2 (en) Method and apparatus for pre-fetching data in a mobile network environment using edge data storage
WO2018152919A1 (en) Path selection method and system, network acceleration node, and network acceleration system
CN109639811B (en) Data transmission method, data storage method, device, server and storage medium
US8881243B2 (en) Data traffic control in a communication network
CN106941507B (en) Request message scheduling method and device
KR20130088774A (en) System and method for delivering segmented content
CN109639470B (en) VSAT satellite communication system bandwidth allocation method based on star networking
CN106375471B (en) Edge node determination method and device
CN109617810B (en) Data transmission method and device
WO2017125017A1 (en) Method for adjusting cache content, device, and system
WO2010047739A4 (en) Rapid dissemination of bulk information to widely dispersed network nodes
CN111683013A (en) Routing method of acceleration network and acceleration network
US20170214536A1 (en) Background traffic downloading method, device, and system
CN102907044B (en) Business scheduling method and device under many wideband network gateways
CN103812707B (en) A kind of method for processing forwarding of line identification message
CN112737806B (en) Network traffic migration method and device
US10348597B2 (en) Monitoring server, resolution server, request device, and node selection method
CN112202833A (en) CDN system, request processing method and scheduling server
CN116431321A (en) Resource scheduling method, device, equipment and computer readable storage medium
CN114666279B (en) Method and system for issuing PCC session management policy in 5G system

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