CN108667864B - Method and device for scheduling resources - Google Patents

Method and device for scheduling resources Download PDF

Info

Publication number
CN108667864B
CN108667864B CN201710198284.3A CN201710198284A CN108667864B CN 108667864 B CN108667864 B CN 108667864B CN 201710198284 A CN201710198284 A CN 201710198284A CN 108667864 B CN108667864 B CN 108667864B
Authority
CN
China
Prior art keywords
identifier
task
resource node
tasks
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710198284.3A
Other languages
Chinese (zh)
Other versions
CN108667864A (en
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710198284.3A priority Critical patent/CN108667864B/en
Priority to PCT/CN2018/080949 priority patent/WO2018177335A1/en
Publication of CN108667864A publication Critical patent/CN108667864A/en
Application granted granted Critical
Publication of CN108667864B publication Critical patent/CN108667864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/142Network analysis or design using statistical or mathematical methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Algebra (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Pure & Applied Mathematics (AREA)
  • Multimedia (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention discloses a method and a device for scheduling resources, belonging to the technical field of resource scheduling. The method comprises the following steps: if the tasks to be scheduled comprise a plurality of tasks with inverse affinity, establishing a first flow graph model, recording a connection corresponding relation between a task identifier of each task in the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and a connection corresponding relation between the intermediate virtual identifier and each resource node identifier in the first flow graph model, and setting the capacity corresponding to the connection corresponding relation between the intermediate virtual identifier and each resource node identifier as 0 or 1; and according to the first flow chart model, performing resource scheduling on the plurality of tasks with the inverse affinity. By adopting the invention, the task with complex constraint rules can be subjected to resource scheduling.

Description

Method and device for scheduling resources
Technical Field
The present invention relates to the field of resource scheduling technologies, and in particular, to a method and an apparatus for resource scheduling.
Background
When a network side processes tasks, there is often a problem of resource scheduling, where resource scheduling refers to allocating each task to be scheduled to each resource node under a certain constraint rule. For example, the resource node may be a service server, the scheduling server may schedule each task to a corresponding service server according to the amount of resources required by each task and the amount of resources included in the resource node, so that each service server executes the corresponding task, where the amount of resources is, for example, a storage capacity, and the scheduling server may schedule each task to a service server capable of bearing the task according to the known storage capacity required by each task and the known storage capacity included in each service server.
The constraint rule may be that some tasks have affinity (i.e. the tasks must be scheduled on the same resource node), and some tasks and some resource nodes have inverse affinity (i.e. the tasks do not need to be scheduled on the resource node), and when the scheduling server performs resource scheduling, each task to be scheduled is often scheduled on a corresponding resource node according to the constraint rule. At present, in order to improve resource utilization rate, a flowsheet method is often adopted to perform resource scheduling on each task to be scheduled, that is, when performing resource scheduling, a flowsheet model which can meet constraint rules can be constructed firstly, and then, according to the constructed flowsheet model, the tasks can be scheduled onto resource nodes, for example, for the condition that the constraint rules are affinity among the tasks, a scheduling server establishes the flowsheet model when performing resource scheduling, wherein, a task identifier (which can be an identifier representing all the tasks due to the affinity among the tasks) is recorded in the flowsheet model and a connection corresponding relation of each resource node identifier is established, then, the scheduling server can determine the capacity and cost corresponding to each connection corresponding relation according to the total resource quantity required by all the tasks and the resource quantity contained in each resource node, finally, the capacity and cost corresponding to each connection correspondence may be used as input of a minimum-cost maximum flow algorithm, and a resource node identifier corresponding to the task identifier is determined (that is, each task may be scheduled to a resource node corresponding to the determined resource node identifier), so that the scheduling result determined according to the constructed flow graph model may satisfy the constraint rule that each task has affinity.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
when resource scheduling is performed by using a flow graph method, a flow graph model needs to be constructed firstly, only a flow graph model construction method with a simpler constraint rule (such as affinity between tasks, affinity between tasks and resource nodes and the like) exists at present, and a flow graph model construction method with a complex constraint rule (such as inverse affinity between tasks) does not exist, so that resource scheduling cannot be performed on the tasks with the complex constraint rule.
Disclosure of Invention
In order to solve the problem that resource scheduling cannot be performed on tasks with complex constraint rules, embodiments of the present invention provide a method and an apparatus for performing resource scheduling. The technical scheme is as follows:
in a first aspect, a method for resource scheduling is provided, where the method includes: if the tasks to be scheduled comprise a plurality of tasks with inverse affinity, a first flow graph model can be established, wherein the first flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with inverse affinity and the intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier, and the capacity corresponding to the connection corresponding relation between the intermediate virtual identifier and each resource node identifier is set to be 0 or 1; according to the first flow chart model, resource scheduling is performed on a plurality of tasks with inverse affinity.
According to the scheme shown in the embodiment of the invention, if each task to be scheduled comprises a plurality of tasks with inverse affinity, the scheduling server can establish a first flow graph model, and when the first flow graph model is established, a connection corresponding relation between a task identifier of each task in the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and a connection corresponding relation between the intermediate virtual identifier and each resource node identifier can be established, and a capacity corresponding to the connection corresponding relation between the intermediate virtual identifier and each resource node identifier can be set to satisfy an inverse affinity constraint rule, wherein the corresponding capacity can be set to be 0 or 1. Therefore, the scheduling server can perform resource scheduling on a plurality of tasks with inverse affinity based on the constructed first flow graph model, and can perform resource scheduling on tasks with complex constraint rules.
In a possible implementation manner, if each task to be scheduled includes a plurality of tasks with inverse affinity, a first flow graph model is established, where a connection correspondence relationship between a task identifier of each task of the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity, and a connection correspondence relationship between the intermediate virtual identifier and each resource node identifier are recorded in the first flow graph model, including: if the tasks to be scheduled comprise a plurality of tasks with inverse affinity and the attributes of the tasks are consistent, a first flow graph model is established, and the connection corresponding relation between the task identifier of each task in the tasks with inverse affinity and the intermediate virtual identifier corresponding to the tasks with inverse affinity and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier are recorded in the first flow graph model.
According to the scheme of the embodiment of the invention, if the tasks to be scheduled comprise a plurality of tasks with inverse affinity and the attributes of the tasks are consistent, the first flow chart model can be constructed by adopting the mode. In this way, it can be ensured that more tasks can be scheduled successfully, i.e. more tasks can be allocated to the resource nodes.
In a possible implementation manner, if each task to be scheduled includes a plurality of tasks with inverse affinity, a first flow graph model is established, a connection correspondence relationship between a task identifier of each task of the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and a connection correspondence relationship between the intermediate virtual identifier and each resource node identifier are recorded in the first flow graph model, and a capacity corresponding to the connection correspondence relationship between the intermediate virtual identifier and each resource node identifier is set to be 0 or 1, including: if the tasks to be scheduled comprise a plurality of tasks with inverse affinity, a first flow graph model is established, the connection corresponding relation between the task identifier of each task in the plurality of tasks with inverse affinity and the middle virtual identifier of each resource node identifier corresponding to the plurality of tasks with inverse affinity and the connection corresponding relation between each middle virtual identifier and the resource node identifier corresponding to each middle virtual identifier are recorded in the first flow graph model, and the capacity corresponding to the connection corresponding relation between each middle virtual identifier and the resource node identifier corresponding to each middle virtual identifier is set to be 0 or 1.
In the solution shown in the embodiment of the present invention, for the case that the constraint rule is inverse affinity, when the scheduling server establishes the first flowchart model, a connection correspondence between a task identifier of each task of the multiple tasks with inverse affinity and an intermediate virtual identifier of each resource node identifier corresponding to the multiple tasks with inverse affinity, and a connection correspondence between each intermediate virtual identifier and a resource node identifier corresponding to each intermediate virtual identifier may be established, that is, the number of intermediate virtual identifiers corresponding to the multiple tasks with inverse affinity is consistent with the number of resource node identifiers, and each resource node identifier corresponds to one intermediate virtual identifier. In addition, to ensure the inverse affinity, the capacity corresponding to the connection correspondence relationship between each intermediate virtual identifier and the resource node identifier corresponding to each intermediate virtual identifier may be set to 0 or 1. In this way, a plurality of tasks with inverse affinity can be scheduled, and at the same time, it can be ensured that as many tasks as possible can be allocated to the resource nodes.
In one possible implementation, the method further includes: if the tasks to be scheduled comprise a plurality of tasks with weak affinity, determining a resource node set which can bear the plurality of tasks with weak affinity and contains the least number of resource nodes according to the resource quantity required by each task and the resource quantity contained by each resource node in the plurality of tasks with weak affinity; establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with weak affinity and each resource node identifier, and sets the cost corresponding to the connection corresponding relation between the task identifier and the resource node identifier of each resource node in the resource node set, and the cost is smaller than the cost corresponding to the connection corresponding relation between the task identifier and the resource node identifier of each resource node outside the resource node set; according to the second flow graph model, a plurality of tasks with weak affinity are subjected to resource scheduling.
In the solution shown in the embodiment of the present invention, if each task to be scheduled includes a plurality of tasks with weak affinity, the scheduling server may first determine a resource node set that can carry the plurality of tasks with weak affinity and includes the smallest number of resource nodes, then establish a second flowgram model, when establishing the second flowgram model, may establish a connection correspondence between a task identifier of each task of the plurality of tasks with weak affinity and each resource node identifier, when setting a cost, may set a cost corresponding to a connection correspondence between a task identifier and a resource node identifier of each resource node in the resource node set, which is smaller than a cost corresponding to a connection correspondence between a task identifier and a resource node identifier of each resource node outside the resource node set, and finally, based on the established second flowgram model, and scheduling the resources of a plurality of tasks with weak affinity. In this way, a plurality of tasks with weak affinity can be distributed on fewer resource nodes as much as possible, and the constraint rule of weak affinity is satisfied.
In a possible implementation manner, establishing a second flowgram model, where a connection correspondence between a task identifier of each task in a plurality of tasks with weak affinity and each resource node identifier is recorded in the second flowgram model, and a cost corresponding to the connection correspondence between the task identifier and the resource node identifier of each resource node in the resource node set is set to be smaller than a cost corresponding to the connection correspondence between the task identifier and the resource node identifier of each resource node outside the resource node set, includes: and establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with weak affinity and the first intermediate virtual identifier and the connection corresponding relation between the first intermediate virtual identifier and each resource node identifier, and the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set is set to be smaller than the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set.
According to the scheme shown in the embodiment of the invention, when the second flow graph model is established, the scheduling server can establish the connection corresponding relation between the task identifiers of the tasks with weak affinity and each resource node identifier through the first intermediate virtual identifier, and can set the minimum cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set. In this way, a plurality of tasks with weak affinity can be distributed on fewer resource nodes as much as possible, and the constraint rule of weak affinity is satisfied.
In a possible implementation manner, establishing a second flowgram model, where a connection correspondence relationship between a task identifier of each task of a plurality of tasks with weak affinity and a first intermediate virtual identifier and a connection correspondence relationship between the first intermediate virtual identifier and each resource node identifier are recorded in the second flowgram model, and setting a cost corresponding to the connection correspondence relationship between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set to be smaller than a cost corresponding to the connection correspondence relationship between the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set, includes: dividing a plurality of tasks with weak affinity into a plurality of task sets, wherein the weak affinity degree values among the tasks in each task set are in the same preset range; establishing a second flow graph model, wherein the second flow graph model records a connection corresponding relation between a task identifier of each task in each task set and an intermediate virtual identifier corresponding to each task set, a connection corresponding relation between an intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier and a resource node identifier of each resource node outside the resource node set, and a connection corresponding relation between the first intermediate virtual identifier and a resource node identifier of each resource node in the resource node set, and sets a connection corresponding relation between an intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier, and a connection corresponding relation between a first intermediate virtual identifier and a resource node identifier of each resource node in the resource node set, wherein the connection corresponding relation is respectively corresponding to a cost which is less than a connection pair between an intermediate virtual identifier corresponding to each task set and a resource node identifier of each resource node outside the resource node set The cost corresponding to the corresponding relation is smaller, and the cost corresponding to the connection corresponding relation between the middle virtual identifier corresponding to the task set with the larger end point value of the corresponding preset range and the first middle virtual identifier is set to be smaller.
According to the scheme shown in the embodiment of the invention, aiming at the condition that the corresponding weak affinity degree values are in different preset ranges in each task to be scheduled, a plurality of tasks with weak affinity can be divided into a plurality of task sets, each task set can be respectively provided with an intermediate virtual identifier, and the cost corresponding to the connection corresponding relationship is set to be smaller when the corresponding weak affinity degree value is larger, wherein the larger the weak affinity degree value is, the more the weak affinity is, namely, the more the weak affinity is distributed to the same resource node during resource scheduling. Therefore, the task with the high weak affinity degree value can be distributed to the resource nodes in the resource node set as much as possible.
In one possible implementation, the method further includes: if each task to be scheduled comprises a plurality of task sets with inverse affinity, dividing each resource node into a plurality of resource node sets corresponding to each task set, wherein the inverse affinity exists between the tasks in the plurality of task sets; establishing a third flow chart model, and recording the connection relation between the task identifier of each task in the task set and the resource node identifier of the resource node in the resource node set corresponding to the task set in the third flow chart model for each task set; and according to the third flow chart model, performing resource scheduling on a plurality of tasks in the plurality of task sets.
According to the scheme shown in the embodiment of the invention, aiming at the condition that each task to be scheduled comprises a plurality of task sets with inverse affinity, the scheduling server can divide each resource node into a plurality of resource node sets corresponding to each task set, and each task set carries out resource scheduling in the corresponding resource node set.
In a possible implementation manner, if each task to be scheduled includes a plurality of task sets with inverse affinity, dividing each resource node into a plurality of resource node sets corresponding to each task set, including: and for each task set, determining a resource node set capable of bearing the task set according to the resource quantity required by each task in the task set and the resource quantity contained in each resource node.
According to the scheme shown in the embodiment of the invention, when the resource node set is divided, the resource node set capable of bearing the task set can be determined according to the resource quantity required by each task in the task set and the resource quantity contained in each resource node. Thus, the resource utilization rate of the resource node can be improved.
In one possible implementation, the method further includes: if the tasks to be scheduled comprise a plurality of tasks with weak constraint rules, performing first resource scheduling on the plurality of tasks with the weak constraint rules on the premise that the plurality of tasks with the weak constraint rules have strong constraint rules; and if the tasks with weak constraint rules have scheduling failure tasks, performing secondary resource scheduling on the tasks with scheduling failure on the premise that the tasks with scheduling failure do not have the constraint rules.
According to the scheme disclosed by the embodiment of the invention, the resource scheduling can be carried out twice aiming at the condition that each task to be scheduled comprises a weak constraint rule, the first resource scheduling can be carried out on the premise that each task has a strong constraint rule, the second resource scheduling can be carried out aiming at the task which fails to be scheduled during the first resource scheduling, and the resource scheduling can be carried out on each task which fails to be scheduled on the premise that the constraint rule is not provided. Therefore, the resource utilization rate can be improved while the constraint rule can be met as much as possible.
In a second aspect, an apparatus for performing resource scheduling is provided, where the apparatus includes at least one module, and the at least one module is configured to implement the method for performing resource scheduling provided in the first aspect.
In a third aspect, a dispatch server is provided, the server comprising a processor, a memory, the processor configured to execute instructions stored in the memory; the processor implements the method for resource scheduling provided by the first aspect by executing the instructions.
In a fourth aspect, a computer-readable storage medium is provided, comprising instructions, which, when run on a scheduling server, cause the scheduling server to perform the method of the first aspect described above.
The technical effects obtained by the second to fourth aspects of the embodiments of the present invention are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described herein again.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, if each task to be scheduled comprises a plurality of tasks with inverse affinity, a flow graph model comprising a task identifier of each task with inverse affinity and a resource identifier of each resource node can be established, the flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with inverse affinity and an intermediate virtual identifier and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier, the capacity corresponding to the connection corresponding relation between the intermediate virtual identifier and each resource node identifier is set to be 0 or 1, and further, the scheduling server can schedule the plurality of tasks with inverse affinity according to the flow graph model. Therefore, the method for constructing the flow graph model with the complex constraint rule is provided, and therefore the task with the complex constraint rule can be subjected to resource scheduling.
Drawings
FIG. 1 is a system framework diagram provided by an embodiment of the present invention;
fig. 2 is a flowchart of a method for scheduling resources according to an embodiment of the present invention;
FIG. 3(a) is a schematic diagram of a flowsheet model provided by an embodiment of the present invention;
FIG. 3(b) is a schematic diagram of a flowsheet model provided by an embodiment of the present invention;
FIG. 3(c) is a schematic diagram of a flowsheet model provided by an embodiment of the present invention;
FIG. 3(d) is a schematic diagram of a flowsheet model provided by an embodiment of the present invention;
fig. 4 is a flowchart of a method for scheduling resources according to an embodiment of the present invention;
FIG. 5(a) is a schematic diagram of a flowsheet model provided by an embodiment of the present invention;
FIG. 5(b) is a schematic diagram of a flowsheet model provided by an embodiment of the present invention;
FIG. 5(c) is a schematic diagram of a flowsheet model provided by an embodiment of the present invention;
fig. 6 is a flowchart of a method for scheduling resources according to an embodiment of the present invention;
FIG. 7(a) is a schematic diagram of a flowsheet model provided by an embodiment of the present invention;
FIG. 7(b) is a schematic diagram of a flowsheet model provided by an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an apparatus for performing resource scheduling according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an apparatus for performing resource scheduling according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an apparatus for performing resource scheduling according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method for scheduling resources, wherein an execution main body of the method is a scheduling server. Wherein the server may be a server having a resource scheduling function.
The dispatch server may include a processor 110, a memory 120, and the processor 110 may be coupled to the memory 120, as shown in fig. 1. Processor 110 may include one or more processing units; the Processor 110 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, etc. In particular, the program may include program code including computer operating instructions. The scheduling server may further include a memory 120, the memory 120 may be used to store software programs and modules, and the processor 110 performs data processing by reading the software codes and modules stored in the memory 120.
The process flow shown in fig. 2 will be described in detail below with reference to the specific embodiments, and the contents may be as follows:
step 201, if each task to be scheduled includes a plurality of tasks with inverse affinity, a first flow graph model is established, a connection correspondence relationship between a task identifier of each task of the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and a connection correspondence relationship between the intermediate virtual identifier and each resource node identifier are recorded in the first flow graph model, and a capacity corresponding to the connection correspondence relationship between the intermediate virtual identifier and each resource node identifier is set to be 0 or 1.
The intermediate virtual identifier may be an auxiliary identifier used for establishing a flow graph model satisfying a complex constraint rule, and may be an auxiliary node used for establishing a connection correspondence between the task identifier and the resource node identifier.
In implementation, if each task to be scheduled includes multiple tasks with inverse affinity, the scheduling server may establish a flow graph model (which may be referred to as a first flow graph model) that conforms to a constraint rule and has inverse affinity for the multiple tasks when performing resource scheduling on the multiple tasks with inverse affinity. Specifically, a connection correspondence relationship between a task identifier of each task in the multiple tasks with the inverse affinity and the intermediate virtual identifier and a connection correspondence relationship between the intermediate virtual identifier and each resource node identifier may be recorded in the first flowchart model, where the intermediate virtual identifier in the first flowchart model may be an intermediate virtual identifier corresponding to the multiple task identifiers (that is, when each task to be scheduled further includes another task set including the multiple tasks with the inverse affinity, each other task set may also correspond to the intermediate virtual identifier). In addition, in order to meet the constraint rule that a plurality of tasks have inverse affinity, the scheduling server may further limit the capacity corresponding to the connection correspondence (that is, limit the capacity corresponding to each edge in the flowchart model), and may set the capacity corresponding to the connection correspondence between the intermediate virtual identifier and each resource node identifier to 0 or 1. That is, the capacity corresponding to the connection correspondence relationship between the intermediate virtual identifier and each resource node identifier may be 0 or 1, and may not be larger than 1, where the capacity corresponding to the connection correspondence relationship is 0 or 1, and may be determined by the amount of resources required by the plurality of tasks and the amount of resources included in the resource node corresponding to each resource node identifier. For example, if the task identifiers of the tasks with inverse affinity are P0 and P1, the resource nodes currently included are M0, M1 and M2, the scheduling server may establish a first flow graph model as shown in fig. 3(a), the intermediate virtual node in the first flow graph model is T, the connection correspondence between P0 and P1 and the connection correspondence between T and M0, M1 and M2 may be recorded in the first flow graph model, and the scheduling server may set the capacity corresponding to the connection correspondence between T and M0, M1 and M2 (i.e., T-M0 edge, T-M1 edge and T-M2 edge) to 0 or 1 (when the amount of resources included in M0 is greater than or equal to the amount of resources required by P0 and P1, the capacity corresponding to the connection correspondence between T and M0 may be 1, when the amount of resources included in M2 is less than the amount of resources included in P0 and P828653, and the amount of resources included in P82860 is less than the amount of resources included in P69553, it can be seen that, by establishing the flowsheet model in this way, it can be ensured that at most one task of P0 and P1 can be allocated to a certain resource node, and the first flowsheet model in fig. 3(a) may be a single-start-point and single-end-point flowsheet model, that is, the first flowsheet model may further record a connection correspondence between each resource identifier and the end point D, a connection correspondence between each task identifier and the start point S, a connection correspondence between each task identifier and the non-scheduling node U, and a connection correspondence between U and D. In addition, in the embodiment of the present invention, the connection correspondence between T and D may also be recorded in the first flowchart model instead of the non-scheduling node U.
In addition, when each task to be scheduled includes a plurality of task sets (where a plurality of tasks included in each task set have inverse affinities), the scheduling server may construct a flow graph model according to the above method for each task set including a plurality of tasks having inverse affinities. For example, the tasks of the tasks with inverse affinity in the first task set are identified as P0 and P1, the tasks of the tasks with inverse affinity in the second task set are identified as P2, P3 and P4, and the currently included resource nodes are identified as M0, M1 and M2, the scheduling server may establish a first flow graph model as shown in fig. 3(b), the intermediate virtual nodes in the first flow graph model are T0 and T1, for the first task set, the first flow graph model may record the connection correspondence between P0 and P1 and T0, respectively, the connection correspondence between T0 and M0, M1 and M2, and for the first task set, the scheduling server may set the connection correspondence between T0 and M0, M1 and M2 (i.e., the connection correspondence between T0 and M0, between T0 and M1, between T0 and M2) as capacity 1 or capacity of the edge 391; for the second task set, the first flow graph model may record connection correspondence between P2, P3, P4 and T1, and connection correspondence between T1 and M0, M1, M2, respectively, and the scheduling server may set the capacity corresponding to the connection correspondence between T1 and M0, M1, M2 (i.e., the T1-M0 side, the T1-M1 side, and the T1-M2 side) to be 0 or 1, and in addition, the first flow graph model in fig. 3(b) may be a single-starting-point single-ending-point flow graph model, that is, the first flow graph model may also record connection correspondence between each resource identifier and the ending point D and connection correspondence between each task identifier and the starting point S, and the first flow graph model may not have a non-scheduling node U set, and for each task set, a connection correspondence between an intermediate virtual identifier and D corresponding to the task set is recorded. In addition, a non-scheduling node may be set in the first flowchart model, and for each task set, a connection correspondence relationship between a task identifier of each task in the task set and a non-scheduling node U corresponding to the task set and a connection correspondence relationship between the non-scheduling nodes U and D may also be recorded, or each task set corresponds to one non-scheduling node U, that is, a connection correspondence relationship between a task identifier of each task and U and a connection correspondence relationship between U and D are recorded.
In addition, besides a plurality of tasks with inverse affinity, other tasks without constraint rules or with simple constraint rules may be included in each task to be scheduled. For tasks to be scheduled except for a plurality of tasks with inverse affinity, a corresponding flow graph model can be constructed according to the existing construction method of the flow graph model.
Optionally, the first flowchart model may be established in a case that the attributes of the tasks with inverse affinity are consistent, and accordingly, the processing procedure of step 201 may be as follows: if the tasks to be scheduled comprise a plurality of tasks with inverse affinity and the attributes of the tasks are consistent, a first flow graph model is established, and the connection corresponding relation between the task identifier of each task in the tasks with inverse affinity and the intermediate virtual identifier corresponding to the tasks with inverse affinity and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier are recorded in the first flow graph model.
In implementation, after the scheduling server determines the multiple tasks with inverse affinity, it may further determine whether the attributes of the multiple tasks with inverse affinity are consistent, and if the attributes of the multiple tasks with inverse affinity are consistent, a first flow chart model may be established according to the processing manner in step 201, where consistency of the attributes may be consistency of the required resource amount.
Optionally, when the first flowchart model is established, an intermediate virtual identifier corresponding to each task identifier and each resource node identifier may be established, and accordingly, the processing procedure may be as follows: if the tasks to be scheduled comprise a plurality of tasks with inverse affinity, a first flow graph model is established, the connection corresponding relation between the task identifier of each task in the plurality of tasks with inverse affinity and the middle virtual identifier of each resource node identifier corresponding to the plurality of tasks with inverse affinity and the connection corresponding relation between each middle virtual identifier and the resource node identifier corresponding to each middle virtual identifier are recorded in the first flow graph model, and the capacity corresponding to the connection corresponding relation between each middle virtual identifier and the resource node identifier corresponding to each middle virtual identifier is set to be 0 or 1.
In implementation, when the scheduling server establishes the first flow graph model, a corresponding intermediate virtual identifier may be further set for each resource node identifier. Specifically, the first flowchart model may record a connection correspondence between a task identifier of each of the multiple tasks with inverse affinity and an intermediate virtual identifier corresponding to each resource node identifier, and record, for each intermediate virtual identifier, a connection correspondence between the intermediate virtual identifier and a resource node identifier corresponding to the intermediate virtual identifier, and may set a capacity corresponding to the connection correspondence between the intermediate virtual identifier and the resource node identifier corresponding to the intermediate virtual identifier to 0 or 1, where the intermediate virtual identifier in the first flowchart model may be a resource node identifier and an intermediate virtual identifier corresponding to the multiple tasks with inverse affinity.
For example, if the task identifiers of the multiple tasks with the inverse affinity are P0 and P1, and the currently included resource nodes are M0, M1 and M2, a first flow graph model as shown in fig. 3(c) may be established, where the intermediate virtual identifiers corresponding to each resource node identifier are V0, V1 and V2, respectively, the first flow graph model may record the connection correspondence between P0 and P1 and V0, V1 and V2, and the connection correspondence between V0 and M0, V1 and M1, and between V2 and M2, and the scheduling server may set the connection correspondence between V0 and M0, between V1 and M1, and between V2 and M2 to 0 or 1, and thus the flow graph model may be established, so that at most one task of P0 and P1 may be allocated to a certain resource node, and the end point of the first flow graph model may be a single connection identifier in the first flow graph model, that the end point of the first flow graph model is a single connection point of the first flow graph model record In this case, the first flowchart model may record a connection correspondence between the task identifier of each task and U and a connection correspondence between U and D.
In addition, when each task to be scheduled includes a plurality of task sets (where a plurality of tasks included in each task set have inverse affinities), the scheduling server may construct a flow graph model according to the above method for each task set including a plurality of tasks having inverse affinities. For example, if the task identifiers of the tasks with inverse affinity in the first task set are P, and the task identifiers of the tasks with inverse affinity in the second task set are P, and the resource nodes currently included are M, then the scheduling server may establish a first flow graph model as shown in fig. 3(d), where the intermediate virtual nodes in the first flow graph model are V, V (where V, V may be P, P corresponding to the intermediate virtual identifier of each resource node identifier, V may be P, P corresponding to the intermediate virtual identifier of each resource node identifier), and for the first task set, the connection correspondence between P and V, V and M may be recorded in the first flow graph model, and, the scheduling server may set the capacity corresponding to the connection correspondence of V00 and M0, V01 and M1, and V02 and M2 to 0 or 1, respectively; for the second task set, the first flow graph model may record connection correspondences of P2, P3, P4 with V10, V11, V12, respectively, and connection correspondences of V10 with M0, V11 with M1, V12 with M2, and the scheduling server may set the capacity corresponding to the connection correspondences of V10 with M0, V11 with M1, and V12 with M2 to be 0 or 1, and the first flow graph model in fig. 3(D) may be a single-start-point single-end-point flow graph model, that is, the first flow graph model may also record connection correspondences of each resource identifier with an end point D and connection correspondences of each task identifier with a start point S, and non-scheduling nodes U1, U2 may be provided in the first flow graph model, and in this case, for each task set, the first flow graph model may record connection correspondences of each task identifier in the task set and non-scheduling nodes U of the task set, And the connection corresponding relation between U and D. In addition, only one non-scheduling node U may be provided in the first flow graph model.
And step 202, performing resource scheduling on a plurality of tasks with inverse affinity according to the first flow graph model.
In implementation, after the scheduling server establishes the first flowsheet model, the capacity and cost corresponding to each connection correspondence may be determined according to the resource amount required by each task of the multiple tasks with inverse affinity and the resource amount included in each resource node, and further, the capacity and cost corresponding to each connection correspondence and the corresponding capacity and cost may be used as input of a minimum cost maximum flow algorithm to perform resource scheduling on the multiple tasks with inverse affinity, where after the flowsheet model is obtained, the capacity and cost corresponding to each connection correspondence and the minimum cost maximum flow algorithm are determined, which belong to the prior art, and are not described in detail herein.
In addition, the constraint rule may also correspond to a constraint degree value, that is, a strong constraint rule (for example, strong anti-affinity may be that a plurality of tasks with strong anti-affinity are not necessarily on the same resource node) and a weak constraint rule (for example, weak anti-affinity may be that a plurality of tasks with weak anti-affinity are preferably not on the same resource node, and may be allowed to be on the same resource node) may also be included, and the plurality of tasks with anti-affinity described in step 201 may be with strong anti-affinity.
Optionally, for a case that the multiple tasks satisfy the weak constraint rule, when the scheduling server performs resource scheduling on the multiple tasks, the scheduling server may process the multiple tasks in the following manner: if the tasks to be scheduled comprise a plurality of tasks with weak constraint rules, performing first resource scheduling on the tasks with the weak constraint rules on the premise that the tasks with the weak constraint rules have strong constraint rules; and if the tasks with weak constraint rules have scheduling failure tasks, performing secondary resource scheduling on the tasks with scheduling failure on the premise that the tasks with scheduling failure do not have the constraint rules.
In implementation, if each task to be scheduled includes multiple tasks with weak constraint rules, the scheduling server may perform resource scheduling twice on the multiple tasks sequentially. Specifically, when the resource is scheduled for the first time, it may be assumed that a plurality of tasks having weak constraint rules have strong constraint rules therebetween, and on such a premise, the resource is scheduled for the first time, so that the scheduling result may be guaranteed to satisfy the constraint rules as much as possible. After the first resource scheduling, the scheduling server may determine whether a task with a scheduling failure exists in the plurality of tasks with the weak constraint rule, and if the task with the scheduling failure exists in the plurality of tasks with the weak constraint rule, perform the second resource scheduling on each task with the scheduling failure on the premise that no constraint rule exists between the tasks with the scheduling failure, where the scheduling failure may be that the task is not scheduled to any resource node.
For example, tasks of a plurality of tasks with weak inverse affinity are identified as P0, P1, P2, and P3, and in the first resource scheduling, the scheduling server may perform resource scheduling on P0, P1, P2, and P3 on the premise that P0, P1, P2, and P3 have strong inverse affinity, wherein, on the premise that P0, P1, P2, and P3 have strong inverse affinity, a flowsheet model may be established (the flowsheet model may be established according to the method described in step 201), based on the established flowsheet model, the first resource scheduling is performed on P0, P1, P2, and P3, and after the first resource scheduling, if P2 and P3 scheduling fail, the scheduling server may establish a flowsheet model on the premise that P2 and P3 do not have any constraint rule, and give the established flowsheet model and perform second resource scheduling on P2 and P3.
In addition, the embodiment of the present invention further provides another method for constructing a flowsheet model with complex constraint rules (i.e., each task has weak affinity), as shown in fig. 4.
Step 401, if each task to be scheduled includes multiple tasks with weak affinity, determining a resource node set that can carry the multiple tasks with weak affinity and contains the least number of resource nodes according to the amount of resources required by each task and the amount of resources contained by each resource node in the multiple tasks with weak affinity.
Wherein weak affinity may be that multiple tasks are scheduled on the same resource node as much as possible, allowing to be scheduled on different resource nodes.
In implementation, if the tasks to be scheduled further include a plurality of tasks with weak affinity, the scheduling server may determine a set of resource nodes suitable for the plurality of tasks with weak affinity, that is, may determine a set of resource nodes that can carry the plurality of tasks with weak affinity and include the least number of resource nodes. Specifically, the scheduling server may obtain a resource amount required by each of the plurality of tasks with weak affinity, count the resource amount required by the plurality of tasks with weak affinity, and count the resource amount included in each resource node, and further, may determine, in all the resource nodes, a resource node set that can bear the plurality of tasks with weak affinity (where the resource amount that the resource node set can bear the plurality of tasks with weak affinity is greater than the resource amount required by the plurality of tasks), and has the smallest number of resource nodes, where the resource node set may be determined by using a greedy algorithm, or the resource node set may be determined by using an exhaustive method, and the number of resource nodes included in the determined resource node set may be 1.
In addition, the scheduling server may further determine, in the resource node sets, a resource node set that includes the smallest difference between the amount of resources and the amount of resources required by the plurality of tasks with weak affinity, that is, if the plurality of tasks to be scheduled include the plurality of tasks with weak affinity, determine, according to the amount of resources required by each of the plurality of tasks with weak affinity and the amount of resources included in each resource node, a resource node set that can carry the plurality of tasks with weak affinity, includes the smallest number of resource nodes, and includes the smallest difference between the amount of resources and the amount of resources required by the plurality of tasks with weak affinity, where the amount of resources included in the resource node set may be the sum of the amounts of resources included in the resource nodes included in the resource node set.
In addition, the user may further set the precondition according to the requirement of the user, for example, it may be set that the resource nodes included in the determined resource node set are located in the same rack, or the resource nodes included in the determined resource node set have the same type of ports, and the like. In this case, the scheduling server may determine, from the determined resource node sets, a resource node set that satisfies a precondition set by the user.
Step 402, a second flow graph model is established, a connection corresponding relation between a task identifier of each task in the plurality of tasks with weak affinity and each resource node identifier is recorded in the second flow graph model, and a cost corresponding to the connection corresponding relation between the task identifier and the resource node identifier of each resource node in the resource node set is set to be smaller than a cost corresponding to the connection corresponding relation between the task identifier and the resource node identifier of each resource node outside the resource node set.
In implementation, if the tasks to be scheduled include a plurality of tasks with weak affinity, the scheduling server may also establish a flow graph model (which may be referred to as a second flow graph model) that conforms to the constraint rule. Specifically, when the second flowgram model is established, a connection correspondence between the task identifier of each of the plurality of tasks with weak affinity and each resource node identifier may be established. In addition, in order to meet the weak affinity of a plurality of tasks, the scheduling server can also set the cost corresponding to each connection corresponding relation. Specifically, the cost corresponding to the connection corresponding relationship between the task identifier and the resource node identifier of each resource node in the resource node set may be set to be smaller than the cost corresponding to the connection corresponding relationship between the task identifier and the resource node identifier of each resource node outside the resource node set. For example, if the task identifiers of the plurality of tasks with weak affinity are P0 and P1, the resource node identifiers are M0, M1, M2 and M3, and the resource nodes included in the determined resource node set are M1 and M2, a second flow graph model as shown in fig. 5(a) may be established, where the second flow graph model may record the connection correspondence between P0 and P1 and M0, M1, M2 and M3, and may set the connection correspondence between P0 and P1 and M1 and M2 in fig. 5(a) to be smaller than the connection correspondence between P0 and P1 and M0 and M3, the second flow graph model in fig. 5(a) may be a single-start-point single-end-point flow graph model, that is, the connection correspondence between each resource identifier and the end point D may also be recorded in the second flow graph model, and the connection correspondence between each resource identifier and the start point and the first flow graph model may be set without the connection node U, the first flow chart model may further record a connection correspondence between the task identifier of each task and the non-scheduling node U, and a connection correspondence between U and D.
Optionally, when the second flowgram model is established, the connection corresponding relationship between each task identifier and each resource node identifier may be established through the intermediate virtual identifier, and accordingly, the processing procedure in step 402 may be as follows: and establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with weak affinity and the first intermediate virtual identifier and the connection corresponding relation between the first intermediate virtual identifier and each resource node identifier, and the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set is set to be smaller than the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set.
In implementation, when the scheduling is to establish the second flowgram model, a connection corresponding relationship between a task identifier of each task of the multiple tasks with weak affinity and a first intermediate virtual identifier may be established, where the first intermediate virtual identifier may be an intermediate virtual identifier corresponding to the determined resource node set, and a connection corresponding relationship between the first intermediate virtual identifier and each resource node identifier may also be established. In addition, in order to meet the weak affinity of a plurality of tasks, the scheduling server can also set the cost corresponding to each connection corresponding relation. Specifically, the cost corresponding to the connection corresponding relationship between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set may be set to be smaller than the cost corresponding to the connection corresponding relationship between the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set. For example, the task identifiers of the multiple tasks with weak affinity are P0 and P1, the resource node identifiers are M0, M1, M2 and M3, the resource node set that is determined includes resource nodes M1 and M2, a second flow graph model as shown in fig. 5(b) may be established, the first intermediate virtual identifier in the second flow graph model may be V0, the connection correspondence between P0 and P1 and V0 may be recorded in the second flow graph model, the connection correspondence between V0 and each resource node identifier may be recorded in the second flow graph model, and the cost corresponding to the connection correspondence between V0 and M1 and M2 in fig. 5(b) may be set to be smaller than the cost corresponding to the connection correspondence between V0 and M0 and the connection correspondence between V0 and M3, the second flow graph model in fig. 5(b) may be a single-start-point single-end-point flow model, that is the connection correspondence between each resource node identifier and each end-point identifier in the second flow graph model may also be recorded as a single-point model The first flow chart model can also record the connection corresponding relation between the task identifier of each task and the non-scheduling node U and the connection corresponding relation between U and D. In addition, the connection correspondence between the first intermediate virtual identifier and the node D may be recorded in the second flowgram model instead of the non-scheduling node U.
Optionally, the scheduling server may further divide the multiple tasks into multiple task sets according to the weak affinity degree values among the multiple tasks, and accordingly, the processing procedure of step 402 may be as follows: dividing a plurality of tasks with weak affinity into a plurality of task sets, wherein the weak affinity degree values among the tasks in each task set are in the same preset range; establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in each task set and the intermediate virtual identifier corresponding to each task set, the connection corresponding relation between the intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set, and the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, and sets the connection corresponding relation between the intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier, and the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, wherein the costs are respectively corresponding to the intermediate virtual identifier corresponding to each task set and the connection corresponding relation between the resource node identifier of each resource node outside the resource node set, and are less than the costs corresponding to the intermediate virtual identifier corresponding to each task set and the resource node identifier of each resource node outside the resource node set And setting the corresponding cost of the corresponding connection corresponding relation between the middle virtual identifier corresponding to the task set with the larger end point value of the corresponding preset range and the first middle virtual identifier to be smaller.
In implementation, the tasks with weak affinity are divided into a plurality of task sets according to weak affinity degree values, wherein the weak affinity degree values between the tasks in each task set are within the same preset range, for example, the weak affinity degree value between the task identifiers P0 and P1 is 8, the weak affinity degree value between the task identifiers P2 and P3 is 4, the weak affinity degree value between the task identifiers P3 and P4 is 5, the weak affinity degree value between the task identifiers P2 and P4 is 4, and the preset range is [7,8], [4,5], then P0, P1, P2, P3 and P4 can be divided into a first task set (P0, P1) and a second task set (P2, P3 and P4).
After a plurality of task sets are obtained, one intermediate virtual identifier may be set for each task set, that is, when the second flowgram model is established, for each task set, a connection correspondence between the task identifier of each task in the task set and the intermediate virtual identifier corresponding to the task set, and a connection correspondence between the intermediate virtual identifier corresponding to the task set and the first intermediate virtual identifier and the resource node identifier of each resource node other than the resource node set may be established. In addition, a connection corresponding relationship between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set can be established. In addition, the scheduling server may further set costs corresponding to the connection correspondence, specifically, an order of magnitude of the costs corresponding to the connection correspondence between the intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier, and the connection correspondence between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set may be set to be smaller than an order of magnitude of the costs corresponding to the connection correspondence between the intermediate virtual identifier corresponding to each task set and the resource node identifier of each resource node outside the resource node set, and the cost corresponding to the connection correspondence between the intermediate virtual identifier corresponding to the task set having the larger corresponding weak affinity degree value and the first intermediate virtual identifier may be set to be smaller.
For example, the first task set includes P0 and P1, the preset range of the degree value corresponding to the first task set is [7,8], the second task set includes P2, P3 and P4, the preset range of the degree value corresponding to the second task set is [4,5], then an intermediate virtual identifier V1 may be set for the first task set, an intermediate virtual identifier V2 is set for the second task set, and the second flow graph model shown in fig. 5(c) is established, that is, when the second flow graph model is established, the connection correspondence between P0 and P1 and V1, the connection correspondence between P2, P3 and P4 and V2, and the connection correspondence between V1 and V2 and each resource node identifier (M0 and M3) outside the first intermediate virtual identifier V0 and the resource node identifier set (M1 and M2) may be established. In addition, the costs corresponding to the connection corresponding relations of V1 and V2 with V0 and V0 with M1 and M2 respectively in fig. 5(c) may be set to be smaller than the costs corresponding to the connection corresponding relations of V1 with M0, V1 with M3, V2 with M0 and V2 with M3. It can be seen that the weak affinity degree value corresponding to the first task set is greater than the weak affinity degree value corresponding to the second task set, and further, the cost corresponding to the connection corresponding relationship between V1 and V0 may be set to be smaller than the cost corresponding to the connection corresponding relationship between V2 and V0, the second flowgram model in fig. 5(c) may be a single-start-point and single-end-point flowgram model, that is, the connection corresponding relationship between each resource identifier and the end point D and the connection corresponding relationship between each task identifier and the start point S may also be recorded in the second flowgram model, the non-scheduling node U1 and U2 may be set in the first flowgram model, and for each task set, the connection corresponding relationship between the task identifier of each task in the task set and the non-scheduling node U corresponding to the task set, and the connection corresponding relationship between U and D may also be recorded in the first flowgram model. In addition, the connection correspondence relationship between V1 and V2 and D may be recorded in the second flow graph model instead of the non-scheduling node U.
And step 403, performing resource scheduling on a plurality of tasks with weak affinity according to the second flow graph model.
In implementation, after the scheduling server establishes the second flowsheet model, the capacity and cost corresponding to each connection correspondence may be determined according to the resource amount required by each task of the multiple tasks with weak affinity and the resource amount included in each resource node, and further, the capacity and cost corresponding to each connection correspondence and the corresponding capacity and cost may be used as input of a minimum-cost maximum-flow algorithm to perform resource scheduling on the multiple tasks with weak affinity, where after the flowsheet model is obtained, the capacity and cost corresponding to each connection correspondence and the minimum-cost maximum-flow algorithm are determined, which belongs to the prior art, and details are not repeated in the embodiments of the present invention.
In addition, the embodiment of the present invention further provides another method for constructing a flow graph model with complex constraint rules (i.e., a plurality of task sets with inverse affinities in tasks to be scheduled), as shown in fig. 6.
Step 601, if each task to be scheduled includes a plurality of task sets with inverse affinity, dividing each resource node into a plurality of resource node sets corresponding to each task set, wherein the tasks in the plurality of task sets have inverse affinity.
In implementation, if each task to be scheduled includes a plurality of task sets with inverse affinity, the number of the task sets may be determined, and furthermore, all the resource nodes may be divided into a plurality of resource node sets whose number is consistent with the number of the task sets. For example, two task sets (i.e., a first task set and a second task set) are included, the first task set includes P0 and P1, and the second task set includes P2, P3 and P4, wherein the first task set and the second task set have inverse affinity (i.e., P0 and P1 have inverse affinity with P2, P3 and P4, respectively), all resource nodes may be divided into two resource node sets, wherein the two resource node sets may be randomly divided.
Optionally, a plurality of resource node sets may be divided according to the resource amount, and correspondingly, the processing procedure of step 601 may be as follows: and for each task set, determining a resource node set capable of bearing the task set according to the resource quantity required by each task in the task set and the resource quantity contained in each resource node.
In implementation, after a plurality of task sets are determined, for each task set, the scheduling server may count the resource amount required by the plurality of tasks included in the task set, and may determine, from all resource nodes, a resource node set whose resource amount is greater than or equal to the resource amount required by the plurality of tasks in the task set. Thus, the resource utilization rate of the resource node can be ensured.
Step 602, establishing a third flow chart model, and for each task set, recording a connection relationship between a task identifier of each task in the task set and a resource node identifier of a resource node in a resource node set corresponding to the task set in the third flow chart model; and according to the third flow chart model, performing resource scheduling on a plurality of tasks in the task set.
In implementation, after the resource node set corresponding to each task set is determined, a third flowchart model may be established, and when the third flowchart model is established, for each task set, a connection relationship between a task identifier of each task in the task set and a resource node identifier of a resource node in the resource node set corresponding to the task set may be established, where the connection relationship between a task identifier corresponding to each task set in the third flowchart model and a resource node identifier of a resource node in the resource node set corresponding to the task set may be specifically established according to a constraint rule satisfied by a plurality of tasks in the task set. For example, the first task set includes P0 and P1, the second task set includes P2, P3 and P4, wherein the first task set has an inverse affinity with the second task set, the resource node set corresponding to the first task set includes M0 and M1, and the resource node set corresponding to the second task set includes M2 and M3, the scheduling server may establish a third flow graph model, as shown in fig. 7(a), the third flow graph model may record connection correspondences of P0 and P1 with M0 and M1, and connection correspondences of P2, P3 and P4 with M2 and M3, respectively, the second flow graph model in fig. 7(a) may be a single-start-point single-end-point flow graph model, that is, a connection correspondence relation between each resource identifier and an end point D and a connection correspondence between each task identifier and a start point S may also be recorded in the second flow graph model, and no scheduling node 1 may be set in the first flow graph model, U2, for each task set, the connection correspondence between the task identifier of each task in the task set and the non-scheduling node U corresponding to the task set, and the connection correspondence between U and D may also be recorded in the first flowchart model. For another example, one intermediate virtual id is set for each task set, as shown in fig. 7(b), the intermediate virtual id corresponding to the first task set is V0, the intermediate virtual id corresponding to the second task set is V1, and fig. 7(b) may be set with S, U1, U2, and D as in fig. 7 (a).
After the scheduling server establishes the third flow graph model, the capacity and cost corresponding to each connection correspondence may be determined according to the resource amount required by each task in each task set and the resource amount included in the resource node set corresponding to the task set, and further, the capacity and cost corresponding to each connection correspondence and the capacity and cost corresponding to each connection correspondence may be used as input of a minimum-cost maximum flow algorithm to perform resource scheduling on a plurality of tasks in the task set, where after the flow graph model is obtained, the capacity and cost corresponding to each connection correspondence and the minimum-cost maximum flow algorithm are determined, which belongs to the prior art, and are not described in detail in the embodiments of the present invention.
In the embodiment of the invention, if each task to be scheduled comprises a plurality of tasks with inverse affinity, a flow graph model comprising a task identifier of each task with inverse affinity and a resource identifier of each resource node can be established, the flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with inverse affinity and an intermediate virtual identifier and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier, the capacity corresponding to the connection corresponding relation between the intermediate virtual identifier and each resource node identifier is set to be 0 or 1, and further, the scheduling server can schedule the plurality of tasks with inverse affinity according to the flow graph model. Therefore, the method for constructing the flow graph model with the complex constraint rule is provided, and therefore the task with the complex constraint rule can be subjected to resource scheduling.
Based on the same technical concept, an embodiment of the present invention further provides a device for performing resource scheduling, as shown in fig. 8, the device includes:
an establishing module 810, configured to establish a first flow graph model if each task to be scheduled includes multiple tasks with inverse affinity, where a connection correspondence between a task identifier of each task of the multiple tasks with inverse affinity and an intermediate virtual identifier corresponding to the multiple tasks with inverse affinity and a connection correspondence between the intermediate virtual identifier and each resource node identifier are recorded in the first flow graph model, and a capacity corresponding to the connection correspondence between the intermediate virtual identifier and each resource node identifier is set to be 0 or 1, so that the establishing function in step 201 and other implicit steps can be specifically implemented.
The scheduling module 820 is configured to perform resource scheduling on the multiple tasks with inverse affinity according to the first flowchart model, and may specifically implement the scheduling function in step 202 and other implicit steps.
Optionally, the establishing module 810 is configured to:
if the tasks to be scheduled comprise a plurality of tasks with inverse affinity and the attributes of the tasks are consistent, a first flow graph model is established, and the first flow graph model records the connection corresponding relation between the task identifier of each task in the tasks with inverse affinity and the intermediate virtual identifier corresponding to the tasks with inverse affinity and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier.
Optionally, the establishing module 810 is configured to:
if the tasks to be scheduled comprise a plurality of tasks with inverse affinity, establishing a first flow chart model, wherein the first flow chart model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with inverse affinity and the intermediate virtual identifier of each resource node identifier corresponding to the plurality of tasks with inverse affinity, and the connection corresponding relation between each intermediate virtual identifier and the resource node identifier corresponding to each intermediate virtual identifier, and the capacity corresponding to the connection corresponding relation between each intermediate virtual identifier and the resource node identifier corresponding to each intermediate virtual identifier is set to be 0 or 1.
Optionally, as shown in fig. 9, the apparatus further includes:
the determining module 830 is configured to determine, if each task to be scheduled includes multiple tasks with weak affinity, a resource node set that can carry the multiple tasks with weak affinity and includes the smallest number of resource nodes according to the amount of resources required by each task of the multiple tasks with weak affinity and the amount of resources included in each resource node, and may specifically implement the determining function in step 401, and other implicit steps.
The establishing module 810 is further configured to establish a second flowchart model, where a connection correspondence between a task identifier of each task of the multiple tasks with weak affinity and each resource node identifier is recorded in the second flowchart model, and a cost corresponding to the connection correspondence between the task identifier and the resource node identifier of each resource node in the resource node set is set to be smaller than a cost corresponding to the connection correspondence between the task identifier and the resource node identifier of each resource node outside the resource node set, and the establishing function in step 402 and other implicit steps may be specifically implemented.
The scheduling module 820 is further configured to perform resource scheduling on the multiple tasks with weak affinity according to the second flowgram model, and may specifically implement the scheduling function in step 403 and other implicit steps.
Optionally, the establishing module 810 is configured to:
establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with weak affinity and the first intermediate virtual identifier, and the connection corresponding relation between the first intermediate virtual identifier and each resource node identifier, and sets the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, and the cost is smaller than the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set.
Optionally, the establishing module 810 is configured to:
dividing the tasks with weak affinity into a plurality of task sets, wherein the weak affinity degree values among the tasks in each task set are in the same preset range;
establishing a second flow graph model, wherein a connection corresponding relation between a task identifier of each task in each task set and an intermediate virtual identifier corresponding to each task set, a connection corresponding relation between an intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier and a resource node identifier of each resource node except the resource node set, and a connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set are recorded in the second flow graph model, and a connection corresponding relation between the intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier, and a connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set are set, wherein costs corresponding to the intermediate virtual identifier corresponding to each task set and the resource node identifier of each resource node except the resource node set are respectively set, and are less than costs corresponding to the intermediate virtual identifier corresponding to each task set and the resource node identifier of each resource node except the resource node set And setting the cost corresponding to the connection corresponding relationship between the intermediate virtual identifier corresponding to the task set with the larger endpoint value in the corresponding preset range and the first intermediate virtual identifier to be smaller.
Optionally, as shown in fig. 10, the apparatus further includes:
a dividing module 840, configured to divide each resource node into a plurality of resource node sets corresponding to each task set if each task to be scheduled includes a plurality of task sets with inverse affinity, where the tasks in the plurality of task sets have inverse affinity, and specifically may implement the dividing function in step 601, and other implicit steps.
The establishing module 810 is further configured to establish a third flowchart model, and for each task set, a connection relationship between a task identifier of each task in the task set and a resource node identifier of a resource node in a resource node set corresponding to the task set is recorded in the third flowchart model, so that the establishing function in the step 602 and other implicit steps can be specifically implemented.
The scheduling module 820 is further configured to perform resource scheduling on multiple tasks in multiple task sets according to the third flowchart model, and may specifically implement the scheduling function in step 602, and other implicit steps.
Optionally, the dividing module 840 is configured to:
and for each task set, determining a resource node set capable of bearing the task set according to the resource quantity required by each task in the task set and the resource quantity contained in each resource node.
Optionally, the scheduling module 820 is further configured to:
if the tasks to be scheduled comprise a plurality of tasks with weak constraint rules, performing first resource scheduling on the plurality of tasks with the weak constraint rules on the premise that the plurality of tasks with the weak constraint rules have strong constraint rules;
and if the plurality of tasks with the weak constraint rules have the tasks with scheduling failures, performing secondary resource scheduling on each task with scheduling failures on the premise that no constraint rules exist among the tasks with scheduling failures.
It should be noted that the establishing module 810, the scheduling module 820, the determining module 830 and the dividing module 840 may be implemented by a processor, or the processor and the memory are implemented, or the processor executes program instructions in the memory.
In the embodiment of the invention, if each task to be scheduled comprises a plurality of tasks with inverse affinity, a flow graph model comprising a task identifier of each task with inverse affinity and a resource identifier of each resource node can be established, the flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with inverse affinity and an intermediate virtual identifier and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier, the capacity corresponding to the connection corresponding relation between the intermediate virtual identifier and each resource node identifier is set to be 0 or 1, and further, the scheduling server can schedule the plurality of tasks with inverse affinity according to the flow graph model. Therefore, the method for constructing the flow graph model with the complex constraint rule is provided, and therefore the task with the complex constraint rule can be subjected to resource scheduling.
It should be noted that: in the foregoing embodiment, when performing resource scheduling, the apparatus for performing resource scheduling is illustrated by only dividing the functional modules, and in practical applications, the function allocation may be completed by different functional modules according to needs, that is, the internal structure of the scheduling server is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for performing resource scheduling and the method for performing resource scheduling provided by the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and will not be described herein again.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware or any combination thereof, and when the implementation is realized by software, all or part of the implementation may be realized in the form of a computer program product. The computer program product includes one or more computer program instructions that when loaded and executed on a dispatch server cause, in whole or in part, the processes or functions described in accordance with embodiments of the invention. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optics, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a dispatch server or a data storage device including one or more integrated servers, data centers, and the like. The usable medium may be a magnetic medium (such as a floppy Disk, a hard Disk, a magnetic tape, etc.), an optical medium (such as a Digital Video Disk (DVD), etc.), or a semiconductor medium (such as a solid state Disk, etc.).
The above description is only an example of the present invention and should not be taken as limiting the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (28)

1. A method for resource scheduling, the method comprising:
if the tasks to be scheduled comprise a plurality of tasks with inverse affinity, establishing a first flow graph model, recording a connection corresponding relation between a task identifier of each task in the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and a connection corresponding relation between the intermediate virtual identifier and each resource node identifier in the first flow graph model, and setting the capacity corresponding to the connection corresponding relation between the intermediate virtual identifier and each resource node identifier as 0 or 1;
and according to the first flow chart model, performing resource scheduling on the plurality of tasks with the inverse affinity.
2. The method according to claim 1, wherein if the tasks to be scheduled include a plurality of tasks with inverse affinity, establishing a first flow graph model in which a connection correspondence relationship between a task identifier of each of the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and a connection correspondence relationship between the intermediate virtual identifier and each resource node identifier are recorded, and setting a capacity corresponding to the connection correspondence relationship between the intermediate virtual identifier and each resource node identifier to 0 or 1, includes:
if the tasks to be scheduled include a plurality of tasks with inverse affinity, establishing a first flow graph model, wherein the first flow graph model records a connection corresponding relationship between a task identifier of each task in the plurality of tasks with inverse affinity and at least one intermediate virtual identifier, and a connection corresponding relationship between each intermediate virtual identifier and a resource node identifier corresponding to each intermediate virtual identifier, and the capacity corresponding to the connection corresponding relationship between each intermediate virtual identifier and the resource node identifier corresponding to each intermediate virtual identifier is set to be 0 or 1, and the at least one intermediate virtual identifier includes: each resource node identification corresponds to an intermediate virtual identification of a plurality of tasks having a counter affinity.
3. The method of claim 1, further comprising:
if the tasks to be scheduled comprise a plurality of tasks with weak affinity, determining a resource node set which can bear the plurality of tasks with weak affinity and contains the least number of resource nodes according to the resource quantity required by each task and the resource quantity contained by each resource node in the plurality of tasks with weak affinity;
establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with weak affinity and each resource node identifier, and sets the cost corresponding to the connection corresponding relation between the task identifier and the resource node identifier of each resource node in the resource node set, and the cost is smaller than the cost corresponding to the connection corresponding relation between the task identifier and the resource node identifier of each resource node outside the resource node set;
and according to the second flow graph model, performing resource scheduling on the plurality of tasks with weak affinity.
4. The method according to claim 3, wherein the establishing a second flowgram model, in which a connection correspondence relationship between a task identifier of each of a plurality of tasks with weak affinity and each resource node identifier is recorded, and a cost corresponding to the connection correspondence relationship between the task identifier and the resource node identifier of each resource node in the resource node set is set to be smaller than a cost corresponding to the connection correspondence relationship between the task identifier and the resource node identifier of each resource node outside the resource node set, comprises:
establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with weak affinity and the first intermediate virtual identifier, and the connection corresponding relation between the first intermediate virtual identifier and each resource node identifier, and sets the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, and the cost is smaller than the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set.
5. The method according to claim 4, wherein the establishing a second flowgram model, in which a connection correspondence relationship between a task identifier of each of a plurality of tasks with weak affinity and a first intermediate virtual identifier and a connection correspondence relationship between the first intermediate virtual identifier and each resource node identifier are recorded, and setting a cost corresponding to the connection correspondence relationship between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set to be smaller than a cost corresponding to the connection correspondence relationship between the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set comprises:
dividing the tasks with weak affinity into a plurality of task sets, wherein the weak affinity degree values among the tasks in each task set are in the same preset range;
establishing a second flow graph model, wherein a connection correspondence between a task identifier of each task in each task set and an intermediate virtual identifier corresponding to each task set, a connection correspondence between an intermediate virtual identifier corresponding to each task set and at least one identifier, and a connection correspondence between the first intermediate virtual identifier and a resource node identifier of each resource node in the resource node set are recorded in the second flow graph model, and the at least one identifier includes: the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set are set, the connection corresponding relation between the intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier and the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set respectively correspond to costs which are smaller than the costs corresponding to the connection corresponding relation between the intermediate virtual identifier corresponding to each task set and the resource node identifier of each resource node outside the resource node set, and the costs corresponding to the connection corresponding relation between the intermediate virtual identifier corresponding to a task set with a larger endpoint value in a corresponding preset range and the first intermediate virtual identifier are set to be smaller.
6. The method of claim 1, further comprising:
if each task to be scheduled comprises a plurality of task sets with inverse affinity, dividing each resource node into a plurality of resource node sets corresponding to each task set, wherein the inverse affinity exists between the tasks in the plurality of task sets;
establishing a third flow chart model, wherein for each task set, the third flow chart model records the connection relationship between the task identifier of each task in the task set and the resource node identifier of the resource node in the resource node set corresponding to the task set;
and according to the third flow chart model, performing resource scheduling on a plurality of tasks in a plurality of task sets.
7. The method according to claim 6, wherein if the tasks to be scheduled include a plurality of task sets with inverse affinity, dividing the resource nodes into a plurality of resource node sets corresponding to each task set comprises:
and for each task set, determining a resource node set capable of bearing the task set according to the resource quantity required by each task in the task set and the resource quantity contained in each resource node.
8. The method of claim 1, further comprising:
if the tasks to be scheduled comprise a plurality of tasks with weak constraint rules, performing first resource scheduling on the plurality of tasks with the weak constraint rules on the premise that the plurality of tasks with the weak constraint rules have strong constraint rules;
and if the plurality of tasks with the weak constraint rules have the tasks with scheduling failures, performing secondary resource scheduling on each task with scheduling failures on the premise that no constraint rules exist among the tasks with scheduling failures.
9. The method according to claim 1, wherein if the tasks to be scheduled include a plurality of tasks with inverse affinity, establishing a first flow graph model in which a connection correspondence relationship between a task identifier of each of the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and a connection correspondence relationship between the intermediate virtual identifier and each resource node identifier are recorded, includes:
if the tasks to be scheduled comprise a plurality of tasks with inverse affinity and the attributes of the tasks are consistent, a first flow graph model is established, and the first flow graph model records the connection corresponding relation between the task identifier of each task in the tasks with inverse affinity and the intermediate virtual identifier corresponding to the tasks with inverse affinity and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier.
10. An apparatus for resource scheduling, the apparatus comprising:
the system comprises an establishing module, a scheduling module and a scheduling module, wherein the establishing module is used for establishing a first flow chart model if each task to be scheduled comprises a plurality of tasks with inverse affinity, the first flow chart model records the connection corresponding relation between a task identifier of each task in the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier, and the capacity corresponding to the connection corresponding relation between the intermediate virtual identifier and each resource node identifier is set to be 0 or 1;
and the scheduling module is used for scheduling the resources of the tasks with the inverse affinity according to the first flow chart model.
11. The apparatus of claim 10, wherein the establishing module is configured to:
if the tasks to be scheduled include a plurality of tasks with inverse affinity, establishing a first flow graph model, wherein the first flow graph model records a connection corresponding relationship between a task identifier of each task in the plurality of tasks with inverse affinity and at least one intermediate virtual identifier, and a connection corresponding relationship between each intermediate virtual identifier and a resource node identifier corresponding to each intermediate virtual identifier, and the capacity corresponding to the connection corresponding relationship between each intermediate virtual identifier and the resource node identifier corresponding to each intermediate virtual identifier is set to be 0 or 1, and the at least one intermediate virtual identifier includes: each resource node identification corresponds to an intermediate virtual identification of a plurality of tasks having a counter affinity.
12. The apparatus of claim 10, further comprising:
the determining module is used for determining a resource node set which can bear the tasks with the weak affinity and contains the least number of resource nodes according to the resource quantity required by each task in the tasks with the weak affinity and the resource quantity contained in each resource node if each task to be scheduled comprises a plurality of tasks with the weak affinity;
the establishing module is further configured to establish a second flowgram model, where a connection correspondence between a task identifier of each task of the multiple tasks with weak affinity and each resource node identifier is recorded in the second flowgram model, and a cost corresponding to the connection correspondence between the task identifier and the resource node identifier of each resource node in the resource node set is set to be smaller than a cost corresponding to the connection correspondence between the task identifier and the resource node identifier of each resource node outside the resource node set;
the scheduling module is further configured to perform resource scheduling on the plurality of tasks with weak affinity according to the second flowgram model.
13. The apparatus of claim 12, wherein the establishing module is configured to:
establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with weak affinity and the first intermediate virtual identifier, and the connection corresponding relation between the first intermediate virtual identifier and each resource node identifier, and sets the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, and the cost is smaller than the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set.
14. The apparatus of claim 13, wherein the establishing module is configured to:
dividing the tasks with weak affinity into a plurality of task sets, wherein the weak affinity degree values among the tasks in each task set are in the same preset range;
establishing a second flow graph model, wherein a connection correspondence between a task identifier of each task in each task set and an intermediate virtual identifier corresponding to each task set, a connection correspondence between an intermediate virtual identifier corresponding to each task set and at least one identifier, and a connection correspondence between the first intermediate virtual identifier and a resource node identifier of each resource node in the resource node set are recorded in the second flow graph model, and the at least one identifier includes: the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set are set, the connection corresponding relation between the intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier and the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set respectively correspond to costs which are smaller than the costs corresponding to the connection corresponding relation between the intermediate virtual identifier corresponding to each task set and the resource node identifier of each resource node outside the resource node set, and the costs corresponding to the connection corresponding relation between the intermediate virtual identifier corresponding to a task set with a larger endpoint value in a corresponding preset range and the first intermediate virtual identifier are set to be smaller.
15. The apparatus of claim 10, further comprising:
the resource node scheduling device comprises a dividing module, a scheduling module and a scheduling module, wherein the dividing module is used for dividing each resource node into a plurality of resource node sets corresponding to each task set if each task to be scheduled comprises a plurality of task sets with inverse affinity, and the tasks in the plurality of task sets have inverse affinity;
the establishing module is further configured to establish a third flow chart model, and for each task set, a connection relationship between a task identifier of each task in the task set and a resource node identifier of a resource node in a resource node set corresponding to the task set is recorded in the third flow chart model;
the scheduling module is further configured to perform resource scheduling on a plurality of tasks in a plurality of task sets according to the third flow graph model.
16. The apparatus of claim 15, wherein the partitioning module is configured to:
and for each task set, determining a resource node set capable of bearing the task set according to the resource quantity required by each task in the task set and the resource quantity contained in each resource node.
17. The apparatus of claim 10, wherein the scheduling module is further configured to:
if the tasks to be scheduled comprise a plurality of tasks with weak constraint rules, performing first resource scheduling on the plurality of tasks with the weak constraint rules on the premise that the plurality of tasks with the weak constraint rules have strong constraint rules;
and if the plurality of tasks with the weak constraint rules have the tasks with scheduling failures, performing secondary resource scheduling on each task with scheduling failures on the premise that no constraint rules exist among the tasks with scheduling failures.
18. The apparatus of claim 10, wherein the establishing module is configured to:
if the tasks to be scheduled comprise a plurality of tasks with inverse affinity and the attributes of the tasks are consistent, a first flow graph model is established, and the first flow graph model records the connection corresponding relation between the task identifier of each task in the tasks with inverse affinity and the intermediate virtual identifier corresponding to the tasks with inverse affinity and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier.
19. A dispatch server, the server comprising a processor, wherein:
the processor is configured to establish a first flow graph model if each task to be scheduled includes a plurality of tasks with inverse affinity, record a connection correspondence between a task identifier of each task of the plurality of tasks with inverse affinity and an intermediate virtual identifier corresponding to the plurality of tasks with inverse affinity and a connection correspondence between the intermediate virtual identifier and each resource node identifier in the first flow graph model, and set a capacity corresponding to the connection correspondence between the intermediate virtual identifier and each resource node identifier to 0 or 1; and according to the first flow chart model, performing resource scheduling on the plurality of tasks with the inverse affinity.
20. The dispatch server of claim 19, wherein the processor is configured to:
if the tasks to be scheduled include a plurality of tasks with inverse affinity, establishing a first flow graph model, wherein the first flow graph model records a connection corresponding relationship between a task identifier of each task in the plurality of tasks with inverse affinity and at least one intermediate virtual identifier, and a connection corresponding relationship between each intermediate virtual identifier and a resource node identifier corresponding to each intermediate virtual identifier, and the capacity corresponding to the connection corresponding relationship between each intermediate virtual identifier and the resource node identifier corresponding to each intermediate virtual identifier is set to be 0 or 1, and the at least one intermediate virtual identifier includes: each resource node identification corresponds to an intermediate virtual identification of a plurality of tasks having a counter affinity.
21. The dispatch server of claim 19, wherein the processor is further configured to:
if the tasks to be scheduled comprise a plurality of tasks with weak affinity, determining a resource node set which can bear the plurality of tasks with weak affinity and contains the least number of resource nodes according to the resource quantity required by each task and the resource quantity contained by each resource node in the plurality of tasks with weak affinity;
establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with weak affinity and each resource node identifier, and sets the cost corresponding to the connection corresponding relation between the task identifier and the resource node identifier of each resource node in the resource node set, and the cost is smaller than the cost corresponding to the connection corresponding relation between the task identifier and the resource node identifier of each resource node outside the resource node set;
and according to the second flow graph model, performing resource scheduling on the plurality of tasks with weak affinity.
22. The dispatch server of claim 21, wherein the processor is configured to:
establishing a second flow graph model, wherein the second flow graph model records the connection corresponding relation between the task identifier of each task in the plurality of tasks with weak affinity and the first intermediate virtual identifier, and the connection corresponding relation between the first intermediate virtual identifier and each resource node identifier, and sets the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, and the cost is smaller than the cost corresponding to the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set.
23. The dispatch server of claim 22, wherein the processor is configured to:
dividing the tasks with weak affinity into a plurality of task sets, wherein the weak affinity degree values among the tasks in each task set are in the same preset range;
establishing a second flow graph model, wherein a connection correspondence between a task identifier of each task in each task set and an intermediate virtual identifier corresponding to each task set, a connection correspondence between an intermediate virtual identifier corresponding to each task set and at least one identifier, and a connection correspondence between the first intermediate virtual identifier and a resource node identifier of each resource node in the resource node set are recorded in the second flow graph model, and the at least one identifier includes: the first intermediate virtual identifier and the resource node identifier of each resource node outside the resource node set are set, the connection corresponding relation between the intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier and the connection corresponding relation between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set respectively correspond to costs which are smaller than the costs corresponding to the connection corresponding relation between the intermediate virtual identifier corresponding to each task set and the resource node identifier of each resource node outside the resource node set, and the costs corresponding to the connection corresponding relation between the intermediate virtual identifier corresponding to a task set with a larger endpoint value in a corresponding preset range and the first intermediate virtual identifier are set to be smaller.
24. The dispatch server of claim 19, wherein the processor is further configured to:
if each task to be scheduled comprises a plurality of task sets with inverse affinity, dividing each resource node into a plurality of resource node sets corresponding to each task set, wherein the inverse affinity exists between the tasks in the plurality of task sets;
establishing a third flow chart model, wherein for each task set, the third flow chart model records the connection relationship between the task identifier of each task in the task set and the resource node identifier of the resource node in the resource node set corresponding to the task set;
and according to the third flow chart model, performing resource scheduling on a plurality of tasks in a plurality of task sets.
25. The dispatch server of claim 24, wherein the processor is configured to:
and for each task set, determining a resource node set capable of bearing the task set according to the resource quantity required by each task in the task set and the resource quantity contained in each resource node.
26. The dispatch server of claim 19, wherein the processor is further configured to:
if the tasks to be scheduled comprise a plurality of tasks with weak constraint rules, performing first resource scheduling on the plurality of tasks with the weak constraint rules on the premise that the plurality of tasks with the weak constraint rules have strong constraint rules;
and if the plurality of tasks with the weak constraint rules have the tasks with scheduling failures, performing secondary resource scheduling on each task with scheduling failures on the premise that no constraint rules exist among the tasks with scheduling failures.
27. The dispatch server of claim 19, wherein the processor is configured to:
if the tasks to be scheduled comprise a plurality of tasks with inverse affinity and the attributes of the tasks are consistent, a first flow graph model is established, and the first flow graph model records the connection corresponding relation between the task identifier of each task in the tasks with inverse affinity and the intermediate virtual identifier corresponding to the tasks with inverse affinity and the connection corresponding relation between the intermediate virtual identifier and each resource node identifier.
28. A computer-readable storage medium comprising instructions that, when executed on a dispatch server, cause the dispatch server to perform the method of any of claims 1-9.
CN201710198284.3A 2017-03-29 2017-03-29 Method and device for scheduling resources Active CN108667864B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710198284.3A CN108667864B (en) 2017-03-29 2017-03-29 Method and device for scheduling resources
PCT/CN2018/080949 WO2018177335A1 (en) 2017-03-29 2018-03-28 Method and device for scheduling resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710198284.3A CN108667864B (en) 2017-03-29 2017-03-29 Method and device for scheduling resources

Publications (2)

Publication Number Publication Date
CN108667864A CN108667864A (en) 2018-10-16
CN108667864B true CN108667864B (en) 2020-07-28

Family

ID=63674247

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710198284.3A Active CN108667864B (en) 2017-03-29 2017-03-29 Method and device for scheduling resources

Country Status (2)

Country Link
CN (1) CN108667864B (en)
WO (1) WO2018177335A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116841709A (en) * 2018-10-26 2023-10-03 创新先进技术有限公司 Wind control task grouping method and device in wind control service system and computer equipment
CN110515716B (en) * 2019-08-29 2021-11-30 中国科学院软件研究所 Cloud optimization scheduling method and system supporting priority and inverse affinity
CN113254220A (en) * 2021-07-01 2021-08-13 国汽智控(北京)科技有限公司 Networked automobile load cooperative control method, device, equipment and storage medium
CN117056431B (en) * 2023-10-11 2024-02-09 中电数创(北京)科技有限公司 Distributed execution method and system for two-stage scheduling based on hbase affinity computation

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7275249B1 (en) * 2002-07-30 2007-09-25 Unisys Corporation Dynamically generating masks for thread scheduling in a multiprocessor system
CN101853178A (en) * 2010-04-30 2010-10-06 西安交通大学 Description method of reconfigurable hardware resource in scheduling
CN102027452A (en) * 2008-05-16 2011-04-20 微软公司 Scheduling collections in a scheduler
CN102255926A (en) * 2010-05-17 2011-11-23 中国移动通信集团公司 Task distribution method in map reduce (MR) system, system and apparatus thereof
CN102902573A (en) * 2012-09-20 2013-01-30 北京搜狐新媒体信息技术有限公司 Task processing method and device based on shared resources
CN104137482A (en) * 2014-04-14 2014-11-05 华为技术有限公司 Disaster recovery data center configuration method and device under cloud computing framework
CN104142853A (en) * 2014-08-12 2014-11-12 华为技术有限公司 Virtual machine storage resource deployment method and device
CN104239141A (en) * 2014-09-05 2014-12-24 北京邮电大学 Task optimized-scheduling method in data center on basis of critical paths of workflow
CN104572314A (en) * 2013-10-22 2015-04-29 华为技术有限公司 Inter-process communication method and device
CN104811431A (en) * 2014-01-29 2015-07-29 华为技术有限公司 Data packet processing method and device based on parallel protocol stack instance
CN105656646A (en) * 2014-11-10 2016-06-08 中国移动通信集团公司 Deploying method and device for virtual network element
CN105939290A (en) * 2012-08-14 2016-09-14 华为技术有限公司 Resource allocation method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8949472B2 (en) * 2008-09-10 2015-02-03 International Business Machines Corporation Data affinity based scheme for mapping connections to CPUs in I/O adapter
CN104090826B (en) * 2014-06-30 2017-07-11 中国电子科技集团公司第三十二研究所 Task optimization deployment method based on correlation
CN106534318B (en) * 2016-11-15 2019-10-29 浙江大学 A kind of OpenStack cloud platform resource dynamic scheduling system and method based on flow compatibility

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7275249B1 (en) * 2002-07-30 2007-09-25 Unisys Corporation Dynamically generating masks for thread scheduling in a multiprocessor system
CN102027452A (en) * 2008-05-16 2011-04-20 微软公司 Scheduling collections in a scheduler
CN101853178A (en) * 2010-04-30 2010-10-06 西安交通大学 Description method of reconfigurable hardware resource in scheduling
CN102255926A (en) * 2010-05-17 2011-11-23 中国移动通信集团公司 Task distribution method in map reduce (MR) system, system and apparatus thereof
CN105939290A (en) * 2012-08-14 2016-09-14 华为技术有限公司 Resource allocation method and device
CN102902573A (en) * 2012-09-20 2013-01-30 北京搜狐新媒体信息技术有限公司 Task processing method and device based on shared resources
CN104572314A (en) * 2013-10-22 2015-04-29 华为技术有限公司 Inter-process communication method and device
CN104811431A (en) * 2014-01-29 2015-07-29 华为技术有限公司 Data packet processing method and device based on parallel protocol stack instance
CN104137482A (en) * 2014-04-14 2014-11-05 华为技术有限公司 Disaster recovery data center configuration method and device under cloud computing framework
CN104142853A (en) * 2014-08-12 2014-11-12 华为技术有限公司 Virtual machine storage resource deployment method and device
CN104239141A (en) * 2014-09-05 2014-12-24 北京邮电大学 Task optimized-scheduling method in data center on basis of critical paths of workflow
CN105656646A (en) * 2014-11-10 2016-06-08 中国移动通信集团公司 Deploying method and device for virtual network element

Also Published As

Publication number Publication date
WO2018177335A1 (en) 2018-10-04
CN108667864A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
CN108667864B (en) Method and device for scheduling resources
CN108595157B (en) Block chain data processing method, device, equipment and storage medium
US20190166192A1 (en) Method and Device for Storage Resource Allocation for Video Cloud Storage
CN107453929B (en) Cluster system self-construction method and device and cluster system
JP6083290B2 (en) Distributed processing system
CN105979007A (en) Acceleration resource processing method and device and network function virtualization system
CN104123184A (en) Method and system for allocating resources for tasks in constructing process
CN108809848A (en) Load-balancing method, device, electronic equipment and storage medium
WO2014194704A1 (en) A grouping processing method and system
CN107203464B (en) Method and device for positioning service problem
CN105183585A (en) Data backup method and device
Meskar et al. Fair multi-resource allocation in mobile edge computing with multiple access points
CN115293340A (en) Data synchronization processing method and device, computing equipment and storage medium
CN104968051B (en) A kind of resource allocation methods and device of partial wideband uplink
CN104657216A (en) Resource allocation method and device for resource pool
CN110333824B (en) Capacity expansion method and device for storage system
US10901972B2 (en) Table partition configuration method, apparatus and system for database system
CN116954490A (en) Data processing method, device, electronic equipment and storage medium
CN113485798B (en) Nuclear function generation method, device, equipment and storage medium
US9479579B2 (en) Grouping processing method and system
CN110391929B (en) Fault-tolerant control method and device and fault-tolerant component
CN113126884B (en) Data migration method, data migration device, electronic equipment and computer storage medium
CN102868594A (en) Method and device for message processing
CN112860422A (en) Method, apparatus and computer program product for job processing
US11502971B1 (en) Using multi-phase constraint programming to assign resource guarantees of consumers to hosts

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant