WO2018177335A1 - 一种进行资源调度的方法和装置 - Google Patents

一种进行资源调度的方法和装置 Download PDF

Info

Publication number
WO2018177335A1
WO2018177335A1 PCT/CN2018/080949 CN2018080949W WO2018177335A1 WO 2018177335 A1 WO2018177335 A1 WO 2018177335A1 CN 2018080949 W CN2018080949 W CN 2018080949W WO 2018177335 A1 WO2018177335 A1 WO 2018177335A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
identifier
resource node
tasks
resource
Prior art date
Application number
PCT/CN2018/080949
Other languages
English (en)
French (fr)
Inventor
李琳
王光睿
樊瑞
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018177335A1 publication Critical patent/WO2018177335A1/zh

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

Definitions

  • the present invention relates to the field of resource scheduling technologies, and in particular, to a method and apparatus for performing resource scheduling.
  • resource scheduling is to assign each task to be scheduled to each resource node under certain constraint rules.
  • the resource node may be a service server, and 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 performs a corresponding task, for example, for example,
  • the resource capacity is the storage capacity, and the scheduling server can schedule each task to the service server capable of carrying the task according to the known storage capacity required for each task and the storage capacity included in each service server.
  • the constraint rule may be that there is affinity between certain tasks (that is, the tasks must be scheduled on the same resource node), and there is a reverse affinity between a task and a resource node (ie, the task is not scheduled in the task)
  • the scheduling server will schedule the tasks to be scheduled to the corresponding resource nodes according to the constraint rules.
  • the flow graph method is often used to perform resource scheduling for each task to be scheduled. That is, when resource scheduling is performed, a flow graph model that can satisfy the constraint rule can be constructed first, and then, according to the constructed flow graph model. The task is dispatched to the resource node.
  • the scheduling server first establishes a flow graph model when the resource is scheduled, wherein the flow graph model records the task.
  • the identity (due to the affinity between tasks, the task identifier can be an identifier indicating all tasks) and the connection relationship of each resource node identifier, and then the scheduling server can according to the total amount of resources required for all tasks and The amount of resources included in each resource node determines the capacity and cost corresponding to each connection correspondence.
  • the capacity and cost corresponding to each connection correspondence can be used as the input of the minimum cost maximum flow algorithm, and one corresponding to the task identifier is determined.
  • Resource node ID ie, each task can be scheduled to the determined resource section Resource identifier corresponding to the node), so that, according to the flow diagram of the constructed model to determine the result of scheduling tasks to meet the constraint rules having affinity.
  • the embodiment of the present invention provides a method and device for performing resource scheduling.
  • the technical solution is as follows:
  • a method for performing resource scheduling comprising: if a task having a reverse affinity is included in each task to be scheduled, a first flow graph model may be established, wherein the first flow graph model Recording a connection identifier of a task identifier of each of a plurality of tasks having reverse affinity with an intermediate virtual identifier corresponding to a plurality of tasks having reverse affinity, and an intermediate virtual identifier and each resource node
  • the connected connection correspondence is set, and the capacity corresponding to the connection correspondence between the intermediate virtual identifier and each resource node identifier is set to 0 or 1.
  • resource scheduling is performed on multiple tasks with reverse affinity.
  • the scheduling server may establish a first flow graph model, and when the first flow graph model is established, the anti-parent may be established.
  • the anti-affinity constraint rule can be met by setting the capacity corresponding to the connection correspondence between the intermediate virtual identifier and the identifier of each resource node.
  • the corresponding capacity can be set to 0 or 1.
  • the scheduling server can perform resource scheduling on multiple tasks with anti-affinity based on the constructed first flow graph model, that is, the task with complex constraint rules can perform resource scheduling.
  • each task to be scheduled includes multiple tasks with anti-affinity
  • the first flow graph model is established, and the first flow graph model records multiple tasks with anti-affinity a connection correspondence between the task identifier of each task and an intermediate virtual identifier corresponding to a plurality of tasks having reverse affinity, and a connection correspondence between the intermediate virtual identifier and each resource node identifier, including: if to be scheduled
  • Each task includes multiple tasks with anti-affinity and the attributes of multiple tasks are consistent, then a first flow graph model is established, and each of the plurality of tasks with anti-affinity is recorded in the first flow graph model.
  • the connection identifier corresponds to a connection correspondence corresponding to an intermediate virtual identifier of a plurality of tasks having reverse affinity, and a connection correspondence between the intermediate virtual identifier and each resource node identifier.
  • the first flow graph model may be constructed in the above manner. In this way, it can be guaranteed that more tasks can be scheduled successfully, that is, more tasks can be assigned to the resource nodes.
  • each task to be scheduled includes multiple tasks with anti-affinity
  • the first flow graph model is established, and the first flow graph model records multiple tasks with anti-affinity
  • the connection identifier of each task in the task corresponds to the connection correspondence of the intermediate virtual identifier corresponding to the plurality of tasks having the reverse affinity, and the connection correspondence between the intermediate virtual identifier and each resource node identifier, and the intermediate virtual identifier and each
  • the capacity corresponding to the connection correspondence of the resource node identifiers is set to 0 or 1, including: if each task to be scheduled includes multiple tasks with reverse affinity, the first flow graph model is established, and the first flow graph model records a task identifier of each of a plurality of tasks having anti-affinity and a connection correspondence of each resource node identifier corresponding to an intermediate virtual identifier of a plurality of tasks having anti-affinity, and each intermediate virtual identifier a connection corresponding to the resource node identifier corresponding to each intermediate virtual identifier, and a resource
  • the scheduling server may establish a task identifier of each task of the plurality of tasks with anti-affinity when establishing the first flow graph model.
  • Each resource node identifies a connection correspondence corresponding to an intermediate virtual identifier of a plurality of tasks having reverse affinity, and a connection correspondence relationship between each intermediate virtual identifier and a resource node identifier corresponding to each intermediate virtual identifier, that is, has a reverse
  • the number of intermediate virtual identifiers corresponding to multiple tasks of affinity is consistent with the number of resource node identifiers, and corresponds to multiple tasks with reverse affinity, and each resource node identifier corresponds to an intermediate virtual identifier.
  • the capacity corresponding to the connection correspondence of the resource node identifier corresponding to each intermediate virtual identifier and each intermediate virtual identifier may be set to 0 or 1. In this way, while scheduling multiple tasks with anti-affinity, it is also possible to ensure that as many tasks as possible can be assigned to resource nodes.
  • the method further includes: if each task to be scheduled includes multiple tasks with weak affinity, according to each of a plurality of tasks having weak affinity The amount of resources and the amount of resources included in each resource node, determine a set of resource nodes that can carry multiple tasks with weak affinity and contain the fewest number of resource nodes; establish a second flow graph model, a second flow graph model Recording a connection correspondence between a task identifier of each of the plurality of tasks having weak affinity and each resource node identifier, and setting a task identifier and a resource node of each resource node in the resource node set The cost corresponding to the identified connection correspondence is smaller than the cost corresponding to the connection correspondence between the task identifier and the resource node identifier of each resource node except the resource node set; according to the second flow graph model, the weak affinity is Tasks are scheduled for resources.
  • the scheduling server may first determine that multiple tasks with weak affinity can be carried, and the included resource nodes The least number of resource node sets, and then the second flow graph model is established.
  • the second flow graph model is established, the task identifier and each resource node identifier of each of the plurality of tasks with weak affinity can be established.
  • the cost when the cost is set, the cost corresponding to the connection correspondence between the task identifier and the resource node identifier of each resource node in the resource node set may be set, which is smaller than each of the task identifier and the resource node set.
  • resource scheduling is performed on multiple tasks with weak affinity.
  • multiple tasks with weak affinity can be allocated as much as possible on fewer resource nodes, satisfying the constraint rules of weak affinity.
  • a second flow graph model is established, and a task identifier of each of the plurality of tasks recorded with weak affinity recorded in the second flow graph model corresponds to a connection of each resource node identifier Relationship, and setting 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, less than the connection of the resource identifier of each resource node except the task identifier and the resource node set
  • the cost corresponding to the correspondence includes: establishing a second flow graph model, wherein the second flow graph model records a connection correspondence between the task identifier of each of the plurality of tasks having weak affinity and the first intermediate virtual identifier And a connection correspondence between the first intermediate virtual identifier and each resource node identifier, and setting a cost corresponding to the connection correspondence between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, which is smaller than the first Corresponding to the connection correspondence between the intermediate
  • the scheduling server may establish, by using the first intermediate virtual identifier, a task identifier of multiple tasks with weak affinity and a connection corresponding to each resource node identifier. Relationship, and may set a minimum cost corresponding to the connection correspondence between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set. In this way, multiple tasks with weak affinity can be allocated as much as possible on fewer resource nodes, satisfying the constraint rules of weak affinity.
  • a second flow graph model is established, and the task identifier of each of the plurality of tasks recorded with weak affinity recorded in the second flow graph model corresponds to the connection of the first intermediate virtual identifier a relationship, and a connection correspondence between the first intermediate virtual identifier and each resource node identifier, and setting a cost corresponding to the connection correspondence between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set,
  • the cost corresponding to the connection correspondence between the first intermediate virtual identifier and the resource node identifier of each resource node other than the resource node set includes: dividing a plurality of tasks having weak affinity into multiple task sets, The value of the degree of weak affinity between each task in each task set is within the same preset range; the second flow graph model is established, and each task in each task set is recorded in the second flow graph model.
  • the task identifier corresponds to the connection correspondence of the intermediate virtual identifier corresponding to each task set, the intermediate virtual identifier corresponding to each task set, and the first intermediate a connection correspondence between the virtual identifier and the resource node identifier of each resource node except the set of resource nodes, and a connection correspondence between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, and Corresponding to the connection correspondence between the intermediate virtual identifier corresponding to each of the task sets 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 respectively
  • the cost the cost corresponding to the connection correspondence between the intermediate virtual identifier corresponding to each task set and the resource node identifier of each resource node except the resource node set, and the greater the endpoint value of the corresponding preset range
  • multiple tasks with weak affinity may be divided into multiple tasks.
  • an intermediate virtual identifier may be separately set, and the corresponding correspondence value of the weak correspondence degree is larger, and the weaker affinity degree value is larger. The more intimate, that is, the more resources are allocated to the same resource node. In this way, it can be ensured that tasks with a large degree of weak affinity can be allocated to resource nodes in the resource node set as much as possible.
  • the method further includes: if each task to be scheduled includes multiple task sets having reverse affinity, dividing each resource node into multiple resource nodes corresponding to each task set a set, wherein the tasks in the plurality of task sets have anti-affinity; establishing a third flow graph model, for each task set, the task identifier of each task in the task set is recorded in the third flow graph model a connection relationship of the resource node identifiers of the resource nodes in the resource node set corresponding to the task set; according to the third flow graph model, resource scheduling is performed on multiple tasks in the plurality of task sets.
  • the scheduling server may divide each resource node into multiple resource nodes corresponding to each task set, for the case that each task to be scheduled includes multiple task sets with anti-affinity.
  • a collection, each task set, performs resource scheduling in a corresponding set of resource nodes.
  • each resource node is divided into multiple resource node sets corresponding to each task set, including:
  • Each task set determines a set of resource nodes capable of carrying the task set according to the amount of resources required by each task in the task set and the amount of resources included in each resource node.
  • the resource node set capable of carrying the task set may be determined according to the resource quantity required by each task in the task set and the resource quantity included in each resource node. . This can improve the resource utilization of resource nodes.
  • the method further includes: if each task to be scheduled includes multiple tasks with weak constraint rules, if there are strong constraint rules between multiple tasks with weak constraint rules Performing the first resource scheduling on the plurality of tasks having the weak constraint rule; if there are tasks with the scheduling failure in the plurality of tasks having the weak constraint rule, if there is no constraint rule between the tasks that fail to be scheduled, The second resource scheduling is performed on each task that fails to be scheduled.
  • the solution shown in the embodiment of the present invention may perform two resource scheduling for the case that each task to be scheduled includes a weak constraint rule, and the first resource scheduling may be performed under the premise that each task has a strong constraint rule.
  • the secondary resource scheduling may be a task that fails to be scheduled for the first resource scheduling.
  • the resource scheduling may perform resource scheduling for each task that fails to be scheduled without the constraint rule. This ensures that the constraint rules are met as much as possible, and resource utilization can be improved.
  • the second aspect provides an apparatus for performing resource scheduling, 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 by the foregoing first aspect.
  • a scheduling server in a third aspect, includes a processor, a processor configured to execute an instruction stored in the memory, and the processor implements the method for resource scheduling provided by the first aspect by executing the instruction .
  • a computer readable storage medium comprising instructions that, when executed on a dispatch server, cause the dispatch server to perform the method of the first aspect described above.
  • a flow graph model of the task identifier of each task including the reverse affinity and the resource identifier of each resource node may be established.
  • a flow graph model records a connection correspondence between a task identifier of each task of the plurality of tasks having reverse affinity and an intermediate virtual identifier, and a connection correspondence between the intermediate virtual identifier and each resource node identifier, The capacity corresponding to the connection correspondence between the intermediate virtual identifier and each resource node identifier is set to 0 or 1.
  • the scheduling server may perform resource scheduling on multiple tasks with reverse affinity according to the flow graph model. In this way, a method for constructing a flow graph model with complex constraint rules is provided, thereby enabling resource scheduling for tasks with complex constraint rules.
  • FIG. 1 is a schematic diagram of a system framework provided by an embodiment of the present invention.
  • FIG. 2 is a flowchart of a method for performing resource scheduling according to an embodiment of the present invention
  • FIG. 3(a) is a schematic diagram of a flow graph model provided by an embodiment of the present invention.
  • FIG. 3(b) is a schematic diagram of a flow graph model according to an embodiment of the present invention.
  • FIG. 3(c) is a schematic diagram of a flow graph model provided by an embodiment of the present invention.
  • FIG. 3(d) is a schematic diagram of a flow graph model provided by an embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for performing resource scheduling according to an embodiment of the present invention.
  • FIG. 5(a) is a schematic diagram of a flow graph model according to an embodiment of the present invention.
  • FIG. 5(b) is a schematic diagram of a flow graph model according to an embodiment of the present invention.
  • FIG. 5(c) is a schematic diagram of a flow graph model provided by an embodiment of the present invention.
  • FIG. 6 is a flowchart of a method for performing resource scheduling according to an embodiment of the present invention.
  • FIG. 7(a) is a schematic diagram of a flow graph model provided by an embodiment of the present invention.
  • FIG. 7(b) is a schematic diagram of a flow graph model according to 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 disclosure.
  • 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.
  • the embodiment of the invention provides a method for performing resource scheduling, and the execution entity of the method is a scheduling server.
  • the server may be a server with resource scheduling function.
  • the scheduling server can include a processor 110, a memory 120, and the processor 110 can be coupled to the memory 120, as shown in FIG.
  • the processor 110 may include one or more processing units; the processor 110 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP Processor, etc.), and the like. Signal processor (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device.
  • the program can include program code, the program code including computer operating instructions.
  • the dispatch server may also include a memory 120 that may be used to store software programs and modules, and the processor 110 performs data processing by reading software code and modules stored in the memory 120.
  • Step 201 If a plurality of tasks having reverse affinity are included in each task to be scheduled, establishing a first flow graph model, wherein each of the plurality of tasks having anti-affinity is recorded in the first flow graph model The connection relationship between the task identifier and the intermediate virtual identifier corresponding to the plurality of tasks having the reverse affinity, and the connection correspondence between the intermediate virtual identifier and each resource node identifier, and the connection between the intermediate virtual identifier and each resource node identifier The capacity corresponding to the correspondence is set to 0 or 1.
  • the intermediate virtual identifier may be an auxiliary identifier used to establish a flow graph model that satisfies the complex constraint rule, and may be a secondary node used to establish a connection correspondence between the task identifier and the resource node identifier.
  • the scheduling server may establish a compliance constraint rule for multiple tasks when performing resource scheduling on multiple tasks with reverse affinity.
  • a flow graph model with reverse affinity (which can be called a first flow graph model). Specifically, in the first flow graph model, a correspondence between a task identifier of each task of the plurality of tasks with reverse affinity and an intermediate virtual identifier connection, and a connection relationship between the intermediate virtual identifier and each resource node identifier may be recorded,
  • the intermediate virtual identifier in the first flow graph model may be an intermediate virtual identifier corresponding to multiple task identifiers (that is, each task to be scheduled includes other task sets including multiple tasks with anti-affinity. Each other task set can also have an intermediate virtual identifier).
  • the scheduling server is a constraint rule that has anti-affinity for multiple tasks, and may also limit the capacity corresponding to the connection correspondence (that is, limit the capacity corresponding to each edge in the flow graph model), and the intermediate virtual may be The capacity corresponding to the connection correspondence identifying each resource node identifier is set to 0 or 1. That is, the capacity corresponding to the connection correspondence between the intermediate virtual identifier and each resource node identifier may be 0, or may be 1, and may not be greater than 1, wherein the capacity corresponding to the connection correspondence is 0 or 1, and may be The amount of resources required for multiple tasks and the amount of resources included in the resource nodes corresponding to each resource node identifier are determined.
  • 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 first flow graph model may record the connection correspondence between P0 and P1 and T respectively, and the correspondence between T and M0, M1, and M2 respectively, and the scheduling server may Set the corresponding correspondence between T and M0, M1, and M2 (ie, T-M0 side, T-M1 side, and T-M2 side) to be 0 or 1 (when M0 contains resources greater than or equal to P0 and P1)
  • the capacity corresponding to the connection correspondence between T and M0 may be 1.
  • the capacity corresponding to the connection correspondence between T and M0 may be 0)
  • the flow graph model is established such that at most one task of P0 and P1 can be assigned to a resource node, and the first flow graph model in Fig. 3(a) can be a single-start single-endflow graph model. That is, each resource identifier and end can also be recorded in the first flow graph model. D is connected to the corresponding relationship, each connected to the start point S and the task identifier corresponding relationship can also be recorded for each task unscheduled identifier and the node connected to the corresponding relationship U, U and D are connected to the corresponding relationship.
  • the first flow graph model may not be provided with the unscheduled node U, but the connection correspondence between T and D may be recorded.
  • each task to be scheduled includes a plurality of task sets (wherein multiple tasks included in each task set have anti-affinity), for each task including multiple tasks having anti-affinity
  • the collection and scheduling servers can construct a flow graph model according to the above method.
  • the task identifiers of the plurality of tasks having the anti-affinity in the first task set are P0, P1
  • the task identifiers of the plurality of tasks having the reverse affinity in the second task set are P2, P3, P4, and currently
  • 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, and the first task set is used.
  • the first flow graph model may record the connection correspondence between P0 and P1 and T0, and the connection relationship between T0 and M0, M1, and M2, respectively, and the scheduling server may respectively set the connection of T0 and M0, M1, and M2.
  • the relationship ie, T0-M0 side, T0-M1 side, T0-M2 side
  • T0-M2 side corresponds to a capacity of 0 or 1; for the second task set, the connection of P2, P3, and P4 to T1 can be recorded in the first flow graph model.
  • T1 corresponds to the connection of M0, M1, M2 respectively
  • the scheduling server can respectively set the connection correspondence between T1 and M0, M1, M2 (ie, T1-M0 side, T1-M1 side, T1-M2 side)
  • the corresponding capacity is 0 or 1.
  • the first flow graph model in Figure 3(b) can be The single-start single-endflow graph model, that is, the first-flow graph model may also record the connection correspondence between each resource identifier and the destination D, and the connection correspondence between each task identifier and the starting point S.
  • the first flow graph model may not be set.
  • the non-scheduling node U records, for each task set, the connection correspondence between the intermediate virtual identifier corresponding to the task set and D.
  • a non-scheduled node may be set, and for each task set, a connection correspondence between a task identifier of each task in the task set and a non-scheduled node U corresponding to the task set may be recorded, And the connection relationship between the unscheduled nodes U and D, or each task set corresponds to a non-scheduled node U, that is, the connection correspondence between the task identifier of each task and U, and the connection relationship between U and D are recorded.
  • each task to be scheduled may include other tasks that do not have constraint rules or have simple constraint rules.
  • the corresponding flow graph model can be constructed according to the existing flow graph model construction method.
  • the first flow graph model may be established if the attributes of the multiple tasks having the reverse affinity are consistent.
  • the processing of step 201 may be as follows: if each task to be scheduled includes the opposite parent And the plurality of tasks and the attributes of the plurality of tasks are consistent, the first flow graph model is established, and the task identifier of each of the plurality of tasks having the reverse affinity recorded in the first flow graph model corresponds to having the opposite The connection correspondence between the intermediate virtual identifiers of the plurality of tasks of the affinity, and the connection correspondence between the intermediate virtual identifier and each resource node identifier.
  • the scheduling server determines multiple tasks with anti-affinity, it can also determine whether the attributes of multiple tasks with reverse affinity are consistent, and if the attributes of multiple tasks with anti-affinity are consistent, Then, the first flow graph model may be established according to the processing manner of step 201, wherein the consistency of the attributes may be that the required resources are consistent.
  • an intermediate virtual identifier corresponding to each resource node identifier may be established, and correspondingly, the processing may be as follows: if each task to be scheduled includes reverse affinity a plurality of tasks, the first flow graph model is established, and the task identifier of each of the plurality of tasks recorded with the anti-affinity in the first flow graph model corresponds to each resource node identifier corresponding to the anti-affinity
  • the connection correspondence between the intermediate virtual identifiers of the multiple tasks and the connection correspondence between the resource identifiers corresponding to each intermediate virtual identifier and each intermediate virtual identifier, and the resources corresponding to each intermediate virtual identifier and each intermediate virtual identifier The capacity corresponding to the connection correspondence of the node identifier is set to 0 or 1.
  • the scheduling server may also set a corresponding intermediate virtual identifier for each resource node identifier.
  • a connection correspondence between a task identifier of each of the plurality of tasks having reverse affinity and an intermediate virtual identifier corresponding to each resource node identifier may be recorded, and for each intermediate virtual And the identifier corresponding to the connection relationship between the intermediate virtual identifier and the resource node identifier corresponding to the intermediate virtual identifier, and the capacity corresponding to the connection correspondence between the intermediate virtual identifier and the resource node identifier corresponding to the intermediate virtual identifier is set to 0. Or 1, wherein the intermediate virtual identifier in the first flow graph model may be a resource node identifier and an intermediate virtual identifier corresponding to multiple tasks having reverse affinity.
  • a first flow graph model as shown in FIG. 3(c) may be established, where The intermediate virtual identifier corresponding to each resource node identifier is V0, V1, and V2, respectively, and the first flow graph model may record the connection correspondence between P0 and P1 and V0, V1, and V2, and V0 and M0, V1, and M1.
  • the scheduling server can set the capacity corresponding to the connection correspondence between V0 and M0, V1 and M1, V2 and M2 to be 0 or 1. It can be seen that the flow graph model can be established in this way.
  • the first flow graph model in Figure 3(c) can be a single-start single-endflow graph model, that is, each resource can be recorded in the first-flow graph model.
  • each task can be recorded in the first flow graph model.
  • Task identification with U Then the correspondence relationship, and U and D are connected to the corresponding relationship.
  • each task to be scheduled includes a plurality of task sets (wherein multiple tasks included in each task set have anti-affinity), for each task including multiple tasks having anti-affinity
  • the collection and scheduling servers can construct a flow graph model according to the above method.
  • the task identifiers of the plurality of tasks having the anti-affinity in the first task set are P0, P1
  • the task identifiers of the plurality of tasks having the reverse affinity in the second task set are P2, P3, P4, and currently
  • the resource node identifiers are M0, M1, and M2
  • the scheduling server can establish a first flow graph model as shown in FIG. 3(d).
  • the intermediate virtual nodes in the first flow graph model are V00, V10, V01, V11, and V02.
  • V12 (wherein V00, V01, V02 may be P0, P1 corresponds to an intermediate virtual identifier of each resource node identifier, and V10, V11, V12 may be P2, P3, and P4 correspond to an intermediate virtual identifier of each resource node identifier.
  • the first flow graph model may record the connection correspondence between P0 and P1 and V00, V01, V02, the connection relationship between V00 and M0, V01 and M1, V02 and M2, and the scheduling
  • the server may respectively set the capacity corresponding to the connection correspondence between V00 and M0, V01 and M1, V02 and M2 to be 0 or 1; for the second task set, P2, P3, P4 and V10 may be recorded in the first flow graph model, respectively.
  • the first-class graph model may be a single-start single-endflow graph model, that is, the first-flow graph model may also record the connection correspondence between each resource identifier and the destination D, and the connection correspondence between each task identifier and the starting point S, the first flow graph. In the model, the presence or absence of the scheduling nodes U1 and U2 may be set.
  • the first flow graph model may record the task identifier of each task in the task set and the non-scheduled corresponding to the task set.
  • only one unscheduled node U can be set in the first flow graph model.
  • Step 202 Perform resource scheduling on multiple tasks with reverse affinity according to the first flow graph model.
  • the corresponding resource correspondences may be determined according to the amount of resources required by each of the plurality of tasks having the reverse affinity and the resources included in the resource nodes. Capacity and cost. Further, each connection correspondence and its corresponding capacity and cost can be used as input of the minimum cost maximum flow algorithm, and resource scheduling is performed on multiple tasks with reverse affinity, wherein after obtaining the flow graph model, It is a prior art to determine the capacity and cost of each connection correspondence and the minimum cost maximum flow algorithm, which will not be described in detail in the embodiments of the present invention.
  • the constraint rule may also correspond to a constraint degree value, that is, may also include a strong constraint rule (for example, strong anti-affinity may be that multiple tasks with strong anti-affinity must not be on the same resource node) and weak constraints Rules (eg, weak anti-affinity may be that multiple tasks with weak anti-affinity are preferably not on the same resource node, may be allowed on the same resource node), with anti-affinity as described in step 201 Multiple tasks of sex can be strongly anti-affinity.
  • strong constraint rule for example, strong anti-affinity may be that multiple tasks with strong anti-affinity must not be on the same resource node
  • weak constraints Rules eg, weak anti-affinity may be that multiple tasks with weak anti-affinity are preferably not on the same resource node, may be allowed on the same resource node
  • the scheduling server may perform the following processing: if each task to be scheduled includes multiple tasks with weak constraint rules , in the case of a strong constraint rule between multiple tasks with weak constraint rules, the first resource scheduling is performed on multiple tasks with weak constraint rules; if there are multiple tasks in the weak constraint rule, there is a scheduling failure The task is to perform the second resource scheduling for each task that fails the scheduling on the premise that there is no constraint rule between the tasks that fail to be scheduled.
  • the scheduling server may perform resource scheduling twice for multiple tasks. Specifically, in the first resource scheduling, it can be assumed that a plurality of tasks having weak constraint rules have strong constraint rules. Under such a premise, the first resource scheduling is performed, so that the scheduling result can be guaranteed. The constraint rules may be met. After the first resource scheduling, the scheduling server can determine whether there are tasks with scheduling failures among the multiple tasks with weak constraint rules. If there are tasks with failed scheduling among multiple tasks with weak constraint rules, the tasks that fail to be scheduled can be scheduled. Under the premise that there is no constraint rule, the second resource scheduling is performed on each task that fails to be scheduled, wherein the scheduling failure may be that the task is not scheduled to any resource node.
  • the task identifiers of multiple tasks with weak anti-affinity are P0, P1, P2, and P3.
  • the scheduling server may have strong anti-affinity at P0, P1, P2, and P3.
  • resource scheduling is performed on P0, P1, P2, and P3.
  • the flow graph model can be established according to the premise that P0, P1, P2, and P3 have strong anti-affinity (the flow can be established according to the method described in step 201).
  • Graph model based on the established flow graph model, performs the first resource scheduling for P0, P1, P2, and P3.
  • the scheduling server may not have P2 and P3. Under the premise of any constraint rules, the flow graph model is established, and the established flow graph model is given, and the second resource scheduling is performed on P2 and P3.
  • the embodiment of the present invention further provides a method for constructing a flow graph model in which the constraint rules are complex (that is, each task has weak affinity), as shown in FIG. 4 .
  • Step 401 If a plurality of tasks having weak affinity are included in each task to be scheduled, the amount of resources required according to each of the plurality of tasks having weak affinity and the amount of resources included in each resource node Determining a set of resource nodes that can carry multiple tasks with weak affinity and that contain the fewest number of resource nodes.
  • the weak affinity may be that multiple tasks are scheduled to be on the same resource node as much as possible, and are allowed to be scheduled to different resource nodes.
  • the scheduling server may determine a set of resource nodes suitable for multiple tasks with weak affinity, thereby determining that the bearer is weak. Multiple tasks of affinity, and a collection of resource nodes with the fewest number of resource nodes. Specifically, the scheduling server may acquire the amount of resources required by each of the plurality of tasks having weak affinity, count the amount of resources required by the multiple tasks having weak affinity, and may count the resources included in each resource node.
  • the amount of resources can determine that multiple tasks with weak affinity can be carried in all resource nodes (wherein, multiple tasks capable of carrying weak affinity means that the resource node set contains more resources than multiple
  • the number of nodes is likely to be 1.
  • the scheduling server may further determine, in the foregoing set of resource nodes, a set of resource nodes having the smallest difference between the amount of resources included and the resources required by the plurality of tasks having weak affinity, that is, if each task to be scheduled is in the task Including multiple tasks with weak affinity, it is determined that the amount of resources required for each of the plurality of tasks with weak affinity and the amount of resources included in each resource node can be determined to be capable of carrying weak affinity.
  • a resource node set having a minimum number of resource nodes, a minimum number of resource nodes, and a minimum amount of resources required for a plurality of tasks having weak affinity, wherein the resource node set includes a resource amount The sum of the resources included in each resource node included in the resource node set.
  • the user may further set the preconditions according to the requirements of the user.
  • the resource nodes included in the determined resource node set may be located in the same rack, or the determined resource node set includes the same type of port. Wait.
  • the scheduling server may determine, in the set of resource nodes determined above, a set of resource nodes that satisfy the preconditions set by the user.
  • Step 402 Establish a second flow graph model, where the second flow graph model records a connection correspondence between a task identifier of each task of each task having weak affinity and each resource node identifier, and sets a task identifier.
  • the cost corresponding to the connection correspondence of the resource node identifier of each resource node in the resource node set is smaller than the cost corresponding to the connection correspondence relationship between the task identifier and the resource node identifier of each resource node except the resource node set.
  • 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 flow graph model is established, a connection correspondence between a task identifier of each of the plurality of tasks having weak affinity and each resource node identifier may be established. In addition, in order to satisfy the weak affinity of multiple tasks, the scheduling server may also set the cost corresponding to each connection correspondence.
  • a flow graph model which may be referred to as a second flow graph model
  • the cost corresponding to the connection correspondence between the task identifier and the resource node identifier of each resource node in the resource node set may be set, and the connection corresponding to the resource node identifier of each resource node except the task identifier and the resource node set may be less than The cost of the relationship.
  • the task identifiers of multiple tasks with weak affinity are P0, P1
  • the resource node identifiers are M0, M1, M2, M3, and the determined resource node sets include resource nodes M1 and M2, and then
  • the connection relationship between P0 and P1 and M0, M1, M2, and M3 may be recorded in the second flow graph model, and the relationship in FIG.
  • the second flow graph model in Fig. 5(a) may be a single starting point and single end point.
  • the flow graph model that is, the second flow graph model, may also record the connection correspondence between each resource identifier and the destination point D, and the connection correspondence between each task identifier and the starting point S.
  • the first flow graph model may be configured with or without a scheduling node. U.
  • the first flow graph model may also record the connection correspondence between the task identifier of each task and the unscheduled node U, and the connection relationship between U and D.
  • the connection relationship between each task identifier and each resource node identifier may be established by using the intermediate virtual identifier.
  • the processing of step 402 may be as follows: establishing a second flow graph model.
  • the second flow graph model records a connection correspondence between the task identifier of each of the plurality of tasks having weak affinity and the first intermediate virtual identifier, and a connection between the first intermediate virtual identifier and each resource node identifier.
  • a connection correspondence between the task identifier of each of the plurality of tasks having weak affinity and the first intermediate virtual identifier may be established, where the first intermediate virtual
  • the identifier may be an intermediate virtual identifier corresponding to the determined set of resource nodes, and may also establish a connection correspondence between the first intermediate virtual identifier and each resource node identifier.
  • the scheduling server may also set the cost corresponding to each connection correspondence.
  • a cost corresponding to 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, which is smaller than each resource node except the first intermediate virtual identifier and the resource node set.
  • the task identifiers of multiple tasks with weak affinity are P0, P1
  • the resource node identifiers are M0, M1, M2, M3, and the determined resource node sets include resource nodes M1 and M2, and then In the second flow graph model shown in FIG.
  • the first intermediate virtual identifier in the second flow graph model may be V0, and the second flow graph model may record a connection relationship between P0 and P1 and V0 respectively. It is also possible to record the connection relationship between V0 and each resource node identifier, and set the cost corresponding to the connection relationship between V0 and M1 and M2 in FIG. 5(b) is less than the connection between V0 and M0 and V0 and M3.
  • the second flow graph model in FIG. 5(b) may be a single-start single-endflow graph model, that is, the second flow graph model may also record the connection correspondence between each resource identifier and the destination D.
  • the correspondence between each task identifier and the starting point S, the first flow graph model may be set with or without the scheduling node U, and the first flow graph model may also record the connection correspondence between the task identifier of each task and the unscheduled node U. And the connection between U and D relationship.
  • the unscheduled node U may not be provided, but the connection relationship between the first intermediate virtual identifier and D may be recorded.
  • the scheduling server may further divide the multiple tasks into multiple task sets according to the weak affinity degree value between the multiple tasks.
  • the processing of step 402 may be as follows: The plurality of tasks are divided into a plurality of task sets, wherein the degree of weak affinity between each task in each task set is within a same preset range; establishing a second flow graph model, in the second flow graph model Recording a connection correspondence between a task identifier of each task in each task set and an intermediate virtual identifier corresponding to each task set, an intermediate virtual identifier corresponding to each task set, and a first intermediate virtual identifier and a resource node set a connection correspondence relationship of the resource node identifier of each resource node, and a connection correspondence relationship between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, and setting an intermediate virtual identifier corresponding to each task set a connection correspondence with the first intermediate virtual identifier, and a resource of each of the first intermediate virtual identifier
  • a plurality of tasks having weak affinity are divided into a plurality of task sets according to a weak affinity degree value, wherein a degree of weak affinity between each task in each task set is the same Within the preset range, for example, the degree of weak affinity between the task identifiers P0 and P1 is 8, the degree of weak affinity between the task identifiers P2 and P3 is 4, and the difference between the task identifiers P3 and P4 is weak.
  • the degree of affinity is 5, the degree of weak affinity between task identifiers P2 and P4 is 4, and the preset range is [7,8], [4,5], then P0, P1, P2 can be used.
  • P3 and P4 are divided into a first task set (P0, P1) and a second task set (P2, P3, P4).
  • an intermediate virtual identifier may be set for each task set, that is, when the second flow graph model is established, for each task set, the task identifier of each task in the task set may be established.
  • a connection correspondence between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set may also be established.
  • the scheduling server may also set a cost corresponding to each connection correspondence.
  • connection correspondence between the intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier, and the first intermediate virtual identifier and resources may be set.
  • the order of the cost corresponding to the connection correspondence of the resource node identifier of each resource node in the node set is smaller than the connection of the resource node identifier of each resource node corresponding to the intermediate virtual identifier and the resource node set corresponding to each task set.
  • the cost of the correspondence corresponds to the order of the cost, and the cost corresponding to the connection correspondence between the intermediate virtual identifier corresponding to the task set with the corresponding weak affinity degree value and the first intermediate virtual identifier may be set smaller.
  • the first task set includes P0 and P1
  • the first task set corresponds to a degree range preset range of [7, 8]
  • the second task set includes P2, P3, and P4, and the second task set corresponds to a degree value preset.
  • the range is [4, 5]
  • the intermediate virtual identifier V1 may be set for the first task set
  • the intermediate virtual identifier V2 is set for the second task set
  • the second flow graph model as 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 relationship between P2, P3, and P4 and V2, and the first intermediate virtual identifier V0 and the resource node identifier set respectively can be established.
  • M0, M3 connection correspondence between V1 and V2 and V0 in FIG. 5(c) and the connection correspondence between V0 and M1 and M2 respectively, and the cost is less than V1 and M0, V1 and M3, V2 and M0 and V2.
  • 5(c) may be a single-start single-endflow graph model, that is, the second flow graph model may also record the connection correspondence between each resource identifier and the destination point D. Corresponding relationship between each task identifier and the starting point S.
  • the first flow graph model may be provided with or without scheduling nodes U1 and U2. For each task set, each of the task sets may also be recorded in the first flow graph model.
  • the task identifier of the task is associated with the connection correspondence of the unscheduled node U corresponding to the task set, and the connection relationship between U and D.
  • the non-scheduled node U may not be provided, but the connection relationship between V1 and V2 and D may be recorded.
  • Step 403 Perform resource scheduling on multiple tasks with weak affinity according to the second flow graph model.
  • the corresponding correspondences of the foregoing connections may be determined according to the amount of resources required by each of the plurality of tasks having weak affinity and the amount of resources included in each resource node.
  • the capacity and cost in turn, the connection correspondence and its corresponding capacity and cost can be used as the input of the minimum cost maximum flow algorithm, and resource scheduling is performed on multiple tasks with weak affinity, wherein after obtaining the flow graph model
  • the method for determining the capacity and cost of each connection correspondence and the minimum cost maximum flow algorithm belongs to the prior art, and details are not described herein.
  • the embodiment of the present invention further provides a method for constructing a flow graph model in which the constraint rules are complex (that is, a plurality of task sets having anti-affinity among tasks to be scheduled), as shown in FIG. 6 .
  • Step 601 If each task to be scheduled includes multiple task sets with reverse affinity, each resource node is divided into multiple resource node sets corresponding to each task set, where tasks in multiple task sets There is anti-affinity between them.
  • each task to be scheduled includes multiple task sets with anti-affinity
  • the number of task sets may be determined.
  • all resource nodes may be divided into multiples whose quantity is consistent with the number of task sets.
  • a collection of resource nodes For example, the two task sets (ie, the first task set and the second task set) are included, the first task set includes P0, P1, and the second task set includes P2, P3, and P4, wherein the first task set and the second task
  • the set has reverse affinity (that is, P0 and P1 have anti-affinity with P2, P3, and P4, respectively), and all resource nodes can be divided into two resource node sets, wherein they can be randomly divided into two resource nodes. set.
  • multiple resource node sets may be divided according to the resource quantity.
  • the process of step 601 may be as follows: for each task set, according to the resource quantity required by each task in the task set and each resource node includes The amount of resources that determine the set of resource nodes that can carry the set of tasks.
  • the scheduling server may count the resources required by the multiple tasks included in the task set, and may determine that the resources included in the resource nodes are greater than or A collection of resource nodes equal to the amount of resources required by multiple tasks in the task set. In this way, the resource utilization of the resource node can be guaranteed.
  • Step 602 Establish a third flow graph model.
  • the third flow graph model records the task identifier of each task in the task set and the resource node resource group in the resource node set corresponding to the task set. The connection relationship of the node identifiers; according to the third flow graph model, resource scheduling is performed on multiple tasks in the task set.
  • the third flow graph model may be established.
  • each task in the task set may be established for each task set.
  • the task identifier identifies a connection relationship with the resource node identifier of the resource node in the resource node set corresponding to the task set, where the task identifier corresponding to each task set in the third flow graph model and the resource node set corresponding to the task set.
  • the connection relationship of the resource node identifier of the resource node may be established according to a constraint rule that is met by multiple tasks in the task set.
  • the first task set includes P0, P1, and the second task set includes P2, P3, and P4, wherein the first task set has a reverse affinity with the second task set, and the resource node set corresponding to the first task set includes M0.
  • M1 the set of resource nodes corresponding to the second task set includes M2 and M3, and the scheduling server can establish a third flow graph model.
  • the third flow graph model can record P0 and P1 respectively. Correspondence relationship with M0 and M1, and connection relationship between P2, P3, and P4 and M2 and M3 respectively.
  • the flow graph model 7(a) may be a single-start single-endflow graph model, that is, the second
  • the flow graph model may also record the connection correspondence between each resource identifier and the destination point D, and the connection correspondence between each task identifier and the starting point S.
  • the first flow graph model may be configured with or without scheduling nodes U1 and U2, for each In the task set, the first flow graph model may also record the connection correspondence between the task identifier of each task in the task set and the unscheduled node U corresponding to the task set, and the connection correspondence between U and D. For example, an intermediate virtual identifier is set for each task set. As shown in FIG.
  • the intermediate virtual identifier corresponding to the first task set is V0
  • the intermediate virtual identifier corresponding to the second task set is V1
  • FIG. 7 b) S, U1, U2, D may be provided in the same manner as in Fig. 7(a).
  • the capacity and cost corresponding to the foregoing connection correspondences 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. Further, each connection correspondence and its corresponding capacity and cost can be used as input of a minimum cost maximum flow algorithm, and resource scheduling is performed on multiple tasks in the task set, wherein after obtaining the flow graph model, each connection is determined.
  • the capacity and cost corresponding to the corresponding relationship and the minimum cost maximum flow algorithm belong to the prior art, and are not described in detail in the embodiments of the present invention.
  • a flow graph model of the task identifier of each task including the reverse affinity and the resource identifier of each resource node may be established.
  • a flow graph model records a connection correspondence between a task identifier of each task of the plurality of tasks having reverse affinity and an intermediate virtual identifier, and a connection correspondence between the intermediate virtual identifier and each resource node identifier, The capacity corresponding to the connection correspondence between the intermediate virtual identifier and each resource node identifier is set to 0 or 1.
  • the scheduling server may perform resource scheduling on multiple tasks with reverse affinity according to the flow graph model. In this way, a method for constructing a flow graph model with complex constraint rules is provided, thereby enabling resource scheduling for tasks with complex constraint rules.
  • the embodiment of the present invention further provides a device for performing resource scheduling.
  • the device includes:
  • the establishing module 810 is configured to establish a first flow graph model in which multiple tasks having anti-affinity are included in each task to be scheduled, where the first flow graph model records multiple tasks with anti-affinity a connection correspondence between a task identifier of each task and an intermediate virtual identifier corresponding to a plurality of tasks having reverse affinity, and a connection correspondence relationship between the intermediate virtual identifier and each resource node identifier, the intermediate virtual
  • the capacity corresponding to the connection correspondence of each resource node identifier is set to 0 or 1.
  • the establishment function in the foregoing step 201 and other implicit steps may be implemented.
  • the scheduling module 820 is configured to perform resource scheduling on the multiple tasks with the reverse affinity according to the first flow graph model, and specifically implement the scheduling function in the foregoing step 202, and other implicit steps.
  • the establishing module 820 is configured to:
  • a first flow graph model is established, and the first flow graph model records multiple tasks with anti-affinity
  • the connection identifier of each task in the task corresponds to a connection correspondence corresponding to an intermediate virtual identifier of a plurality of tasks having reverse affinity, and a connection correspondence relationship between the intermediate virtual identifier and each resource node identifier.
  • the establishing module 820 is configured to:
  • a first flow graph model is established, and the task of each of the plurality of tasks having anti-affinity is recorded in the first flow graph model Identifying a connection correspondence relationship with each resource node identifier corresponding to an intermediate virtual identifier of a plurality of tasks having reverse affinity, and a connection correspondence relationship between each intermediate virtual identifier and a resource node identifier corresponding to each of the intermediate virtual identifiers And setting a capacity corresponding to the connection correspondence relationship of each intermediate virtual identifier and the resource node identifier corresponding to each of the intermediate virtual identifiers to 0 or 1.
  • the apparatus further includes:
  • a determining module 830 configured to: if each task to be scheduled includes multiple tasks with weak affinity, the amount of resources required according to each of the multiple tasks having weak affinity and each resource node includes The resource quantity is determined to be able to carry a plurality of tasks having weak affinity, and the resource node set having the smallest number of resource nodes is included, and the determining function in the above step 401 and other implicit steps may be specifically implemented.
  • the establishing module 810 is further configured to establish a second flow graph model, where the task identifier of each of the plurality of tasks with weak affinity is recorded in the second flow graph model and the identifier of each resource node Connecting a correspondence, and setting 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, and smaller than the task identifier and the resource of each resource node except the resource node set
  • the cost corresponding to the connection correspondence of the node identifier may be specifically implemented in the foregoing step 402, and other implicit steps.
  • the scheduling module 820 is further configured to perform resource scheduling on the multiple tasks with weak affinity according to the second flow graph model, and specifically implement the scheduling function in the foregoing step 403, and other implicit steps. .
  • the establishing module 810 is configured to:
  • the second flow graph model records a connection correspondence between a task identifier of each of the plurality of tasks having weak affinity and the first intermediate virtual identifier, and the first Corresponding to the connection relationship between the intermediate virtual identifier and each resource node identifier, and setting a cost corresponding to the connection correspondence between the first intermediate virtual identifier and the resource node identifier of each resource node in the resource node set, which is smaller than the first intermediate virtual
  • a cost corresponding to a connection correspondence of resource node identifiers of each resource node other than the set of resource nodes is identified.
  • the establishing module 820 is configured to:
  • the second flow graph model records a connection correspondence between a task identifier of each task in each task set and an intermediate virtual identifier corresponding to each task set, and an intermediate virtual corresponding to each task set Identifying a connection correspondence relationship with the resource identifier of each resource node other than the first intermediate virtual identifier and the resource node set, and each resource in the first intermediate virtual identifier and the resource node set Corresponding relationship between the resource node identifiers of the node, and setting a connection correspondence between the intermediate virtual identifier corresponding to each task set and the first intermediate virtual identifier, and the first intermediate virtual identifier and the resource node set
  • the cost corresponding to the connection correspondence of the resource node identifiers of each resource node is smaller than the connection correspondence between the intermediate virtual identifier corresponding to each task set and the resource node identifier of each resource node except the resource node set.
  • the device further includes:
  • the dividing module 840 is configured to divide each resource node into a plurality of resource node sets corresponding to each task set, if the task to be scheduled includes multiple task sets having reverse affinity, where the multiple task sets
  • the tasks in the middle have anti-affinity, specifically the partitioning function in the above step 601, and other implicit steps.
  • the establishing module 810 is further configured to establish a third flow graph model, where, for each task set, a task identifier of each task in the task set recorded in the third flow graph model corresponds to the task set
  • the connection relationship of the resource node identifiers of the resource nodes in the resource node set may specifically implement the establishment function in the above step 602, and other implicit steps.
  • the scheduling module 820 is further configured to perform resource scheduling on multiple tasks in the multiple task sets according to the third flow graph model, and specifically implement the scheduling function in the foregoing step 602, and other implicit steps.
  • the dividing module 840 is configured to:
  • a resource node set capable of carrying the task set is determined according to the amount of resources required by each task in the task set and the amount of resources included in each resource node.
  • the scheduling module 820 is further configured to:
  • each task to be scheduled includes multiple tasks with weak constraint rules, and if there are strong constraint rules between multiple tasks with weak constraint rules, the plurality of tasks with weak constraint rules are performed.
  • the second resource scheduling is performed on each task that fails the scheduling on the premise that there is no constraint rule between the tasks that fail to be scheduled.
  • the foregoing 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 may be implemented by using a memory, or the processor may execute the program instructions in the memory.
  • a flow graph model of the task identifier of each task including the reverse affinity and the resource identifier of each resource node may be established.
  • a flow graph model records a connection correspondence between a task identifier of each task of the plurality of tasks having reverse affinity and an intermediate virtual identifier, and a connection correspondence between the intermediate virtual identifier and each resource node identifier, The capacity corresponding to the connection correspondence between the intermediate virtual identifier and each resource node identifier is set to 0 or 1.
  • the scheduling server may perform resource scheduling on multiple tasks with reverse affinity according to the flow graph model. In this way, a method for constructing a flow graph model with complex constraint rules is provided, thereby enabling resource scheduling for tasks with complex constraint rules.
  • the apparatus for resource scheduling provided by the foregoing embodiment only exemplifies the division of each functional module, and in actual applications, the foregoing functions may be allocated by different functional modules according to requirements.
  • the internal structure of the scheduling server is divided into different functional modules to perform all or part of the functions described above.
  • the device for performing resource scheduling provided by the foregoing embodiment is the same as the method for performing resource scheduling. The specific implementation process is described in detail in the method embodiment, and details are not described herein again.
  • the computer program product comprises one or more computer instructions that, when loaded and executed on a dispatch server, produce, in whole or in part, a process or function in accordance with an embodiment of the present invention.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transmission to another website site, computer, server or data center via wired (eg coaxial cable, fiber optic, digital subscriber line) or wireless (eg infrared, wireless, microwave, etc.).
  • the computer readable storage medium can be any available media that can be accessed by a dispatch server or a data storage device such as a server, data center, or the like that includes one or more available media integrations.
  • the usable medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape, etc.), or an optical medium (such as a digital video disk (DVD), etc.), or a semiconductor medium (such as a solid state hard disk or the like).
  • 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.
  • a semiconductor medium such as a solid state hard disk or the like.

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)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例公开了一种进行资源调度的方法和装置,属于资源调度技术领域。所述方法包括:如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,将所述中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1;根据所述第一流图模型,对所述具有反亲和性的多个任务进行资源调度。采用本发明,可以使得对约束规则复杂的任务能够进行资源调度。

Description

一种进行资源调度的方法和装置
本申请要求于2017年03月29日提交中国国家知识产权局、申请号为2017101982843、发明名称为“一种进行资源调度的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及资源调度技术领域,特别涉及一种进行资源调度的方法和装置。
背景技术
在网络侧处理任务时,往往会有资源调度的问题,其中,资源调度即是在一定的约束规则下,将待调度的各任务分配到各资源节点上。例如,资源节点可以是业务服务器,调度服务器可以根据每个任务需要的资源量和资源节点包含的资源量,将每个任务调度到相应的业务服务器中,以便各业务服务器执行对应的任务,例如,资源量是存储容量,调度服务器可以根据已知的每个任务需要的存储容量和每个业务服务器包含的存储容量,将每个任务调度到能够承载该任务的业务服务器上。
约束规则可以是某几个任务之间具有亲和性(即这几个任务必须调度在同一资源节点上),某任务和某资源节点之间具有反亲和性(即该任务不要调度在该资源节点上),调度服务器在进行资源调度时,往往会根据约束规则,将待调度的各任务调度到相应的资源节点上。目前,为提高资源利用率,往往采用流图方法对待调度的各任务进行资源调度,即在进行资源调度时,首先可以构建能满足约束规则的流图模型,进而,可以根据构建的流图模型,将任务调度到资源节点上,例如,对于约束规则为各任务之间具有亲和性的情况,调度服务器在进行资源调度时,首先会建立流图模型,其中,流图模型中记录有任务标识(由于各任务之间具有亲和性,因此,该任务标识可以是表示所有任务的一个标识)与各资源节点标识的连接对应关系,然后,调度服务器可以根据所有任务需要的总资源量和各资源节点包含的资源量,确定每个连接对应关系对应的容量和代价,最后,可以将每个连接对应关系对应的容量和代价作为最小代价最大流算法的输入,确定出任务标识对应的一个资源节点标识(即可以将各任务调度到确定出的资源节点标识对应的资源节点上),这样,根据构建出的上述流图模型确定出的调度结果即可满足各任务具有亲和性的约束规则。
在实现本发明的过程中,发明人发现现有技术至少存在以下问题:
通过流图方法进行资源调度时,首先需要构建流图模型,目前只存在约束规则较简单(比如任务之间具有亲和性、任务与资源节点之间具有亲和性等)的流图模型的构建方法,不存在约束规则复杂(比如任务之间具有反亲和性)的流图模型的构建方法,从而,导致无法对约束规则复杂的任务进行资源调度。
发明内容
为了解决无法对约束规则复杂的任务进行资源调度的问题,本发明实施例提供了一种进行资源调度的方法和装置。所述技术方案如下:
第一方面,提供了一种进行资源调度的方法,该方法包括:如果待调度的各任务中包 括具有反亲和性的多个任务,则可以建立第一流图模型,其中,第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及中间虚拟标识与每个资源节点标识的连接对应关系,并将中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1;根据第一流图模型,对具有反亲和性的多个任务进行资源调度。
本发明实施例所示的方案,如果待调度的各任务中包括具有反亲和性的多个任务,则调度服务器可以建立第一流图模型,在建立第一流图模型时,可以建立具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及中间虚拟标识与每个资源节点标识的连接对应关系,并可以结合设置中间虚拟标识与每个资源节点标识的连接对应关系对应的容量,来满足反亲和性约束规则,其中,可以将其对应的容量设置为0或1。这样,调度服务器即可基于构建的第一流图模型,对具有反亲和性的多个任务进行资源调度,即可以使得约束规则复杂的任务能够进行资源调度。
在一种可能的实现方式中,如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及中间虚拟标识与每个资源节点标识的连接对应关系,包括:如果待调度的各任务中包括具有反亲和性的多个任务且多个任务的属性一致,则建立第一流图模型,第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及中间虚拟标识与每个资源节点标识的连接对应关系。
本发明实施例所示的方案,如果待调度的各任务中包括具有反亲和性的多个任务,并且多个任务的属性一致时,则可以采用上述方式,构建第一流图模型。这样,可以保证有更多的任务可以调度成功,即可以有更多的任务可以被分配到资源节点上。
在一种可能的实现方式中,如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及中间虚拟标识与每个资源节点标识的连接对应关系,将中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1,包括:如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与每个资源节点标识对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及每个中间虚拟标识与每个中间虚拟标识对应的资源节点标识的连接对应关系,将每个中间虚拟标识与每个中间虚拟标识对应的资源节点标识的连接对应关系对应的容量设置为0或1。
本发明实施例所示的方案,对于约束规则为反亲和性的情况,调度服务器在建立第一流图模型时,可以建立具有反亲和性的多个任务中的每个任务的任务标识与每个资源节点标识对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及每个中间虚拟标识与每个中间虚拟标识对应的资源节点标识的连接对应关系,即具有反亲和性的多个任务对应的中间虚拟标识的数量与资源节点标识的数量一致,对应于具有反亲和性的多个任务,每个资源节点标识都对应有一个中间虚拟标识。另外,为保证反亲和性,可以设置每 个中间虚拟标识与每个中间虚拟标识对应的资源节点标识的连接对应关系对应的容量设置为0或1。这样,能够对具有反亲和性的多个任务进行调度的同时,还可以保证尽可能多的任务可以被分配到资源节点上。
在一种可能的实现方式中,所述方法还包括:如果待调度的各任务中包括具有弱亲和性的多个任务,则根据具有弱亲和性的多个任务中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载具有弱亲和性的多个任务,且包含的资源节点数目最少的资源节点集合;建立第二流图模型,第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系,并设置任务标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价;根据第二流图模型,对具有弱亲和性的多个任务进行资源调度。
本发明实施例所示的方案,如果待调度的各任务中包括具有弱亲和性的多个任务,则调度服务器首先可以确定能承载具有弱亲和性的多个任务,且包含的资源节点数目最少的资源节点集合,然后,建立第二流图模型,在建立第二流图模型时,可以建立具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系,在设置代价时,可以设置任务标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,最后,基于建立的第二流图模型,对具有弱亲和性的多个任务进行资源调度。这样,可以使得具有弱亲和性的多个任务尽可能的分配在较少的资源节点上,满足弱亲和性的约束规则。
在一种可能的实现方式中,建立第二流图模型,第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系,并设置任务标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,包括:建立第二流图模型,第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与第一中间虚拟标识的连接对应关系、以及第一中间虚拟标识与每个资源节点标识的连接对应关系,并设置第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于第一中间虚拟标识与资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价。
本发明实施例所示的方案,在建立第二流图模型时,调度服务器可以通过第一中间虚拟标识,建立具有弱亲和性的多个任务的任务标识与每个资源节点标识的连接对应关系,并可以设置第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价最小。这样,可以使得具有弱亲和性的多个任务尽可能的分配在较少的资源节点上,满足弱亲和性的约束规则。
在一种可能的实现方式中,建立第二流图模型,第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与第一中间虚拟标识的连接对应关系、以及第一中间虚拟标识与每个资源节点标识的连接对应关系,并设置第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于第一中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价, 包括:将具有弱亲和性的多个任务划分为多个任务集合,其中,每个任务集合中的各任务之间的弱亲和性程度值在同一预设范围内;建立第二流图模型,第二流图模型中记录有每个任务集合中的每个任务的任务标识与每个任务集合对应的中间虚拟标识的连接对应关系、每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识和所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系、以及第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系,并设置每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识的连接对应关系、以及第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系分别对应的代价,小于每个任务集合对应的中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,以及设置对应的预设范围的端点值越大的任务集合对应的中间虚拟标识与第一中间虚拟标识的连接对应关系对应的代价越小。
本发明实施例所示的方案,针对待调度的各任务中,存在对应的弱亲和性程度值在不同预设范围的情况,可以将具有弱亲和性的多个任务划分为多个任务集合,对于每个任务集合,可以分别设置有一个中间虚拟标识,并设置对应的弱亲和性程度值越大的连接对应关系对应的代价越小,其中,弱亲和性程度值越大表示越亲和,即在资源调度时越要分配到相同的资源节点上。这样,可以保证弱亲和性程度值较大的任务可以尽可能的分配到资源节点集合中的资源节点上。
在一种可能的实现方式中,该方法还包括:如果待调度的各任务中包括具有反亲和性的多个任务集合,将各资源节点划分为与每个任务集合对应的多个资源节点集合,其中,多个任务集合中的任务之间具有反亲和性;建立第三流图模型,对于每个任务集合,第三流图模型中记录有任务集合中的每个任务的任务标识与任务集合对应的资源节点集合中的资源节点的资源节点标识的连接关系;根据第三流图模型,对多个任务集合中的多个任务进行资源调度。
本发明实施例所示的方案,针对待调度的各任务中包括具有反亲和性的多个任务集合的情况,调度服务器可以将各资源节点划分为与每个任务集合对应的多个资源节点集合,每个任务集合,在对应的资源节点集合中进行资源调度。
在一种可能的实现方式中,如果待调度的各任务中包括具有反亲和性的多个任务集合,将各资源节点划分为与每个任务集合对应的多个资源节点集合,包括:对于每个任务集合,根据任务集合中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载所述任务集合的资源节点集合。
本发明实施例所示的方案,在划分资源节点集合时,可以根据任务集合中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载所述任务集合的资源节点集合。这样可以提高资源节点的资源利用率。
在一种可能的实现方式中,该方法还包括:如果待调度的各任务中包括具有弱约束规则的多个任务,则在具有弱约束规则的多个任务之间具有强约束规则的前提下,对所述具有弱约束规则的多个任务进行第一次资源调度;如果具有弱约束规则的多个任务中存在调度失败的任务,则在调度失败的任务之间不具有约束规则的前提下,对调度失败的各任务进行第二次资源调度。
本发明实施例所示的方案,针对待调度的各任务中包括具有弱约束规则的情况,可以 进行两次资源调度,第一次资源调度可以在各任务具有强约束规则的前提下进行,第二次资源调度,可以是针对第一次资源调度时调度失败的任务,此次资源调度可以在不具有约束规则的前提下,对调度失败的各任务进行资源调度。这样可以保证尽可能的满足约束规则的同时,还可以提高资源利用率。
第二方面,提供了一种进行资源调度的装置,该装置包括至少一个模块,该至少一个模块用于实现上述第一方面所提供的进行资源调度的方法。
第三方面,提供了一种调度服务器,该服务器包括处理器、存储器,处理器被配置为执行存储器中存储的指令;处理器通过执行指令来实现上述第一方面所提供的进行资源调度的方法。
第四方面,提供了计算机可读存储介质,包括指令,当所述计算机可读存储介质在调度服务器上运行时,使得所述调度服务器执行上述第一方面所述的方法。
上述本发明实施例第二到第四方面所获得的技术效果与第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
本发明实施例提供的技术方案带来的有益效果是:
本发明实施例中,如果待调度的各任务中包括具有反亲和性的多个任务,则可以建立包含反亲和性的每个任务的任务标识与各资源节点的资源标识的流图模型,流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,将中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1,进而,调度服务器可以根据流图模型,对具有反亲和性的多个任务进行资源调度。这样,提供了约束规则复杂的流图模型的构建方法,从而,可以使得对约束规则复杂的任务能够进行资源调度。
附图说明
图1是本发明实施例提供的一种系统框架示意图;
图2是本发明实施例提供的一种进行资源调度的方法流程图;
图3(a)是本发明实施例提供的一种流图模型示意图;
图3(b)是本发明实施例提供的一种流图模型示意图;
图3(c)是本发明实施例提供的一种流图模型示意图;
图3(d)是本发明实施例提供的一种流图模型示意图;
图4是本发明实施例提供的一种进行资源调度的方法流程图;
图5(a)是本发明实施例提供的一种流图模型示意图;
图5(b)是本发明实施例提供的一种流图模型示意图;
图5(c)是本发明实施例提供的一种流图模型示意图;
图6是本发明实施例提供的一种进行资源调度的方法流程图;
图7(a)是本发明实施例提供的一种流图模型示意图;
图7(b)是本发明实施例提供的一种流图模型示意图;
图8是本发明实施例提供的一种进行资源调度的装置结构示意图;
图9是本发明实施例提供的一种进行资源调度的装置结构示意图;
图10是本发明实施例提供的一种进行资源调度的装置结构示意图。
具体实施方式
本发明实施例提供了一种进行资源调度的方法,该方法的执行主体为调度服务器。其中,该服务器可以是具有资源调度功能的服务器。
调度服务器可以包括处理器110、存储器120,处理器110可以与存储器120连接,如图1所示。处理器110可以包括一个或多个处理单元;处理器110可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件等。具体地,程序可以包括程序代码,程序代码包括计算机操作指令。调度服务器还可以包括存储器120,存储器120可用于存储软件程序以及模块,处理器110通过读取存储在存储器120的软件代码以及模块,从而执行数据处理。
下面将结合具体实施方式,对图2所示的处理流程进行详细的说明,内容可以如下:
步骤201,如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及中间虚拟标识与每个资源节点标识的连接对应关系,将中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1。
其中,中间虚拟标识可以是用于建立满足复杂约束规则的流图模型的辅助标识,可以是用于任务标识与资源节点标识建立连接对应关系的辅助节点。
在实施中,如果待调度的各任务中包含具有反亲和性的多个任务,则调度服务器在对具有反亲和性的多个任务进行资源调度时,可以建立符合约束规则为多个任务具有反亲和性的流图模型(可以称为第一流图模型)。具体的,第一流图模型中可以记录有反亲和性的多个任务中的每个任务的任务标识与中间虚拟标识连接对应关系,以及中间虚拟标识与每个资源节点标识的连接对应关系,其中,第一流图模型中的中间虚拟标识可以是多个任务标识对应的中间虚拟标识(也就是说,待调度的各任务中还包括其他的包括具有反亲和性的多个任务的任务集合时,每个其他的任务集合也可以对应有中间虚拟标识)。另外,调度服务器为符合多个任务具有反亲和性的约束规则,还可以对连接对应关系对应的容量进行限制(即对流图模型中每条边对应的容量进行限制),可以将上述中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1。也就是说,中间虚拟标识与每个资源节点标识的连接对应关系对应的容量可以是0,也可以是1,不可能大于1,其中,该连接对应关系对应的容量是0还是1,可以由多个任务需要的资源量和各资源节点标识对应的资源节点包含的资源量决定。例如,具有反亲和性的多个任务的任务标识为P0、P1,当前包括的资源节点标识为M0、M1、M2,则调度服务器可以建立如图3(a)所示的第一流图模型,第一流图模型中的中间虚拟节点为T,第一流图模型中可以记录有P0、P1分别与T的连接对应关系、T分别与M0、M1、M2的连接对应关系,并且,调度服务器可以设置T分别与M0、M1、M2的连接对应关系(即T-M0边、T-M1边、T-M2边)对应的容量为0或1(当 M0包含的资源量大于或等于P0和P1需要的资源量时,T与M0的连接对应关系对应的容量可以是1,当M0包含的资源量小于P0和P1需要的资源量时,T与M0的连接对应关系对应的容量可以是0),可以看到,这样建立流图模型,可以保证P0、P1最多有一个任务可以分配到某个资源节点上,图3(a)中的第一流图模型可以是单起点单终点流图模型,即第一流图模型中还可以记录有每个资源标识与终点D的连接对应关系、每个任务标识与起点S的连接对应关系,还可以记录有每个任务标识与无调度节点U的连接对应关系、U与D的连接对应关系。此外,本发明实施例中,第一流图模型中也可以不设置无调度节点U,而是记录有T与D的连接对应关系。
此外,当待调度的各任务中包括多个任务集合(其中,每个任务集合中包括的多个任务具有反亲和性)时,对于每个包括具有反亲和性的多个任务的任务集合,调度服务器均可按照上述方法,构建流图模型。例如,第一任务集合中具有反亲和性的多个任务的任务标识为P0、P1,以及第二任务集合中具有反亲和性的多个任务的任务标识为P2、P3、P4,当前包括的资源节点标识为M0、M1、M2,则调度服务器可以建立如图3(b)所示的第一流图模型,第一流图模型中的中间虚拟节点为T0、T1,对于第一任务集合,第一流图模型中可以记录有P0、P1分别与T0的连接对应关系、T0分别与M0、M1、M2的连接对应关系,并且,调度服务器可以分别设置T0与M0、M1、M2的连接对应关系(即T0-M0边、T0-M1边、T0-M2边)对应的容量为0或1;对于第二任务集合,第一流图模型中可以记录有P2、P3、P4分别与T1的连接对应关系、T1分别与M0、M1、M2的连接对应关系,并且,调度服务器可以分别设置T1与M0、M1、M2的连接对应关系(即T1-M0边、T1-M1边、T1-M2边)对应的容量为0或1,另外,图3(b)中的第一流图模型可以是单起点单终点流图模型,即第一流图模型中还可以记录有每个资源标识与终点D的连接对应关系、每个任务标识与起点S的连接对应关系,第一流图模型中可以不设置无调度节点U,对于每个任务集合,而是记录有该任务集合对应的中间虚拟标识与D的连接对应关系。另外,第一流图模型中也可以设置无调度节点,对于每个任务集合,还可以记录有该任务集合中的每个任务的任务标识与该任务集合对应的无调度节点U的连接对应关系、以及无调度节点U与D的连接对应关系,或者,各任务集合对应一个无调度节点U,即记录有每个任务的任务标识与U的连接对应关系、U与D的连接对应关系。
另外,待调度的各任务中除去具有反亲和性的多个任务外,可能还包括其他不具有约束规则或者具有约束规则简单的任务。对于除具有反亲和性的多个任务之外的待调度的任务,可以按照现有的流图模型的构建方法,构建相应的流图模型。
可选的,可以在具有反亲和性的多个任务的属性一致的情况下,建立第一流图模型,相应的,步骤201的处理过程可以如下:如果待调度的各任务中包括具有反亲和性的多个任务且多个任务的属性一致,则建立第一流图模型,第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及中间虚拟标识与每个资源节点标识的连接对应关系。
在实施中,调度服务器确定出具有反亲和性的多个任务后,还可以判断具有反亲和性的多个任务的属性是否一致,如果具有反亲和性的多个任务的属性一致,则可以按照步骤201的处理方式,建立第一流图模型,其中,属性一致可以是需要的资源量一致。
可选的,在建立第一流图模型时,可以建立每个任务标识与每个资源节点标识对应的 中间虚拟标识,相应的,处理过程可以如下:如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与每个资源节点标识对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及每个中间虚拟标识与每个中间虚拟标识对应的资源节点标识的连接对应关系,将每个中间虚拟标识与每个中间虚拟标识对应的资源节点标识的连接对应关系对应的容量设置为0或1。
在实施中,调度服务器在建立第一流图模型时,还可以对每个资源节点标识设置对应的中间虚拟标识。具体的,第一流图模型中可以记录有具有反亲和性的多个任务中的每个任务的任务标识与每个资源节点标识对应的中间虚拟标识的连接对应关系,以及对于每个中间虚拟标识,记录有该中间虚拟标识与该中间虚拟标识对应的资源节点标识的连接对应关系,并可以将该中间虚拟标识与该中间虚拟标识对应的资源节点标识的连接对应关系对应的容量设置为0或1,其中,第一流图模型中的中间虚拟标识可以是资源节点标识和具有反亲和性的多个任务对应的中间虚拟标识。
例如,具有反亲和性的多个任务的任务标识为P0、P1,当前包括的资源节点标识为M0、M1、M2,则可以建立如图3(c)所示的第一流图模型,其中,每个资源节点标识对应的中间虚拟标识分别为V0、V1、V2,第一流图模型中可以记录有P0、P1分别与V0、V1、V2的连接对应关系、以及V0与M0、V1与M1、V2与M2的连接对应关系,并且,调度服务器可以设置V0与M0、V1与M1、V2与M2的连接对应关系对应的容量为0或1,可以看到,这样建立流图模型,可以保证P0、P1最多有一个任务可以分配到某个资源节点上,图3(c)中的第一流图模型可以是单起点单终点流图模型,即第一流图模型中还可以记录有每个资源标识与终点D的连接对应关系、每个任务标识与起点S的连接对应关系,第一流图模型中可以设置有无调度节点U,此种情况下,第一流图模型中可以记录有每个任务的任务标识与U的连接对应关系、以及U与D的连接对应关系。
此外,当待调度的各任务中包括多个任务集合(其中,每个任务集合中包括的多个任务具有反亲和性)时,对于每个包括具有反亲和性的多个任务的任务集合,调度服务器均可按照上述方法,构建流图模型。例如,第一任务集合中具有反亲和性的多个任务的任务标识为P0、P1,以及第二任务集合中具有反亲和性的多个任务的任务标识为P2、P3、P4,当前包括的资源节点标识为M0、M1、M2,则调度服务器可以建立如图3(d)所示的第一流图模型,第一流图模型中的中间虚拟节点为V00、V10、V01、V11、V02、V12(其中,V00、V01、V02可以是P0、P1对应于每个资源节点标识的中间虚拟标识,V10、V11、V12可以是P2、P3、P4对应于每个资源节点标识的中间虚拟标识),对于第一任务集合,第一流图模型中可以记录有P0、P1分别与V00、V01、V02的连接对应关系、V00与M0、V01与M1、V02与M2的连接对应关系,并且,调度服务器可以分别设置V00与M0、V01与M1、V02与M2的连接对应关系对应的容量为0或1;对于第二任务集合,第一流图模型中可以记录有P2、P3、P4分别与V10、V11、V12的连接对应关系、V10与M0、V11与M1、V12与M2的连接对应关系,并且,调度服务器可以分别设置V10与M0、V11与M1、V12与M2的连接对应关系对应的容量为0或1,图3(d)中的第一流图模型可以是单起点单终点流图模型,即第一流图模型中还可以记录有每个资源标识与终点D的连接对应关系、每个任务标识与起点S的连接对应关系,第一流图模型中可以设置有无调度节点U1、U2, 此种情况下,对于每个任务集合,第一流图模型中可以记录有该任务集合中的每个任务的任务标识与该任务集合对应的无调度节点U的连接对应关系、以及U与D的连接对应关系。另外,第一流图模型中也可以只设置一个无调度节点U。
步骤202,根据第一流图模型,对具有反亲和性的多个任务进行资源调度。
在实施中,调度服务器建立第一流图模型后,可以根据具有反亲和性的多个任务中的每个任务需要的资源量和各资源节点包含的资源量,确定上述各连接对应关系对应的容量和代价,进而,可以将各连接对应关系及其对应的容量和代价作为最小代价最大流算法的输入,对具有反亲和性的多个任务进行资源调度,其中,得到流图模型后,确定每个连接对应关系对应的容量和代价以及最小代价最大流算法属于现有技术,本发明实施例不再进行赘述。
另外,约束规则还可以对应有约束程度值,即还可以包括强约束规则(例如,强反亲和性可以是具有强反亲和性的多个任务一定不在同一个资源节点上)和弱约束规则(例如,弱反亲和性可以是具有弱反亲和性的多个任务最好不在同一个资源节点上,可以允许在同一个资源节点上),步骤201中所述的具有反亲和性的多个任务可以是具有强反亲和性。
可选的,针对多个任务满足弱约束规则的情况,调度服务器在对多个任务进行资源调度时,可以按照如下方式进行处理:如果待调度的各任务中包括具有弱约束规则的多个任务,则在具有弱约束规则的多个任务之间具有强约束规则的前提下,对具有弱约束规则的多个任务进行第一次资源调度;如果具有弱约束规则的多个任务中存在调度失败的任务,则在调度失败的任务之间不具有约束规则的前提下,对调度失败的各任务进行第二次资源调度。
在实施中,如果待调度的各任务中包含具有弱约束规则的多个任务,则调度服务器可以先后对多个任务进行两次资源调度。具体的,在第一次资源调度时,可以假设具有弱约束规则的多个任务之间具有强约束规则,在这样的前提下,对其进行第一次资源调度,这样,可以保证调度结果尽可能满足约束规则。第一次资源调度后,调度服务器可以判断具有弱约束规则的多个任务中是否存在调度失败的任务,如果具有弱约束规则的多个任务中存在调度失败的任务,则可以在调度失败的任务之间不具有约束规则的前提下,对调度失败的各任务进行第二次资源调度,其中,调度失败可以是该任务没有被调度到任一资源节点。
例如,具有弱反亲和性的多个任务的任务标识为P0、P1、P2、P3,在第一次资源调度时,调度服务器可以在P0、P1、P2、P3具有强反亲和性的前提下,对P0、P1、P2、P3进行资源调度,其中,可以按照P0、P1、P2、P3具有强反亲和性的前提,建立流图模型(可以按照步骤201所述的方法建立流图模型),基于建立的流图模型,对P0、P1、P2、P3进行第一次资源调度,第一次资源调度后,如果P2、P3调度失败,则调度服务器可以在P2、P3不具有任何约束规则的前提下,建立流图模型,并给予建立的流图模型,对P2、P3进行第二次资源调度。
另外,本发明实施例还提供了另外一种约束规则复杂(即各任务具有弱亲和性)的流图模型的构建方法,如图4所示。
步骤401,如果待调度的各任务中包括具有弱亲和性的多个任务,则根据具有弱亲和性 的多个任务中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载具有弱亲和性的多个任务,且包含的资源节点数目最少的资源节点集合。
其中,弱亲和性可以是多个任务尽可能被调度到同一资源节点上,允许被调度到不同的资源节点上。
在实施中,如果待调度的各任务中还包括具有弱亲和性的多个任务,则调度服务器可以确定适合具有弱亲和性的多个任务的资源节点集合,即可以确定能承载具有弱亲和性的多个任务,且包含的资源节点数目最少的资源节点集合。具体的,调度服务器可以获取具有弱亲和性的多个任务中的每个任务需要的资源量,统计具有弱亲和性的多个任务需要的资源量,并可以统计每个资源节点包含的资源量,进而,可以在所有资源节点中,确定能承载具有弱亲和性的多个任务(其中,能承载具有弱亲和性的多个任务是指资源节点集合包含的资源量大于多个任务需要的资源量),且包含的资源节点数目最少的资源节点集合,其中,可以采用贪心算法确定资源节点集合,也可以采用穷举法确定资源节点集合,确定出的资源节点集合包含的资源节点的数目有可能为1。
另外,调度服务器还可以在上述资源节点集合中,进一步确定包含的资源量与具有弱亲和性的多个任务需要的资源量的差值最小的资源节点集合,即如果待调度的各任务中包括具有弱亲和性的多个任务,则根据具有弱亲和性的多个任务中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载具有弱亲和性的多个任务、包含的资源节点数目最少、且包含的资源量与具有弱亲和性的多个任务需要的资源量的差值最小的资源节点集合,其中,资源节点集合包含的资源量可以是该资源节点集合包括的各资源节点包含的资源量的和。
另外,用户还可以根据自己需求,进一步设置前提条件,比如,可以设置确定出的资源节点集合包含的资源节点位于同一机架内、或者确定出的资源节点集合包含的资源节点具有同类型的端口等。此种情况下,调度服务器可以在上述确定出的资源节点集合中,确定满足用户设置的前提条件的资源节点集合。
步骤402,建立第二流图模型,第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系,并设置任务标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价。
在实施中,如果待调度的各任务中包括具有弱亲和性的多个任务,则调度服务器还可以建立符合该约束规则的流图模型(可以称为第二流图模型)。具体的,在建立第二流图模型时,可以建立具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系。另外,为满足多个任务的弱亲和性,调度服务器还可以对各连接对应关系对应的代价进行设置。具体的,可以设置任务标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价。例如,具有弱亲和性的多个任务的任务标识为P0、P1,资源节点标识为M0、M1、M2、M3,确定出的资源节点集合包括的资源节点为M1、M2,则可以建立如图5(a)所示的第二流图模型,第二流图模型中可以记录有P0、P1分别与M0、M1、M2、M3的连接对应关系,并可以设置图5(a)中的P0、P1分别与M1、M2的连接对应关系对应的代价小于P0、P1分别与M0、M3的连接对应关系对 应的代价,图5(a)中的第二流图模型可以是单起点单终点流图模型,即第二流图模型中还可以记录有每个资源标识与终点D的连接对应关系、每个任务标识与起点S的连接对应关系,第一流图模型中可以设置有无调度节点U,第一流图模型中还可以记录有每个任务的任务标识与无调度节点U的连接对应关系、以及U与D的连接对应关系。
可选的,在建立第二流图模型时,可以通过中间虚拟标识建立各任务标识与各资源节点标识的连接对应关系,相应的,步骤402的处理过程可以如下:建立第二流图模型,第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与第一中间虚拟标识的连接对应关系、以及第一中间虚拟标识与每个资源节点标识的连接对应关系,并设置第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于第一中间虚拟标识与资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价。
在实施中,调度在建立第二流图模型时,可以建立具有弱亲和性的多个任务中的每个任务的任务标识与第一中间虚拟标识的连接对应关系,其中,第一中间虚拟标识可以是确定出的资源节点集合对应的中间虚拟标识,还可以建立第一中间虚拟标识与每个资源节点标识的连接对应关系。另外,为满足多个任务的弱亲和性,调度服务器还可以对各连接对应关系对应的代价进行设置。具体的,可以设置第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于第一中间虚拟标识与资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价。例如,具有弱亲和性的多个任务的任务标识为P0、P1,资源节点标识为M0、M1、M2、M3,确定出的资源节点集合包括的资源节点为M1、M2,则可以建立如图5(b)所示的第二流图模型,第二流图模型中的第一中间虚拟标识可以是V0,第二流图模型中可以记录有P0、P1分别与V0的连接对应关系,还可以记录有V0分别与每个资源节点标识的连接对应关系,并可以设置图5(b)中的V0分别与M1、M2的连接对应关系对应的代价小于V0与M0和V0与M3的连接对应关系对应的代价,图5(b)中的第二流图模型可以是单起点单终点流图模型,即第二流图模型中还可以记录有每个资源标识与终点D的连接对应关系、每个任务标识与起点S的连接对应关系,第一流图模型中可以设置有无调度节点U,第一流图模型中还可以记录有每个任务的任务标识与无调度节点U的连接对应关系、以及U与D的连接对应关系。另外,第二流图模型中也可以不设置无调度节点U,而是记录有第一中间虚拟标识与D的连接对应关系。
可选的,调度服务器还可以根据多个任务之间的弱亲和性程度值,将多个任务划分为多个任务集合,相应的,步骤402的处理过程可以如下:将具有弱亲和性的多个任务划分为多个任务集合,其中,每个任务集合中的各任务之间的弱亲和性程度值在同一预设范围内;建立第二流图模型,第二流图模型中记录有每个任务集合中的每个任务的任务标识与每个任务集合对应的中间虚拟标识的连接对应关系、每个任务集合对应的中间虚拟标识与第一中间虚拟标识和资源节点集合之外的每个资源节点的资源节点标识的连接对应关系、以及第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系,并设置每个任务集合对应的中间虚拟标识与第一中间虚拟标识的连接对应关系、以及第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系分别对应的代价,小于每个任务集合对应的中间虚拟标识与资源节点集合之外的每个资源节点 的资源节点标识的连接对应关系对应的代价,以及设置对应的预设范围的端点值越大的任务集合对应的中间虚拟标识与第一中间虚拟标识的连接对应关系对应的代价越小。
在实施中,按照弱亲和性程度值,将具有弱亲和性的多个任务划分为多个任务集合,其中,每个任务集合中的各任务之间的弱亲和性程度值在同一预设范围内,例如,任务标识P0、P1之间的弱亲和性程度值为8、任务标识P2、P3之间的弱亲和性程度值为4、任务标识P3、P4之间的弱亲和性程度值为5、任务标识P2、P4之间的弱亲和性程度值为4,预设范围为[7,8]、[4,5],则可以将P0、P1、P2、P3、P4划分为第一任务集合(P0、P1)和第二任务集合(P2、P3、P4)。
得到多个任务集合后,可以为每个任务集合设置一个中间虚拟标识,即可以在建立第二流图模型时,对于每个任务集合,可以建立该任务集合中的每个任务的任务标识与该任务集合对应的中间虚拟标识的连接对应关系、以及该任务集合对应的中间虚拟标识与第一中间虚拟标识和资源节点集合之外的每个资源节点的资源节点标识的连接对应关系。除此之外,还可以建立第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系。此外,调度服务器还可以对各个连接对应关系对应的代价进行设置,具体的,可以设置每个任务集合对应的中间虚拟标识与第一中间虚拟标识的连接对应关系、以及第一中间虚拟标识与资源节点集合中的每个资源节点的资源节点标识的连接对应关系分别对应的代价的数量级,小于每个任务集合对应的中间虚拟标识与资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价的数量级,并可以设置对应的弱亲和性程度值越大的任务集合对应的中间虚拟标识与第一中间虚拟标识的连接对应关系对应的代价越小。
例如,第一任务集合包括P0、P1,第一任务集合对应的程度值预设范围为[7,8],第二任务集合包括P2、P3、P4,第二任务集合对应的程度值预设范围为[4,5],则可以为第一任务集合设置中间虚拟标识V1,为第二任务集合设置中间虚拟标识V2,建立如图5(c)所示的第二流图模型,即在建立第二流图模型时,可以建立P0、P1分别与V1的连接对应关系、P2、P3、P4分别与V2的连接对应关系、V1、V2分别与第一中间虚拟标识V0、资源节点标识集合(M1、M2)之外每个资源节点标识(M0、M3)的连接对应关系。另外,还可以设置图5(c)中的V1、V2分别与V0的连接对应关系和V0分别与M1、M2的连接对应关系对应的代价小于V1与M0、V1与M3、V2与M0和V2与M3的连接对应关系对应的代价。可以看出,第一任务集合对应的弱亲和性程度值大于第二任务集合对应的弱亲和性程度值,进而,可以设置V1与V0的连接对应关系对应的代价小于V2与V0的连接对应关系对应的代价,图5(c)中的第二流图模型可以是单起点单终点流图模型,即第二流图模型中还可以记录有每个资源标识与终点D的连接对应关系、每个任务标识与起点S的连接对应关系,第一流图模型中可以设置有无调度节点U1、U2,对于每个任务集合,第一流图模型中还可以记录有该任务集合中的每个任务的任务标识与该任务集合对应的无调度节点U的连接对应关系、以及U与D的连接对应关系。另外,第二流图模型中也可以不设置无调度节点U,而是记录有V1、V2分别与D的连接对应关系。
步骤403,根据第二流图模型,对具有弱亲和性的多个任务进行资源调度。
在实施中,调度服务器建立第二流图模型后,可以根据具有弱亲和性的多个任务中的每个任务需要的资源量和各资源节点包含的资源量,确定上述各连接对应关系对应的容量 和代价,进而,可以将各连接对应关系及其对应的容量和代价作为最小代价最大流算法的输入,对具有弱亲和性的多个任务进行资源调度,其中,得到流图模型后,确定每个连接对应关系对应的容量和代价以及最小代价最大流算法属于现有技术,本发明实施例不再进行赘述。
另外,本发明实施例还提供了另外一种约束规则复杂(即待调度的各任务中具有反亲和性的多个任务集合)的流图模型的构建方法,如图6所示。
步骤601,如果待调度的各任务中包括具有反亲和性的多个任务集合,将各资源节点划分为与每个任务集合对应的多个资源节点集合,其中,多个任务集合中的任务之间具有反亲和性。
在实施中,如果待调度的各任务中包括具有反亲和性的多个任务集合,则可以确定任务集合的数量,进而,可以将所有的资源节点划分为数量与任务集合数量一致的多个资源节点集合。例如,包括两个任务集合(即第一任务集合和第二任务集合),第一任务集合包括P0、P1,第二任务集合包括P2、P3、P4,其中,第一任务集合与第二任务集合具有反亲和性(即P0、P1分别与P2、P3、P4具有反亲和性),则可以将所有资源节点划分为两个资源节点集合,其中,可以是随机划分为两个资源节点集合。
可选的,可以根据资源量划分多个资源节点集合,相应的,步骤601的处理过程可以如下:对于每个任务集合,根据任务集合中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载任务集合的资源节点集合。
在实施中,确定出多个任务集合后,对于每个任务集合,调度服务器可以统计该任务集合包括的多个任务需要的资源量,并可以在所有资源节点中,确定包含的资源量大于或等于该任务集合中的多个任务需要的资源量的资源节点集合。这样,可以保证资源节点的资源利用率。
步骤602,建立第三流图模型,对于每个任务集合,第三流图模型中记录有该任务集合中的每个任务的任务标识与该任务集合对应的资源节点集合中的资源节点的资源节点标识的连接关系;根据第三流图模型,对该任务集合中的多个任务进行资源调度。
在实施中,确定出每个任务集合对应的资源节点集合后,可以建立第三流图模型,在建立第三流图模型时,对于每个任务集合,可以建立该任务集合中的每个任务的任务标识与该任务集合对应的资源节点集合中的资源节点的资源节点标识的连接关系,其中,第三流图模型中的每个任务集合对应的任务标识与该任务集合对应的资源节点集合中的资源节点的资源节点标识的连接关系,具体可以根据该任务集合中的多个任务满足的约束规则建立。例如,第一任务集合包括P0、P1,第二任务集合包括P2、P3、P4,其中,第一任务集合与第二任务集合具有反亲和性,第一任务集合对应的资源节点集合包括M0、M1,第二任务集合对应的资源节点集合包括M2、M3,则调度服务器可以建立第三流图模型,如图7(a)所示,第三流图模型中可以记录有P0、P1分别与M0、M1的连接对应关系,以及P2、P3、P4分别与M2、M3的连接对应关系,图7(a)中的第二流图模型可以是单起点单终点流图模型,即第二流图模型中还可以记录有每个资源标识与终点D的连接对应关系、每个任务标识与起点S的连接对应关系,第一流图模型中可以设置有无调度节点U1、U2,对于每个任务集合,第一流图模型中还可以记录有该任务集合中的每个任务的任务标识与该任 务集合对应的无调度节点U的连接对应关系、以及U与D的连接对应关系。又例如,为每个任务集合设置一个中间虚拟标识,如图7(b)所示,第一任务集合对应的中间虚拟标识为V0,第二任务集合对应的中间虚拟标识为V1,图7(b)可以与图7(a)相同,设置有S、U1、U2、D。
调度服务器建立第三流图模型后,可以根据每个任务集合中的每个任务需要的资源量和该任务集合对应的资源节点集合包含的资源量,确定上述各连接对应关系对应的容量和代价,进而,可以将各连接对应关系及其对应的容量和代价作为最小代价最大流算法的输入,对该任务集合中的多个任务进行资源调度,其中,得到流图模型后,确定每个连接对应关系对应的容量和代价以及最小代价最大流算法属于现有技术,本发明实施例不再进行赘述。
本发明实施例中,如果待调度的各任务中包括具有反亲和性的多个任务,则可以建立包含反亲和性的每个任务的任务标识与各资源节点的资源标识的流图模型,流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,将中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1,进而,调度服务器可以根据流图模型,对具有反亲和性的多个任务进行资源调度。这样,提供了约束规则复杂的流图模型的构建方法,从而,可以使得对约束规则复杂的任务能够进行资源调度。
基于相同的技术构思,本发明实施例还提供了一种进行资源调度的装置,如图8所示,该装置包括:
建立模块810,用于如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,将所述中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1,具体可以实现上述步骤201中的建立功能,以及其他隐含步骤。
调度模块820,用于根据所述第一流图模型,对所述具有反亲和性的多个任务进行资源调度,具体可以实现上述步骤202中的调度功能,以及其他隐含步骤。
可选的,所述建立模块820,用于:
如果待调度的各任务中包括具有反亲和性的多个任务且多个任务的属性一致,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系。
可选的,所述建立模块820,用于:
如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与每个资源节点标识对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及每个中间虚拟标识与所述每个中间虚拟标识对应的资源节点标识的连接对应关系,将每个中间虚拟标识与所述每个中间虚拟标识对应的资源节点标识的连接对应关系对应的容量设置为0或1。
可选的,如图9所示,所述装置还包括:
确定模块830,用于如果待调度的各任务中包括具有弱亲和性的多个任务,则根据具有弱亲和性的多个任务中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载具有弱亲和性的多个任务,且包含的资源节点数目最少的资源节点集合,具体可以实现上述步骤401中的确定功能,以及其他隐含步骤。
所述建立模块810,还用于建立第二流图模型,所述第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系,并设置任务标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,具体可以实现上述步骤402中的建立功能,以及其他隐含步骤。
所述调度模块820,还用于根据所述第二流图模型,对所述具有弱亲和性的多个任务进行资源调度,具体可以实现上述步骤403中的调度功能,以及其他隐含步骤。
可选的,所述建立模块810,用于:
建立第二流图模型,所述第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与第一中间虚拟标识的连接对应关系、以及所述第一中间虚拟标识与每个资源节点标识的连接对应关系,并设置第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于第一中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价。
可选的,所述建立模块820,用于:
将所述具有弱亲和性的多个任务划分为多个任务集合,其中,每个任务集合中的各任务之间的弱亲和性程度值在同一预设范围内;
建立第二流图模型,第二流图模型中记录有每个任务集合中的每个任务的任务标识与每个任务集合对应的中间虚拟标识的连接对应关系、每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识和所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系、以及所述第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系,并设置每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识的连接对应关系、以及所述第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系分别对应的代价,小于每个任务集合对应的中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,以及设置对应的预设范围的端点值越大的任务集合对应的中间虚拟标识与所述第一中间虚拟标识的连接对应关系对应的代价越小。
可选的,如图10所示,所述装置还包括:
划分模块840,用于如果待调度的各任务中包括具有反亲和性的多个任务集合,将各资源节点划分为与每个任务集合对应的多个资源节点集合,其中,多个任务集合中的任务之间具有反亲和性,具体可以实现上述步骤601中的划分功能,以及其他隐含步骤。
所述建立模块810,还用于建立第三流图模型,对于每个任务集合,所述第三流图模型中记录有所述任务集合中的每个任务的任务标识与所述任务集合对应的资源节点集合中的资源节点的资源节点标识的连接关系,具体可以实现上述步骤602中的建立功能,以及其他隐含步骤。
所述调度模块820,还用于根据所述第三流图模型,对多个任务集合中的多个任务进行资源调度,具体可以实现上述步骤602中的调度功能,以及其他隐含步骤。
可选的,所述划分模块840,用于:
对于每个任务集合,根据所述任务集合中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载所述任务集合的资源节点集合。
可选的,所述调度模块820,还用于:
如果待调度的各任务中包括具有弱约束规则的多个任务,则在具有弱约束规则的多个任务之间具有强约束规则的前提下,对所述具有弱约束规则的多个任务进行第一次资源调度;
如果所述具有弱约束规则的多个任务中存在调度失败的任务,则在调度失败的任务之间不具有约束规则的前提下,对所述调度失败的各任务进行第二次资源调度。
需要说明的是,上述建立模块810、调度模块820、确定模块830、划分模块840可以由处理器实现,或者处理器配合存储器来实现,或者,处理器执行存储器中的程序指令来实现。
本发明实施例中,如果待调度的各任务中包括具有反亲和性的多个任务,则可以建立包含反亲和性的每个任务的任务标识与各资源节点的资源标识的流图模型,流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,将中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1,进而,调度服务器可以根据流图模型,对具有反亲和性的多个任务进行资源调度。这样,提供了约束规则复杂的流图模型的构建方法,从而,可以使得对约束规则复杂的任务能够进行资源调度。
需要说明的是:上述实施例提供的进行资源调度的装置在进行资源调度时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将调度服务器的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的进行资源调度的装置与进行资源调度的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现,当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令,在调度服务器上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴光缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是调度服务器能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(如软盘、硬盘和磁带等),也可以是光介质(如数字视盘(Digital Video Disk,DVD)等),或者半导体介质(如固态硬盘等)。
以上所述仅为本发明一个实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (28)

  1. 一种进行资源调度的方法,其特征在于,所述方法包括:
    如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,将所述中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1;
    根据所述第一流图模型,对所述具有反亲和性的多个任务进行资源调度。
  2. 根据权利要求1所述的方法,其特征在于,所述如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,将所述中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1,包括:
    如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与每个资源节点标识对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及每个中间虚拟标识与所述每个中间虚拟标识对应的资源节点标识的连接对应关系,将每个中间虚拟标识与所述每个中间虚拟标识对应的资源节点标识的连接对应关系对应的容量设置为0或1。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    如果待调度的各任务中包括具有弱亲和性的多个任务,则根据具有弱亲和性的多个任务中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载具有弱亲和性的多个任务,且包含的资源节点数目最少的资源节点集合;
    建立第二流图模型,所述第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系,并设置任务标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价;
    根据所述第二流图模型,对所述具有弱亲和性的多个任务进行资源调度。
  4. 根据权利要求3所述的方法,其特征在于,所述建立第二流图模型,所述第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系,并设置任务标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,包括:
    建立第二流图模型,所述第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与第一中间虚拟标识的连接对应关系、以及所述第一中间虚拟标识与每个资源节点标识的连接对应关系,并设置第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于第一中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价。
  5. 根据权利要求4所述的方法,其特征在于,所述建立第二流图模型,所述第二流图模 型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与第一中间虚拟标识的连接对应关系、以及所述第一中间虚拟标识与每个资源节点标识的连接对应关系,并设置第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于第一中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,包括:
    将所述具有弱亲和性的多个任务划分为多个任务集合,其中,每个任务集合中的各任务之间的弱亲和性程度值在同一预设范围内;
    建立第二流图模型,第二流图模型中记录有每个任务集合中的每个任务的任务标识与每个任务集合对应的中间虚拟标识的连接对应关系、每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识和所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系、以及所述第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系,并设置每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识的连接对应关系、以及所述第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系分别对应的代价,小于每个任务集合对应的中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,以及设置对应的预设范围的端点值越大的任务集合对应的中间虚拟标识与所述第一中间虚拟标识的连接对应关系对应的代价越小。
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    如果待调度的各任务中包括具有反亲和性的多个任务集合,将各资源节点划分为与每个任务集合对应的多个资源节点集合,其中,多个任务集合中的任务之间具有反亲和性;
    建立第三流图模型,对于每个任务集合,所述第三流图模型中记录有所述任务集合中的每个任务的任务标识与所述任务集合对应的资源节点集合中的资源节点的资源节点标识的连接关系;
    根据所述第三流图模型,对多个任务集合中的多个任务进行资源调度。
  7. 根据权利要求6所述的方法,其特征在于,所述如果待调度的各任务中包括具有反亲和性的多个任务集合,将各资源节点划分为与每个任务集合对应的多个资源节点集合,包括:
    对于每个任务集合,根据所述任务集合中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载所述任务集合的资源节点集合。
  8. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    如果待调度的各任务中包括具有弱约束规则的多个任务,则在具有弱约束规则的多个任务之间具有强约束规则的前提下,对所述具有弱约束规则的多个任务进行第一次资源调度;
    如果所述具有弱约束规则的多个任务中存在调度失败的任务,则在调度失败的任务之间不具有约束规则的前提下,对所述调度失败的各任务进行第二次资源调度。
  9. 根据权利要求1所述的方法,其特征在于,所述如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,包括:
    如果待调度的各任务中包括具有反亲和性的多个任务且多个任务的属性一致,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识 与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系。
  10. 一种进行资源调度的装置,其特征在于,所述装置包括:
    建立模块,用于如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,将所述中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1;
    调度模块,用于根据所述第一流图模型,对所述具有反亲和性的多个任务进行资源调度。
  11. 根据权利要求10所述的装置,其特征在于,所述建立模块,用于:
    如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与每个资源节点标识对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及每个中间虚拟标识与所述每个中间虚拟标识对应的资源节点标识的连接对应关系,将每个中间虚拟标识与所述每个中间虚拟标识对应的资源节点标识的连接对应关系对应的容量设置为0或1。
  12. 根据权利要求10所述的装置,其特征在于,所述装置还包括:
    确定模块,用于如果待调度的各任务中包括具有弱亲和性的多个任务,则根据具有弱亲和性的多个任务中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载具有弱亲和性的多个任务,且包含的资源节点数目最少的资源节点集合;
    所述建立模块,还用于建立第二流图模型,所述第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系,并设置任务标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价;
    所述调度模块,还用于根据所述第二流图模型,对所述具有弱亲和性的多个任务进行资源调度。
  13. 根据权利要求12所述的装置,其特征在于,所述建立模块,用于:
    建立第二流图模型,所述第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与第一中间虚拟标识的连接对应关系、以及所述第一中间虚拟标识与每个资源节点标识的连接对应关系,并设置第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于第一中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价。
  14. 根据权利要求13所述的装置,其特征在于,所述建立模块,用于:
    将所述具有弱亲和性的多个任务划分为多个任务集合,其中,每个任务集合中的各任务之间的弱亲和性程度值在同一预设范围内;
    建立第二流图模型,第二流图模型中记录有每个任务集合中的每个任务的任务标识与每个任务集合对应的中间虚拟标识的连接对应关系、每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识和所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系、以及所述第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连 接对应关系,并设置每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识的连接对应关系、以及所述第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系分别对应的代价,小于每个任务集合对应的中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,以及设置对应的预设范围的端点值越大的任务集合对应的中间虚拟标识与所述第一中间虚拟标识的连接对应关系对应的代价越小。
  15. 根据权利要求10所述的装置,其特征在于,所述装置还包括:
    划分模块,用于如果待调度的各任务中包括具有反亲和性的多个任务集合,将各资源节点划分为与每个任务集合对应的多个资源节点集合,其中,多个任务集合中的任务之间具有反亲和性;
    所述建立模块,还用于建立第三流图模型,对于每个任务集合,所述第三流图模型中记录有所述任务集合中的每个任务的任务标识与所述任务集合对应的资源节点集合中的资源节点的资源节点标识的连接关系;
    所述调度模块,还用于根据所述第三流图模型,对多个任务集合中的多个任务进行资源调度。
  16. 根据权利要求15所述的装置,其特征在于,所述划分模块,用于:
    对于每个任务集合,根据所述任务集合中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载所述任务集合的资源节点集合。
  17. 根据权利要求10所述的装置,其特征在于,所述调度模块,还用于:
    如果待调度的各任务中包括具有弱约束规则的多个任务,则在具有弱约束规则的多个任务之间具有强约束规则的前提下,对所述具有弱约束规则的多个任务进行第一次资源调度;
    如果所述具有弱约束规则的多个任务中存在调度失败的任务,则在调度失败的任务之间不具有约束规则的前提下,对所述调度失败的各任务进行第二次资源调度。
  18. 根据权利要求10所述的装置,其特征在于,所述建立模块,用于:
    如果待调度的各任务中包括具有反亲和性的多个任务且多个任务的属性一致,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系。
  19. 一种调度服务器,其特征在于,所述服务器包括处理器,其中:
    所述处理器,用于如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系,将所述中间虚拟标识与每个资源节点标识的连接对应关系对应的容量设置为0或1;根据所述第一流图模型,对所述具有反亲和性的多个任务进行资源调度。
  20. 根据权利要求19所述的调度服务器,其特征在于,所述处理器,用于:
    如果待调度的各任务中包括具有反亲和性的多个任务,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与每个资源节点标识对 应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及每个中间虚拟标识与所述每个中间虚拟标识对应的资源节点标识的连接对应关系,将每个中间虚拟标识与所述每个中间虚拟标识对应的资源节点标识的连接对应关系对应的容量设置为0或1。
  21. 根据权利要求19所述的调度服务器,其特征在于,所述处理器,还用于:
    如果待调度的各任务中包括具有弱亲和性的多个任务,则根据具有弱亲和性的多个任务中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载具有弱亲和性的多个任务,且包含的资源节点数目最少的资源节点集合;
    建立第二流图模型,所述第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与每个资源节点标识的连接对应关系,并设置任务标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于任务标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价;
    根据所述第二流图模型,对所述具有弱亲和性的多个任务进行资源调度。
  22. 根据权利要求21所述的调度服务器,其特征在于,所述处理器,用于:
    建立第二流图模型,所述第二流图模型中记录有具有弱亲和性的多个任务中的每个任务的任务标识与第一中间虚拟标识的连接对应关系、以及所述第一中间虚拟标识与每个资源节点标识的连接对应关系,并设置第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系对应的代价,小于第一中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价。
  23. 根据权利要求22所述的调度服务器,其特征在于,所述处理器,用于:
    将所述具有弱亲和性的多个任务划分为多个任务集合,其中,每个任务集合中的各任务之间的弱亲和性程度值在同一预设范围内;
    建立第二流图模型,第二流图模型中记录有每个任务集合中的每个任务的任务标识与每个任务集合对应的中间虚拟标识的连接对应关系、每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识和所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系、以及所述第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系,并设置每个任务集合对应的中间虚拟标识与所述第一中间虚拟标识的连接对应关系、以及所述第一中间虚拟标识与所述资源节点集合中的每个资源节点的资源节点标识的连接对应关系分别对应的代价,小于每个任务集合对应的中间虚拟标识与所述资源节点集合之外的每个资源节点的资源节点标识的连接对应关系对应的代价,以及设置对应的预设范围的端点值越大的任务集合对应的中间虚拟标识与所述第一中间虚拟标识的连接对应关系对应的代价越小。
  24. 根据权利要求19所述的调度服务器,其特征在于,所述处理器,还用于:
    如果待调度的各任务中包括具有反亲和性的多个任务集合,将各资源节点划分为与每个任务集合对应的多个资源节点集合,其中,多个任务集合中的任务之间具有反亲和性;
    建立第三流图模型,对于每个任务集合,所述第三流图模型中记录有所述任务集合中的每个任务的任务标识与所述任务集合对应的资源节点集合中的资源节点的资源节点标识的连接关系;
    根据所述第三流图模型,对多个任务集合中的多个任务进行资源调度。
  25. 根据权利要求24所述的调度服务器,其特征在于,所述处理器,用于:
    对于每个任务集合,根据所述任务集合中的每个任务需要的资源量和每个资源节点包含的资源量,确定能承载所述任务集合的资源节点集合。
  26. 根据权利要求19所述的调度服务器,其特征在于,所述处理器,还用于:
    如果待调度的各任务中包括具有弱约束规则的多个任务,则在具有弱约束规则的多个任务之间具有强约束规则的前提下,对所述具有弱约束规则的多个任务进行第一次资源调度;
    如果所述具有弱约束规则的多个任务中存在调度失败的任务,则在调度失败的任务之间不具有约束规则的前提下,对所述调度失败的各任务进行第二次资源调度。
  27. 根据权利要求19所述的调度服务器,其特征在于,所述处理器,用于:
    如果待调度的各任务中包括具有反亲和性的多个任务且多个任务的属性一致,则建立第一流图模型,所述第一流图模型中记录有具有反亲和性的多个任务中的每个任务的任务标识与对应于具有反亲和性的多个任务的中间虚拟标识的连接对应关系、以及所述中间虚拟标识与每个资源节点标识的连接对应关系。
  28. 一种计算机可读存储介质,包括指令,当所述计算机可读存储介质在调度服务器上运行时,使得所述调度服务器执行所述权利要求1-9中任一权利要求所述的方法。
