CN115328646A - Critical resource scheduling method, device, equipment and storage medium - Google Patents

Critical resource scheduling method, device, equipment and storage medium Download PDF

Info

Publication number
CN115328646A
CN115328646A CN202210788088.2A CN202210788088A CN115328646A CN 115328646 A CN115328646 A CN 115328646A CN 202210788088 A CN202210788088 A CN 202210788088A CN 115328646 A CN115328646 A CN 115328646A
Authority
CN
China
Prior art keywords
resource
target
critical
resource request
initial
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
CN202210788088.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 Institute of Technology BIT
Original Assignee
Beijing Institute of Technology BIT
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 Institute of Technology BIT filed Critical Beijing Institute of Technology BIT
Priority to CN202210788088.2A priority Critical patent/CN115328646A/en
Publication of CN115328646A publication Critical patent/CN115328646A/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
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multi Processors (AREA)

Abstract

The invention provides a method, a device, equipment and a storage medium for scheduling critical resources, and relates to the technical field of computers. The method comprises the following steps: receiving a plurality of initial resource requests sent by a plurality of preset users; preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing; and calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request, and distributing the target critical resource to a target user corresponding to the target resource request. The embodiment provided by the invention realizes the efficient and fair scheduling of critical resources by combining the load balancing technology and the atomic self-increment technology.

Description

