Search

CN-122019171-A - Resource scheduling method, device, equipment and computer readable storage medium

CN122019171ACN 122019171 ACN122019171 ACN 122019171ACN-122019171-A

Abstract

The application provides a resource scheduling method, a device, equipment and a computer readable storage medium, wherein the method comprises the steps of obtaining a resource request data quantity Y of a resource demand party and requesting Y first resource instances to a resource provider party; under the condition that the duration of starting Y first resource instances is less than or equal to the target duration and the starting success rate of Y first resource instances is greater than or equal to the compensation trigger success threshold, carrying out resource compensation based on a resource buffer pool to obtain at least one first compensation resource instance, distributing the at least one first compensation resource instance and a second resource instance in which the first instance state in the Y first resource instances is the starting state to a resource requiring party, wherein the first instance state of a buffer resource instance in the resource buffer pool is the starting state. By adopting the application, the resource compensation can be timely carried out when the resource allocation is carried out, thereby improving the resource allocation efficiency.

Inventors

  • CHEN CHAO

Assignees

  • 武汉启云方科技有限公司

Dates

Publication Date
20260512
Application Date
20260130

Claims (17)

  1. 1. A method for scheduling resources, the method comprising: acquiring a resource request data amount Y of a resource demand party, and requesting Y first resource instances to a resource provider, wherein Y is a positive integer; receiving the Y first resource instances returned by the resource provider, starting the Y first resource instances, and detecting a first instance state of each first resource instance in the Y first resource instances; Determining at least one first compensation resource instance for performing resource compensation on the Y first resource instances based on a resource buffer pool under the condition that the duration of starting the Y first resource instances is less than or equal to a target duration and the starting success rate of the Y first resource instances is greater than or equal to a compensation trigger success threshold; And distributing the at least one first compensation resource instance and a second resource instance with a first instance state being a starting state in the Y first resource instances to the resource demander, wherein the resource buffer pool comprises N buffer resource instances, the first instance state of each buffer resource instance is the starting state, and N is a positive integer.
  2. 2. The method of claim 1, wherein the method is performed by a resource scheduling device, the resource buffer pool being local to the resource scheduling device; The requesting Y first resource instances from the resource provider includes: The resource scheduling device requests Y first resource instances from a resource provider in a remote access mode.
  3. 3. The method of claim 1, wherein the determining at least one first compensating resource instance for resource compensation of the Y first resource instances based on the resource buffer pool comprises: obtaining the number A of third resource instances in which the first instance state is an unactuated state in the Y first resource instances, wherein A is a positive integer; and in the case that N is greater than or equal to A, determining A first compensation resource instances from the N buffer resource instances as the at least one first compensation resource instance.
  4. 4. A method according to claim 3, wherein after said obtaining the number a of third resource instances of said Y first resource instances, the first instance state of which is an inactive state, the method further comprises: Requesting B fourth resource instances from the resource provider if N is less than a, wherein B is a positive integer and B is greater than or equal to the difference between a and N; Acquiring A second compensation resource examples from the N buffer resource examples and the B fourth resource examples; and distributing the A second compensation resource examples and the second resource examples with the starting state of the first example in the Y first resource examples to the resource demander.
  5. 5. The method of claim 4, wherein the obtaining a second compensation resource instances from the N buffer resource instances and the B fourth resource instances comprises: starting the B fourth resource instances, and polling the first instance state of each fourth resource instance in the B fourth resource instances; and determining the resource instance with the first instance state in the B fourth resource instances as the starting state and the N buffer resource instances as the A second compensation resource instances under the condition that the sum of the number of the resource instances with the first instance state in the B fourth resource instances as the starting state and the number of the N buffer resource instances reaches the resource compensation data quantity A.
  6. 6. A method according to claim 3, wherein said determining a first compensating resource instances from said N buffering resource instances as said at least one first compensating resource instance comprises: Acquiring A buffer resource instances with second instance states of idle states from the N buffer resource instances as the A first compensation resource instances; And updating the second instance state of the A first compensation resource instances to be a working state.
  7. 7. The method according to any one of claims 1-6, wherein said assigning the at least one first compensating resource instance to the resource demander with a second resource instance of the Y first resource instances having a first instance state being an active state comprises: storing second resource instances with the first instance state being the starting state in the Y first resource instances to task resource queues corresponding to the resource demander so as to be distributed to the resource demander; Storing the at least one first compensating resource instance to the task resource queue for allocation to the resource demander.
  8. 8. The method according to any one of claims 1-7, wherein in the case where there is a first resource request task and a second resource request task, the first resource request task is a resource request task corresponding to the obtained resource request data amount Y of the resource demander, and the determining, based on a resource buffer pool, at least one first compensation resource instance for performing resource compensation on the Y first resource instances includes: Determining the resource occupation amount of the first resource request task in the resource buffer pool based on the first task priority of the first resource request task; if the resource compensation data amount is larger than the resource occupation amount, acquiring task resource examples occupied by the second resource request task in the resource buffer pool, wherein the resource compensation data amount represents a difference value between the resource request data amount Y and the number of the second resource examples, and the second task priority of the second resource request task is lower than the first task priority; Recovering the task resource instance based on the resource compensation data amount and the resource occupation amount; And determining the buffer resource instance occupied by the first resource request task in the resource buffer pool and the recovered task resource instance as the at least one first compensation task instance.
  9. 9. The method according to any of claims 1-8, characterized in that before said obtaining the resource request data amount Y of the resource demander, the method further comprises: Predicting resource request amount information based on historical resource load data; Determining a buffer preloading moment and a buffer pool capacity according to the resource request amount information; And constructing the resource buffer pool based on the buffer pool capacity at the time of the buffer preloading, wherein the buffer pool capacity corresponds to the number of the N buffer resource instances.
  10. 10. The method of claim 9, wherein determining a buffer pre-load time and a buffer pool capacity based on the resource request amount information comprises: Acquiring a request quantity peak time period from the resource request quantity information, and determining a time which is spaced from the minimum peak time in the request quantity peak time period by a preloading time length and is smaller than the minimum peak time as a buffering preloading time; Determining a unit resource demand from the resource request amount information, and determining the product of the unit resource demand and the preloading proportion as the buffer pool capacity; the unit resource demand refers to the number of resource instances expected to be allocated in a unit resource allocation period, and the preloading proportion refers to the proportion of resource instances to be preloaded in the resource instances required to be allocated in the unit resource allocation period.
  11. 11. The method according to claim 9 or 10, wherein said constructing said resource buffer pool based on said buffer pool capacity at said buffer preloading moment comprises: triggering a preloading script at the time of the buffering preloading by adopting a cloud function workflow so as to request the N buffering resource instances from the resource provider through the preloading script; Starting the N buffer resource instances; and adding buffer pool labels to the N buffer resource instances to identify that the N buffer resource instances belong to the resource buffer pool.
  12. 12. The method of claim 10, wherein after said constructing said resource buffer pool based on said buffer pool capacity, said method further comprises: And adjusting the capacity of the buffer pool according to the resource utilization rate, wherein the resource utilization rate is used for representing the duty ratio of the buffer resource instance in the starting state in the resource buffer pool.
  13. 13. The method of any of claims 1-8, wherein after detecting the first instance state of each of the Y first resource instances, the method further comprises: And terminating a first resource request task under the condition that the time length for starting the Y first resource instances is longer than the target time length and the starting success rate of the Y first resource instances is smaller than the compensation trigger success threshold, wherein the first resource request task refers to a resource request task corresponding to the acquired resource request demand data amount Y of the resource demand party.
  14. 14. The method according to any of claims 1-8, wherein after the determining at least one first compensating resource instance for resource compensation of the Y first resource instances based on the resource buffer pool, the method further comprises: Detecting a second instance state of each buffered resource instance in the resource buffer pool; and if the number of the buffer resource instances with the second instance state being the idle state in the resource buffer pool is smaller than a buffer pool supplement threshold value, requesting candidate resource instances from the resource provider, adding the candidate resource instances into the resource buffer pool, and starting the candidate resource instances.
  15. 15. A resource scheduling apparatus, the apparatus comprising: The resource request module is used for acquiring the resource request data quantity Y of the resource demand side and requesting Y first resource instances to the resource provider side, wherein Y is a positive integer; The resource starting module is used for receiving the Y first resource instances returned by the resource provider, starting the Y first resource instances and detecting a first instance state of each first resource instance in the Y first resource instances; the resource allocation module is used for determining at least one first compensation resource instance for carrying out resource compensation on the Y first resource instances based on a resource buffer pool under the condition that the duration of starting the Y first resource instances is less than or equal to a target duration and the starting success rate of the Y first resource instances is greater than or equal to a compensation trigger success threshold; The resource allocation module is further configured to allocate the at least one first compensation resource instance and a second resource instance whose first instance state is a start state among the Y first resource instances to the resource demander, where the resource buffer pool includes N buffer resource instances, and each buffer resource instance has a first instance state that is the start state, and N is a positive integer.
  16. 16. A computer device, the computer device comprising a processor, a memory; The processor is connected to the memory, wherein the memory is adapted to store program code, the processor being adapted to invoke the program code to perform the method of any of claims 1-14.
  17. 17. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded by a processor and to perform the method according to any of claims 1-14.

Description

Resource scheduling method, device, equipment and computer readable storage medium Technical Field The present application relates to the field of resource allocation technologies, and in particular, to a method, an apparatus, a device, and a computer readable storage medium for scheduling resources. Background Resource allocation techniques are directed to providing resources to resource demanders to meet the resource demander's demand for resources. With the development of the digital society, the demand of resource demand parties for resources is increasing, which makes the number of resources requested by the resource demand parties for resource providers increasing, so how to improve the resource allocation technology is one of the technical problems to be solved currently. According to analysis, in the related art, resources are pre-allocated for a resource demand party through a prediction model, the method needs to rely on the accuracy of the prediction model, more resources are consumed and the like to train the prediction model, and uncertainty exists in a result of the model itself, so that the pre-allocated resources for the resource demand party are not matched with actual demands of the resource demand party on the resources, and accordingly contradiction between the resource utilization rate and response speed is caused. That is, pre-allocating too many resource instances for the resource demander can increase the response speed but cause idle resources, while pre-allocating too few resource instances for the resource demander cannot cover the demand of the resource demander for the resources, resulting in failure of resource allocation and poor flexibility. Disclosure of Invention The application provides a resource scheduling method, a device, equipment and a computer readable storage medium, which can improve resource allocation efficiency. In a first aspect, the application provides a resource scheduling method, which comprises the steps of obtaining a resource request data amount Y of a resource demand side, requesting Y first resource instances from a resource provider, wherein Y is a positive integer, receiving the Y first resource instances returned by the resource provider, starting the Y first resource instances, detecting a first instance state of each first resource instance in the Y first resource instances, and when the duration of starting the Y first resource instances is less than or equal to a target duration and the starting success rate of the Y first resource instances is greater than or equal to a compensation trigger success threshold, determining at least one first compensation resource instance for carrying out resource compensation on the Y first resource instances based on a resource buffer pool, and allocating the at least one first compensation resource instance and a second resource instance in which the first instance state in the Y first resource instances is a starting state to the resource demand side, wherein the resource buffer pool comprises N buffer resource instances, and the first instance state of each buffer resource instance is the starting state. In the embodiment of the application, the started resource instance (namely, the first instance state is the starting state) can be provided through the resource buffer pool, and when the resource request of the resource requiring party needs to be responded, the real-time linkage scheduling of the resource can be realized. Namely, acquiring the resource request data amount Y of the resource demand side and requesting Y first resource instances to the resource provider, receiving the Y first resource instances returned by the resource provider, starting the Y first resource instances, detecting the first instance state of each first resource instance in the Y first resource instances, and under the condition that the starting success rate reaches a certain value (that is, the starting duration of the Y first resource instances is less than or equal to the target duration and the starting success rate of the Y first resource instances is greater than or equal to the compensation trigger success threshold) within the target duration (that is, the starting success rate of the Y first resource instances is less than or equal to the target duration), the buffer resource instances in the resource buffer pool can be used as the first priority compensation sources to compensate the resources requested by the resource demand side, so that the resource allocation can be completed within the target duration or about the target duration as much as possible, thereby improving the controllability of resource supply delay, improving the timeliness and the success rate of resource elastic allocation, and improving the resource allocation efficiency. In a possible implementation manner of the first aspect, the method is performed by a resource scheduling device, and the resource buffer pool is located locally to the resourc