PCT/CN2018/080949 2017-03-29 2018-03-28 一种进行资源调度的方法和装置 WO2018177335A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710198284.3A CN108667864B (zh) 2017-03-29 2017-03-29 一种进行资源调度的方法和装置
CN201710198284.3 2017-03-29

Publications (1)

Publication Number Publication Date
WO2018177335A1 true WO2018177335A1 (zh) 2018-10-04

Family

ID=63674247

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/080949 WO2018177335A1 (zh) 2017-03-29 2018-03-28 一种进行资源调度的方法和装置

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109582449A (zh) * 2018-10-26 2019-04-05 阿里巴巴集团控股有限公司 一种分组方法、装置、及计算机设备

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515716B (zh) * 2019-08-29 2021-11-30 中国科学院软件研究所 一种支持优先级和反亲和的云优化调度方法及系统
CN113254220A (zh) * 2021-07-01 2021-08-13 国汽智控(北京)科技有限公司 网联汽车负载协同控制方法、装置、设备及存储介质
CN117056431B (zh) * 2023-10-11 2024-02-09 中电数创(北京)科技有限公司 基于hbase亲和性计算的二阶段调度的分布式执行方法和系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104090826A (zh) * 2014-06-30 2014-10-08 中国电子科技集团公司第三十二研究所 基于相关性的任务优化部署方法
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
CN105656646A (zh) * 2014-11-10 2016-06-08 中国移动通信集团公司 一种虚拟网元的部署方法及装置
CN106534318A (zh) * 2016-11-15 2017-03-22 浙江大学 一种基于流量亲和性的OpenStack云平台资源动态调度系统和方法

Family Cites Families (11)

* 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
US8561072B2 (en) * 2008-05-16 2013-10-15 Microsoft Corporation Scheduling collections in a scheduler
CN101853178B (zh) * 2010-04-30 2012-07-04 西安交通大学 一种调度时可重构硬件资源的描述方法
CN102255926B (zh) * 2010-05-17 2015-11-25 中国移动通信集团公司 MapReduce系统中的任务分配方法、系统及装置
CN102857370B (zh) * 2012-08-14 2016-05-25 华为技术有限公司 一种分配资源的方法及装置
CN102902573B (zh) * 2012-09-20 2014-12-17 北京搜狐新媒体信息技术有限公司 一种基于共享资源的任务的处理方法及装置
CN104572314B (zh) * 2013-10-22 2018-04-10 华为技术有限公司 一种进程间的通信方法及装置
CN104811431B (zh) * 2014-01-29 2018-01-16 华为技术有限公司 基于并行协议栈实例的数据包处理方法和装置
WO2015157897A1 (zh) * 2014-04-14 2015-10-22 华为技术有限公司 一种云计算架构下的容灾数据中心配置方法及装置
CN104142853B (zh) * 2014-08-12 2018-02-09 华为技术有限公司 虚拟机存储资源部署方法和装置
CN104239141B (zh) * 2014-09-05 2017-07-28 北京邮电大学 数据中心中基于工作流关键路径的任务优化调度方法