Critical resource scheduling method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for critical resource scheduling.
Background
The critical resource is a shared resource which is not allowed to be used simultaneously, hardware belonging to the critical resource comprises a memory, a PCI bus, a tape drive, a printer and the like, and software comprises a variable, an array, a message buffer queue and the like. The critical resource pool is a collection of critical resources having the same attribute.
The resource sharing of the critical resource pool is usually realized by adopting a queue mode, but when the critical resource is called at high concurrency, the critical resource is inevitably blocked and wasted due to uncertainty of critical resource release.
Therefore, how to deal with efficient and fair scheduling critical resources in a high concurrency scene is a technical problem to be solved urgently at present.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for critical resource scheduling, which realize efficient and fair scheduling of critical resources by combining a load balancing technology and an atomic self-increment technology.
In a first aspect, the present invention provides a method for scheduling critical resources, including:
receiving a plurality of initial resource requests sent by a plurality of preset users;
preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing;
and calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request, and distributing the target critical resource to a target user corresponding to the target resource request.
Preferably, the method for scheduling critical resources according to the present invention includes:
the preprocessing the initial resource request and determining a target resource request from a plurality of initial resource requests includes:
carrying out load balancing processing on the initial resource requests to obtain a plurality of groups of resource request sets, wherein each group of resource request sets at least comprises one initial resource request;
respectively carrying out atomic self-increment processing on the weights of the initial resource requests in the multiple groups of resource request sets to obtain a plurality of weight values corresponding to each initial resource request;
and determining a target resource request from the plurality of initial resource requests according to the weight values.
Preferably, a method for scheduling critical resources provided by the present invention includes:
determining a target resource request from the plurality of initial resource requests according to the weight values, including:
comparing the weight value corresponding to each initial resource request with a preset maximum weight threshold value;
if the weight value is greater than the maximum weight threshold, determining that the initial resource request corresponding to the weight value is the target resource request.
Preferably, the method for scheduling critical resources according to the present invention includes:
the invoking of the target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request includes:
circularly updating the resource state of the initial critical resource in the critical resource pool within a preset time period based on a preset circular thread, and determining an effective critical resource from the initial critical resource according to the resource state;
and calling the effective critical resource corresponding to the target resource request from the critical resource pool as the target critical resource according to a request instruction corresponding to the target resource request.
Preferably, the method for scheduling critical resources according to the present invention includes:
before the invoking of the effective critical resource corresponding to the target resource request from the critical resource pool according to the request instruction corresponding to the target resource request is the target critical resource, the method includes:
according to the circulation thread, counting the effective resource quantity of the effective critical resources in the critical resource pool;
and if the number of the effective resources is larger than the preset number of the resources, carrying out atomic self-reduction on the number of the effective resources.
Preferably, the method for scheduling critical resources according to the present invention includes:
after the target critical resource is distributed to the target user corresponding to the target resource request, the method includes:
storing a plurality of the initial resource requests in a preset ordered set, wherein the preset ordered set at least comprises: a user ordered set and a period ordered set;
performing intersection processing on the user ordered set and the time ordered set to obtain a target ordered set;
sifting out the target resource request from a plurality of the initial resource requests in the target ordered set.
In a second aspect, the present invention further provides a critical resource scheduling apparatus, including:
the system comprises a receiving module, a resource allocation module and a resource allocation module, wherein the receiving module is used for receiving a plurality of initial resource requests sent by a plurality of preset users;
a preprocessing module, configured to preprocess the initial resource request, and determine a target resource request from the multiple initial resource requests, where the preprocessing at least includes: load balancing processing and atom self-increment processing;
and the resource distribution module is used for calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request and distributing the target critical resource to a target user corresponding to the target resource request.
In a third aspect, the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above critical resource scheduling methods.
In a fourth aspect, the present invention also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of any one of the above-mentioned critical resource scheduling methods.
In a fifth aspect, the present invention also provides a computer program product, which comprises a computer program, when being executed by a processor, the computer program implements the steps of any one of the above-mentioned critical resource scheduling methods.
The invention provides a method, a device, equipment and a storage medium for scheduling critical resources, which are characterized in that a plurality of initial resource requests sent by a plurality of preset users are received; preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing; and calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request, and distributing the target critical resource to a target user corresponding to the target resource request. The method realizes efficient and fair scheduling of critical resources by combining the load balancing technology and the atomic self-increment technology.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for scheduling critical resources according to the present invention;
FIG. 2 is a schematic flow chart of step S200 in FIG. 1 according to the present invention;
FIG. 3 is a second flowchart illustrating a method for scheduling critical resources according to the present invention;
FIG. 4 is a schematic structural diagram of a critical resource scheduling apparatus according to the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The following describes a method, an apparatus, a device, and a storage medium for critical resource scheduling in conjunction with fig. 1 to 5, which implement efficient and fair scheduling of critical resources by using a combination of a load balancing technique and an atomic self-increment technique.
The following embodiments are specifically described, and first a critical resource scheduling method in the embodiments of the present invention is described.
As shown in fig. 1, which is a schematic flow chart illustrating an implementation of a method for scheduling critical resources according to an embodiment of the present invention, a method for scheduling critical resources may include, but is not limited to, steps S100 to S300.
S100, receiving a plurality of initial resource requests sent by a plurality of preset users;
s200, preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing;
s300, according to the target resource request, calling a target critical resource corresponding to the target resource request from a preset critical resource pool, and distributing the target critical resource to a target user corresponding to the target resource request.
In step S100 of some embodiments, a plurality of initial resource requests issued by a plurality of preset users are received. It can be understood that, the scheduling server receives a plurality of initial resource requests sent by a plurality of preset users, and is used for preprocessing the initial resource requests, so that a plurality of groups of user threads of the scheduling server receive the initial resource requests in parallel.
In step S200 of some embodiments, the initial resource request is preprocessed, and a target resource request is determined from a plurality of the initial resource requests. It is understood that after the step of step S100 is executed, the specific execution steps thereof may be: performing load balancing processing on the initial resource requests to obtain a plurality of groups of resource request sets, wherein each group of resource request sets at least comprises one initial resource request, performing atomic self-increment processing on weights of the initial resource requests in the plurality of groups of resource request sets respectively to obtain a plurality of weight values corresponding to each initial resource request, and comparing the weight value corresponding to each initial resource request with a preset maximum weight threshold value; if the weight value is greater than the maximum weight threshold value, determining that the initial resource request corresponding to the weight value is the target resource request.
It is noted that, the pretreatment at least includes: load balancing processing and atomic autonomic processing.
In step S300 of some embodiments, according to the target resource request, a target critical resource corresponding to the target resource request is called from a preset critical resource pool, and the target critical resource is distributed to a target user corresponding to the target resource request. It can be understood that, after the step S200 of preprocessing the initial resource request is executed and the step of determining the target resource request from the plurality of initial resource requests is completed, the specific execution steps may be, first, based on a preset circulation thread, within a preset time period, cyclically updating the resource state of the initial critical resources in the critical resource pool, determining effective critical resources from the initial critical resources according to the resource state, counting the number of effective resources of the effective critical resources in the critical resource pool according to the circulation thread, performing atomic self-subtraction on the number of effective resources if the number of effective resources is greater than a preset number of resources, and calling the effective critical resources corresponding to the target resource request from the critical resource pool as the target critical resources according to a request instruction corresponding to the target resource request.
In some embodiments, as shown with reference to fig. 2, step S200 may also include, but is not limited to, steps S210-S230.
S210, carrying out load balancing processing on the initial resource requests to obtain a plurality of groups of resource request sets, wherein each group of resource request sets at least comprises one initial resource request;
s220, respectively carrying out atom self-increment processing on the weights of the initial resource requests in the multiple groups of resource request sets to obtain multiple weight values corresponding to each initial resource request;
and S230, determining a target resource request from the initial resource requests according to the weight values.
In step S210 of some embodiments, load balancing is performed on the initial resource request to obtain a plurality of sets of resource request sets. It can be understood that, after the step of receiving a plurality of initial resource requests sent by a plurality of preset users in step S100 is completed, the specific steps may be: firstly, load balancing processing is carried out on a plurality of initial resource requests by utilizing load balancing equipment, and a plurality of groups of resource request sets are obtained.
Referring to fig. 3, if there are four initial resource requests, i.e. a, B, c, and d, the load balancing device is now used to process them in parallel, for example, the initial resource requests a and B are grouped into a resource request set a, and the initial resource requests c and d are grouped into a resource request set B, then the scheduling server will invoke user thread a to process the resource request set a, and invoke user thread B to process the resource request set B.
It should be noted that each set of resource requests includes at least one initial resource request.
In step S220 of some embodiments, the weights of the initial resource requests in the multiple sets of resource request sets are respectively subjected to atomic self-increment processing, so as to obtain multiple weight values corresponding to each of the initial resource requests. It can be understood that after the step of performing load balancing processing on the initial resource request in step S210 to obtain a plurality of resource request sets, the specific steps may be: and respectively carrying out atomic self-increment processing on the weights of the initial resource requests in the multiple groups of resource request sets so as to obtain a weight value corresponding to each initial resource request.
For example, the initial resource requests a and b in the group a are respectively processed by using an atomic self-increment technology to obtain corresponding weight values a1 and b1.
At the same time, the c, d initial resource requests in the B group are similarly processed, resulting in corresponding weight values c1, d1.
In step S230 of some embodiments, a target resource request is determined from the plurality of initial resource requests according to the weight value. It can be understood that after the step S220 of performing atomic auto-increment processing on the weights of the initial resource requests in the multiple sets of resource request sets to obtain multiple weight values corresponding to each of the initial resource requests is completed, the specific steps may be: comparing the weight value corresponding to each initial resource request with a preset maximum weight threshold; if the weight value is greater than the maximum weight threshold, determining that the initial resource request corresponding to the weight value is the target resource request.
In some embodiments, the determining, according to the weight value, a target resource request from the plurality of initial resource requests includes:
comparing the weight value corresponding to each initial resource request with a preset maximum weight threshold value;
if the weight value is greater than the maximum weight threshold value, determining that the initial resource request corresponding to the weight value is the target resource request.
It is to be understood that the weight value corresponding to each initial resource request determined in step S220 is compared with the maximum weight threshold MaxV.
If the weight value corresponding to the initial resource request is greater than the maximum weight threshold value MaxV, determining that the initial resource request corresponding to the weight value is the target resource request.
That is, if the weight value a1 corresponding to the initial resource request a is greater than the maximum weight threshold MaxV, it is determined that the initial resource request a is a target resource request for distributing a target resource to the target resource request a.
It should be noted that, otherwise, it is prompted that the resource request is being queued.
In some embodiments, the invoking, according to the target resource request, a target critical resource corresponding to the target resource request from a preset critical resource pool includes:
circularly updating the resource state of the initial critical resource in the critical resource pool within a preset time period based on a preset circular thread, and determining an effective critical resource from the initial critical resource according to the resource state;
and calling the effective critical resource corresponding to the target resource request from the critical resource pool as the target critical resource according to a request instruction corresponding to the target resource request.
It can be understood that, according to the circulation thread of the scheduling server, the resource state of the initial critical resource in the critical resource pool is determined within a preset time period, for example, 5 seconds, so as to determine whether the resource state is an effective state, thereby avoiding that the function of the initial critical resource cannot be invoked due to invalidity or no connection of the initial critical resource under special conditions.
So that the initial critical resources in the critical resource pool are all valid critical resources.
And the scheduling server calls the effective critical resources corresponding to the target resource request from the critical resource pool according to the request instruction corresponding to the determined target resource request a, for example, if the target resource request requests to call printer resources, the printer resources are screened from the effective critical resources and allocated to the target resource request.
Note that the Token information (Token) of the target critical resource includes: token validity period, available resource status, and startup parameters.
In some embodiments, before the invoking of the valid critical resource corresponding to the target resource request from the critical resource pool as the target critical resource according to the request instruction corresponding to the target resource request, the method includes:
according to the circulation thread, counting the effective resource quantity of the effective critical resources in the critical resource pool;
and if the number of the effective resources is larger than the preset number of the resources, carrying out atomic self-reduction on the number of the effective resources.
It can be understood that, according to the loop thread of the scheduling server, the number of effective resources of the effective critical resources in the critical resource pool is counted, and if the number of effective resources is greater than the preset number of resources, the number of effective resources is subjected to atomic self-reduction processing. For example, the number of the effective resources is 3, the number of the preset resources is 0, obviously 3 is greater than 0, which indicates that there is an effective critical resource available for allocation in the critical pool, 1 is subtracted first, because the critical resource to be allocated needs to be allocated to the target resource request a.
Of course, if the number of the valid resources is less than or equal to the preset number of resources 0, it indicates that there is no valid critical resource in the critical resource pool. And generating an information prompt of no available effective critical resources for the current target user.
In some embodiments, after the distributing the target critical resource to the target user corresponding to the target resource request, the method includes:
storing a plurality of the initial resource requests in a preset ordered set, wherein the preset ordered set comprises at least: a user ordered set and a period ordered set;
performing intersection processing on the user ordered set and the time ordered set to obtain a target ordered set;
sifting out the target resource request from a plurality of the initial resource requests in the target ordered set.
It is to be understood that the plurality of initial resource requests received in step S100 are stored in a preset ordered set, which may be a Redis ZSet.
Redis (remote dictionary service) is a key-value storage system, including string, list, set, zset and hash. These data types all support push/pop, add/remove, and intersect union and difference, and richer operations, and these operations are all atomic. On this basis, redis supports various different ways of ordering, and data is cached in memory in order to ensure efficiency. Redis periodically writes updated data to a disk or writes modification operations to an additional recording file, and realizes master-slave synchronization on the basis of the updated data or the modification operations.
It should be noted that the preset ordered set at least includes: user ordered set, time ordered set.
And performing intersection processing on the user ordered set and the time ordered set to obtain a target ordered set. For example, the ordered set of users includes a resource request set a, B, and C, and the time ordered set includes only a resource request set a and B, which indicates that the initial resource request in the resource request set C has cancelled the resource request, then the intersection of the ordered set of users and the time ordered set is the target ordered set, and the target ordered set includes the resource request set a and B.
And screening out the target resource request from the plurality of initial resource requests in the target ordered set, namely screening out a target resource request a from the plurality of initial resource requests in the A and B resource request sets, so as to avoid competing for the target critical resource in the request queue after the target critical resource is enjoyed.
The invention provides a critical resource scheduling method, which comprises the steps of receiving a plurality of initial resource requests sent by a plurality of preset users; preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing; and calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request, and distributing the target critical resource to a target user corresponding to the target resource request. The method realizes efficient and fair scheduling of critical resources by combining the load balancing technology and the atomic self-increment technology.
In the following, a critical resource scheduling apparatus provided by the present invention is described, and a critical resource scheduling apparatus described below and a critical resource scheduling method described above may be referred to correspondingly.
Referring to fig. 4, a critical resource scheduling apparatus includes:
a receiving module 410, configured to receive multiple initial resource requests sent by multiple preset users;
a preprocessing module 420, configured to preprocess the initial resource request, and determine a target resource request from a plurality of initial resource requests, where the preprocessing at least includes: load balancing processing and atom self-increment processing;
the resource distribution module 430 is configured to, according to the target resource request, retrieve a target critical resource corresponding to the target resource request from a preset critical resource pool, and distribute the target critical resource to a target user corresponding to the target resource request.
According to the critical resource scheduling apparatus provided by the present invention, the preprocessing module 420 is specifically further configured to perform load balancing processing on the initial resource requests to obtain a plurality of sets of resource request sets, where each set of resource request sets includes at least one initial resource request;
respectively carrying out atomic self-increment processing on the weights of the initial resource requests in the multiple groups of resource request sets to obtain a plurality of weight values corresponding to each initial resource request;
and determining a target resource request from the plurality of initial resource requests according to the weight values.
According to the critical resource scheduling apparatus provided by the present invention, the preprocessing module 420 is specifically further configured to compare the weight value corresponding to each of the initial resource requests with a preset maximum weight threshold;
if the weight value is greater than the maximum weight threshold, determining that the initial resource request corresponding to the weight value is the target resource request.
According to the critical resource scheduling apparatus provided by the present invention, the resource distributing module 430 is further configured to, based on a preset loop thread, cyclically update the resource state of the initial critical resource in the critical resource pool within a preset time period, and determine an effective critical resource from the initial critical resource according to the resource state;
and calling the effective critical resource corresponding to the target resource request from the critical resource pool as the target critical resource according to a request instruction corresponding to the target resource request.
According to the critical resource scheduling device provided by the invention, the device is specifically further configured to count the number of effective resources of the effective critical resources in the critical resource pool according to the loop thread;
and if the number of the effective resources is larger than the preset number of the resources, carrying out atomic self-reduction on the number of the effective resources.
According to a critical resource scheduling apparatus provided by the present invention, the critical resource scheduling apparatus is further configured to store a plurality of initial resource requests in a preset ordered set, where the preset ordered set at least includes: a user ordered set and a period ordered set;
performing intersection processing on the user ordered set and the time ordered set to obtain a target ordered set;
sifting out the target resource request from a plurality of the initial resource requests in the target ordered set.
The invention provides a critical resource scheduling device, which receives a plurality of initial resource requests sent by a plurality of preset users; preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing; and calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request, and distributing the target critical resource to a target user corresponding to the target resource request. The method realizes efficient and fair scheduling of critical resources by combining the load balancing technology and the atomic self-increment technology.
Fig. 5 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 5: a processor (processor) 510, a communication Interface (Communications Interface) 520, a memory (memory) 530 and a communication bus 540, wherein the processor 510, the communication Interface 520 and the memory 530 communicate with each other via the communication bus 540. Processor 510 may call logic instructions in memory 530 to perform a critical resource scheduling method comprising: receiving a plurality of initial resource requests sent by a plurality of preset users; preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing; and calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request, and distributing the target critical resource to a target user corresponding to the target resource request.
Furthermore, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several 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.
In another aspect, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, when the computer program is executed by a processor, a computer can execute a method for critical resource scheduling provided by the above methods, the method includes: receiving a plurality of initial resource requests sent by a plurality of preset users; preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing; and calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request, and distributing the target critical resource to a target user corresponding to the target resource request.
In still another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform a method for scheduling critical resources provided by the above methods, the method including: receiving a plurality of initial resource requests sent by a plurality of preset users; preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing; and calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request, and distributing the target critical resource to a target user corresponding to the target resource request.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for scheduling critical resources, comprising:
receiving a plurality of initial resource requests sent by a plurality of preset users;
preprocessing the initial resource request, and determining a target resource request from a plurality of initial resource requests, wherein the preprocessing at least comprises: load balancing processing and atom self-increment processing;
and calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request, and distributing the target critical resource to a target user corresponding to the target resource request.
2. The method for critical resource scheduling according to claim 1, wherein the pre-processing the initial resource requests and determining a target resource request from a plurality of the initial resource requests comprises:
performing load balancing processing on the initial resource requests to obtain a plurality of groups of resource request sets, wherein each group of resource request sets at least comprises one initial resource request;
respectively carrying out atomic self-increment processing on the weights of the initial resource requests in the multiple groups of resource request sets to obtain a plurality of weight values corresponding to each initial resource request;
and determining a target resource request from the plurality of initial resource requests according to the weight values.
3. The method for critical resource scheduling according to claim 2, wherein the determining a target resource request from a plurality of the initial resource requests according to the weight values comprises:
comparing the weight value corresponding to each initial resource request with a preset maximum weight threshold;
if the weight value is greater than the maximum weight threshold, determining that the initial resource request corresponding to the weight value is the target resource request.
4. The method for scheduling critical resources according to claim 1, wherein the retrieving, according to the target resource request, the target critical resource corresponding to the target resource request from a preset critical resource pool comprises:
circularly updating the resource state of the initial critical resource in the critical resource pool within a preset time period based on a preset circular thread, and determining an effective critical resource from the initial critical resource according to the resource state;
and calling the effective critical resource corresponding to the target resource request from the critical resource pool as the target critical resource according to a request instruction corresponding to the target resource request.
5. The method for scheduling critical resources according to claim 4, wherein before the invoking of the effective critical resource corresponding to the target resource request from the critical resource pool as the target critical resource according to the request command corresponding to the target resource request, the method comprises:
according to the circulation thread, counting the effective resource quantity of the effective critical resources in the critical resource pool;
and if the number of the effective resources is larger than the preset number of the resources, carrying out atomic self-reduction on the number of the effective resources.
6. The method for scheduling critical resource as claimed in claim 1, wherein after the distributing the target critical resource to the target user corresponding to the target resource request, the method comprises:
storing a plurality of the initial resource requests in a preset ordered set, wherein the preset ordered set comprises at least: a user ordered set and a period ordered set;
performing intersection processing on the user ordered set and the time ordered set to obtain a target ordered set;
sifting out the target resource request from a plurality of the initial resource requests in the target ordered set.
7. A critical resource scheduling apparatus, comprising:
the system comprises a receiving module, a resource allocation module and a resource allocation module, wherein the receiving module is used for receiving a plurality of initial resource requests sent by a plurality of preset users;
a preprocessing module, configured to preprocess the initial resource request, and determine a target resource request from the multiple initial resource requests, where the preprocessing at least includes: load balancing processing and atom self-increment processing;
and the resource distribution module is used for calling a target critical resource corresponding to the target resource request from a preset critical resource pool according to the target resource request and distributing the target critical resource to a target user corresponding to the target resource request.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of the critical resource scheduling method according to any of claims 1 to 6.
9. A non-transitory computer-readable storage medium, having stored thereon a computer program, wherein the computer program, when being executed by a processor, implements the steps of the critical resource scheduling method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, performs the steps of the critical resource scheduling method according to any one of claims 1 to 6.
CN202210788088.2A 2022-07-04 2022-07-04 Critical resource scheduling method, device, equipment and storage medium Pending CN115328646A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210788088.2A CN115328646A (en) 2022-07-04 2022-07-04 Critical resource scheduling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210788088.2A CN115328646A (en) 2022-07-04 2022-07-04 Critical resource scheduling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115328646A true CN115328646A (en) 2022-11-11

Family

ID=83917065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210788088.2A Pending CN115328646A (en) 2022-07-04 2022-07-04 Critical resource scheduling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115328646A (en)

Similar Documents

Publication Publication Date Title
CN107241281B (en) Data processing method and device
CN106170016A (en) A kind of method and system processing high concurrent data requests
CN107832143B (en) Method and device for processing physical machine resources
CN110474966B (en) Method for processing cloud platform resource fragments and related equipment
US9448861B2 (en) Concurrent processing of multiple received messages while releasing such messages in an original message order with abort policy roll back
US7681196B2 (en) Providing optimal number of threads to applications performing multi-tasking using threads
EP4242843A1 (en) Graphics card memory management method and apparatus, device, and system
US10437645B2 (en) Scheduling of micro-service instances
CN106528288A (en) Resource management method, device and system
CN108681481A (en) The processing method and processing device of service request
CN110022364A (en) A kind of document down loading method and server
CN111290842A (en) Task execution method and device
CN113327053A (en) Task processing method and device
EP2754045A1 (en) A graphics processing unit controller, host system, and methods
CN117076096A (en) Task flow execution method and device, computer readable medium and electronic equipment
CN112188015A (en) Method and device for processing customer service session request and electronic equipment
CN115328646A (en) Critical resource scheduling method, device, equipment and storage medium
CN110349076A (en) The processing method and processing device of data
CN109284177B (en) Data updating method and device
US11474868B1 (en) Sharded polling system
CN116069518A (en) Dynamic allocation processing task method and device, electronic equipment and readable storage medium
CN113449994A (en) Assignment method, assignment device, electronic device, medium, and program product for job ticket
CN109933426B (en) Service call processing method and device, electronic equipment and readable storage medium
CN108683608B (en) Method and device for distributing flow
CN115129438A (en) Method and device for task distributed scheduling

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