Patent Citations (4)

* 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
CN104090826A (zh) * 2014-06-30 2014-10-08 中国电子科技集团公司第三十二研究所 基于相关性的任务优化部署方法
CN105656646A (zh) * 2014-11-10 2016-06-08 中国移动通信集团公司 一种虚拟网元的部署方法及装置
CN106534318A (zh) * 2016-11-15 2017-03-22 浙江大学 一种基于流量亲和性的OpenStack云平台资源动态调度系统和方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109582449A (zh) * 2018-10-26 2019-04-05 阿里巴巴集团控股有限公司 一种分组方法、装置、及计算机设备
CN109582449B (zh) * 2018-10-26 2023-06-27 创新先进技术有限公司 风控业务系统中的风控任务分组方法、装置、计算机设备

Also Published As

Publication number Publication date
CN108667864A (zh) 2018-10-16
CN108667864B (zh) 2020-07-28

Similar Documents

Publication Publication Date Title
WO2018177335A1 (zh) 一种进行资源调度的方法和装置
CN111061715B (zh) 基于Web和Kafka的分布式数据集成系统及方法
WO2018006676A1 (zh) 加速资源处理方法、装置及网络功能虚拟化系统
CN107241281B (zh) 一种数据处理方法及其装置
US8402466B2 (en) Practical contention-free distributed weighted fair-share scheduler
US8898422B2 (en) Workload-aware distributed data processing apparatus and method for processing large data based on hardware acceleration
WO2018049873A1 (zh) 一种应用调度方法及装置
CN109729024A (zh) 数据包处理系统及方法
US20150067695A1 (en) Information processing system and graph processing method
US10938868B2 (en) Application service integration
US11948021B2 (en) Method for inter-core communication, processor, inter-core communication system and computer readable storage medium
CN109873714B (zh) 云计算节点配置更新方法及终端设备
US20180295059A1 (en) Container-based software appliance
CN109104491A (zh) 一种微服务调用方法、装置、服务器及存储介质
CN105786603A (zh) 一种基于分布式的高并发业务处理系统及方法
WO2024037629A1 (zh) 区块链的数据整合方法、装置、计算机设备及存储介质
US12035156B2 (en) Communication method and apparatus for plurality of administrative domains
CN113722055A (zh) 数据处理方法、装置、电子设备和计算机可读介质
CN111694670B (zh) 资源分配方法、装置、设备和计算机可读介质
WO2019034084A1 (zh) 公共服务资源申请方法、相关设备及系统
US20140068082A1 (en) Collaborative method and system to balance workload distribution
TWI706343B (zh) 樣本回放資料存取方法、裝置及電腦設備
US20210004658A1 (en) System and method for provisioning of artificial intelligence accelerator (aia) resources
CN110868330A (zh) 云平台可划分cpu资源的评估方法、装置及评估系统
CN112395081A (zh) 一种资源在线自动回收方法、系统、服务器以及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18775735

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18775735

Country of ref document: EP

Kind code of ref document: A1