WO2018072687A1 - Resource scheduling method and apparatus, and filtered scheduler - Google Patents

Resource scheduling method and apparatus, and filtered scheduler Download PDF

Info

Publication number
WO2018072687A1
WO2018072687A1 PCT/CN2017/106553 CN2017106553W WO2018072687A1 WO 2018072687 A1 WO2018072687 A1 WO 2018072687A1 CN 2017106553 W CN2017106553 W CN 2017106553W WO 2018072687 A1 WO2018072687 A1 WO 2018072687A1
Authority
WO
WIPO (PCT)
Prior art keywords
scheduling
scheduler
filter
scheduling result
message
Prior art date
Application number
PCT/CN2017/106553
Other languages
French (fr)
Chinese (zh)
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 WO2018072687A1 publication Critical patent/WO2018072687A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Definitions

  • the present invention relates to the field of communications, and in particular, to a resource scheduling method, apparatus, and filter scheduler in the field of virtualization management.
  • resource scheduling which is the business. Requests are allocated to appropriate resources, including computing, storage, networking, etc., to improve resource utilization.
  • the most commonly used scheduler is a filtering scheduler, that is, when receiving a scheduling request, first filtering out all the server sets satisfying the business requirements according to the business requirements carried in the scheduling request, and then All servers in the server set are sorted according to a predefined weight calculation method, and the scheduler selects the server with the highest weight to process the service demand.
  • the single filter scheduler is responsible for the scheduling of all resources in the virtualized system, which cannot meet the business requirements, resulting in serious performance bottlenecks.
  • More and more data centers adopt Multiple filter schedulers implement scheduling requests in parallel to share the scheduling tasks of the entire large-scale data center.
  • a plurality of filter schedulers are used in the scheduling system to form a scheduler cluster.
  • the filter scheduler in the scheduler cluster separately obtains different scheduling requests, and The scheduling result is determined according to different scheduling requests, but for the same scheduling request, a filtered scheduler first filters out the server set that satisfies the scheduling request in all servers in the scheduling system, and then according to the predefined rights.
  • the value calculation method calculates the weights of all the servers in the server set, and then sorts the servers according to the weights, and finally selects one or more servers as the scheduling result of the scheduling request.
  • the scheduling method is The same filter scheduler is required to filter and sort all servers, resulting in long processing time and low efficiency of the same scheduled task.
  • the available resources of each server in the prior art are recorded and saved by the database, but the server only informs the database to update the available resources of the server when the business requirements in the scheduling request are completed. That is to say, the available resource information of the server recorded in the database is non-real-time information, and the server determined by the filter scheduler according to the information may not meet the service requirement, thereby affecting the judgment of the filter scheduler and increasing the scheduling failure. Probability. Therefore, the method for parallel scheduling of multiple filter schedulers in the prior art has the problems that the scheduling request processing time is long, the efficiency is low, and the misjudgment causes the service processing to fail, which affects the resource scheduling capability and resource allocation efficiency of the scheduling system.
  • the embodiment of the invention provides a method, a device and a filter scheduler for resource scheduling, which can solve the problem that the scheduling system processes the scheduling request for a long time, the efficiency is low, and the misjudgment causes the service processing to fail, and the scheduler system is improved. Resource scheduling capabilities and resource allocation efficiency.
  • a method for resource scheduling is provided, where the method is applied to a scheduling system, where the scheduling system includes at least two filter schedulers and at least two servers, wherein each filter scheduler is associated with one virtual group a group, each virtual group includes all servers that can be scheduled by the filter scheduler associated with the virtual group, and one server belongs to only one virtual group; first, the first filter scheduler obtains a scheduling request message, The scheduling request message carries a service requirement, and the first filtering scheduler is any filtering scheduler in the scheduling system; then, the first filtering scheduler converts the scheduling request message into a scheduling task message, and asynchronously The communication mode notifies each of the filter schedulers in the scheduling system, wherein the scheduled task message carries the service requirement and the role information of the first filter scheduler, where the schedule task message is used to indicate that the filter scheduler is in accordance with the service requirement.
  • the first filtering scheduler obtains a scheduling result determined by the filtering scheduler in the scheduling system according to the scheduling task message; when the preset condition is met The first filter scheduler determines a final scheduling result in the obtained scheduling result according to a preset algorithm, where the final scheduling result includes one or more servers that meet the service requirement.
  • each virtual group includes one or more servers.
  • the scheduling task message may further include identifier information and IP address information of the first filter scheduler.
  • the first filtering scheduler that obtains the scheduling request message may record the role information of each filtering scheduler in the current scheduling task message by using the data table in the specified file or the database.
  • the role of the filter scheduler may include both Leader and Worker, wherein the filter scheduler of the Worker role is responsible for filtering the associated virtual in the set of at least one server that it can schedule.
  • the group determines one or more servers that meet the service requirements as the scheduling result;
  • the filter scheduler of the Leader role is a filter scheduler that obtains the scheduling request message, and is responsible for converting the scheduling request message into a scheduling task message, and notifying the scheduling system. All the filter schedulers have scheduling task messages to be processed, summarize the scheduling results determined by the filter scheduler of all the worker roles, and select one or more services satisfying the service requirements among all the summarized scheduling results according to the preset algorithm. For the final scheduling results.
  • the role information is temporary information, that is, it is only valid during the processing of the current scheduling request message.
  • each scheduling request message is determined by a leader role of the filtering scheduler to determine the final scheduling result, and each type of role Only one message can be processed at a time, that is, the filter role of the Leader role can only process one scheduling request message at a time, and the filter scheduler of the Worker role can only process one scheduling task message at a time.
  • the filtering scheduler releases the role information corresponding to the current scheduling request message processing.
  • each of the filter schedulers in the scheduler system determines the scheduling result in the respective set of servers that can be scheduled according to the same scheduling request, and sends the scheduling result to the filtering schedule for acquiring the scheduling request message.
  • the filter scheduler determines one or more servers as the final scheduling result among all the summarized scheduling results, and has only one filtering schedule for the same scheduling request message in the prior art.
  • the parallel processing of multiple filtering schedulers solves the problem of long processing time and low efficiency of scheduling tasks in the prior art, and improves the resource scheduling capability and resource allocation efficiency of the scheduling system.
  • the notifying, by the asynchronous communication manner, each filtering scheduler in the scheduling system includes: the first filtering scheduler storing the scheduling task message in a message queue, so that Every A filter scheduler listens to the message queue and acquires the scheduled task message.
  • the message queue software deletes the scheduling request message in the message queue to avoid waste of resources caused by repeated processing.
  • the scheduler cannot obtain the scheduling request message again.
  • the scheduling task persists during the processing of the scheduling request until the first filter processes the scheduling task, and then notifies the message queue software to delete the scheduling task message, so that all the filtering schedulers in the storage cluster can be asynchronous. The way to get the scheduled task.
  • the filtering scheduler in the storage cluster can determine the server in the virtual group corresponding to each filtering scheduler that is most suitable for performing the business requirements in the scheduling task.
  • the scheduling task message may also be stored in the database, and the manner in which the first filtering scheduler obtains the scheduling request message may also be performed by listening to the database, that is, when there is a scheduling request message to be processed in the database, the slave database Obtain the scheduling request message.
  • the notifying, by the asynchronous communication manner, each filtering scheduler in the scheduling system includes: the first filtering scheduler storing the scheduling task message in a database, so that Each of the filter schedulers listens to the database and acquires the scheduled task message.
  • the filtering scheduler determines, according to the service requirement, a scheduling result in a virtual group associated with the filtered scheduler, including: the filtering scheduler obtaining the Scheduling a task message; the filter scheduler determines, in the virtual group associated with the filter scheduler, a server that satisfies the service requirement according to the service requirement; and the filter scheduler performs a pair of predefined weight algorithm
  • the determined servers are sorted, and one or more are sequentially selected in order as the scheduling result.
  • the preset conditions include:
  • the first filter scheduler obtains that the number of the scheduling results meets a first threshold and the receiving time satisfies a second threshold.
  • each filter scheduler can only process one scheduled task message at a time.
  • the first filtering scheduler is When the final scheduling result is determined, the first threshold may be set. When the number of the summarized scheduling results meets the first threshold, one or more servers are selected as the final scheduling result in the obtained scheduling result.
  • the method for determining, by the first filtering scheduler, the final scheduling result in the scheduling result according to a preset algorithm includes any one of the following manners:
  • the first filter scheduler sorts all servers in the scheduling result according to the weight determined by the predefined weight algorithm, and sequentially selects one or more servers as the final scheduling result; or
  • the first filter scheduler sequentially selects one or more servers from the scheduling result in the order of receiving time as the final scheduling result;
  • the first filter scheduler randomly selects one or more servers from the scheduling result as the final scheduling result
  • the predefined weight algorithm may be based on at least a CPU, a remaining amount of memory, a remaining amount of the disk, a network traffic, a CPU type, a disk type, a network card type, and a number of times the disk reads and writes per second.
  • the first filtering scheduler after determining the final scheduling result, notifies the message queue software to delete the processed scheduling task message. At the same time, the first filter scheduler also sends the optimal scheduling result to the task assignment node, and the task assignment node sends the service requirement in the scheduling task to the server corresponding to the final scheduling result, and the server performs the business requirement.
  • the specific implementation process
  • each filtering scheduler in the scheduling system divides and cooperates, and respectively determines scheduling results in respective associated virtual groups, and a filtering scheduler summarizes the filtering scheduler according to the scheduling task message. Determining the scheduling result, and determining one or more servers as the final scheduling result in the foregoing scheduling result, compared with the prior art, the same scheduling request message is processed by multiple filtering schedulers in parallel, reducing scheduling Processing time improves the processing efficiency of the scheduling system.
  • each filter scheduler uses resource preemption information to record the resource information required for the determined scheduling result, thereby solving the scheduling failure problem caused by the fact that the record server resource occupancy cannot be updated in real time in the database in the prior art, thereby Improved the ability of the scheduler cluster to manage new resources in large data.
  • an apparatus for resource scheduling comprising various modules for performing the resource scheduling method of the first aspect or any of the possible implementations of the first aspect.
  • a method for resource scheduling is provided, where the method is applied to a scheduling system, where the scheduling system includes at least two filter schedulers and at least two servers, wherein each filter scheduler is associated with one virtual group a group, each virtual group includes all servers that can be scheduled by the filter scheduler associated with the virtual group, and one server belongs to only one virtual group; first, the first filter scheduler obtains a scheduling request message, The scheduling request message carries a service requirement, and the first filtering scheduler is any filtering scheduler in the scheduling system; then, the first filtering scheduler converts the scheduling request message into a scheduling task message, and the scheduling is performed.
  • the task message is sent to the server in the scheduling system except the first filter scheduler, where the scheduling task message carries the service requirement and the role information of the first filter scheduler, and the schedule task message is used to indicate the scheduling system.
  • Other filter schedulers other than the first filter scheduler are associated with other filter schedulers based on business requirements. Determining a scheduling result in the quasi-group, and transmitting the scheduling result to the first filtering scheduler; next, the first filtering scheduler acquires a scheduling result determined by the filtering scheduler in the scheduling system according to the scheduling task message; When the preset condition is met, the first filter scheduler determines the final scheduling result in the acquired scheduling result according to the preset algorithm, and the final scheduling result includes one or more servers that meet the service requirement.
  • the first filtering type and other filtering schedulers in the scheduling system directly communicate.
  • each filtering scheduler in the scheduling system divides and cooperates, and the filtering of the scheduling request message is obtained.
  • the scheduler determines the final scheduling result, reduces the processing time, and improves the processing efficiency of the scheduling request message.
  • the preset conditions include:
  • the first filter scheduler obtains that the number of the scheduling results meets a first threshold and the receiving time satisfies a second threshold.
  • the method for determining, by the first filtering scheduler, the final scheduling result in the acquired scheduling result according to a preset algorithm includes any one of the following manners:
  • the weight of the first filter scheduler determined according to the predefined weight algorithm is used in the scheduling result There are servers to sort, and one or more servers are selected in turn for the final scheduling result; or
  • the first filter scheduler sequentially selects one or more servers from the scheduling result in the order of receiving time as the final scheduling result;
  • the first filter scheduler randomly selects one or more servers from the scheduling result as the final scheduling result
  • the predefined weight algorithm may be based on at least one of a CPU remaining amount of the server, a remaining memory amount, a remaining amount of the disk, a network traffic, a CPU type, a disk type, a network card type, and a number of times the disk reads and writes per second. Define different weights and calculate the weight of the obtained server.
  • each filtering scheduler in the scheduling system divides and cooperates, determines scheduling results in respective associated virtual groups, and summarizes all scheduling results by a filtering scheduler and determines final scheduling.
  • multiple filtering schedulers are processed in parallel, which reduces the scheduling processing time and improves the processing efficiency of the scheduling system.
  • each filter scheduler uses resource preemption information to record the resource information required for the determined scheduling result, thereby solving the scheduling failure problem caused by the fact that the record server resource occupancy cannot be updated in real time in the database in the prior art, thereby Improved the ability of the scheduler cluster to manage new resources in large data.
  • a filter scheduler in a fourth aspect, includes a processor, a memory, a communication interface, and a bus, and the processor, the memory, and the communication interface are connected by a bus and complete communication with each other.
  • the memory is configured to store computer execution instructions, and when the filter scheduler is running, the processor executes a computer execution instruction in the memory to perform the first aspect and the first with hardware resources in the filter scheduler Any of the aspects described in the possible implementations.
  • a fifth aspect a computer readable medium for storing a computer program, the computer program comprising instructions for performing the method of the first aspect and the possible implementation of any of the first aspects.
  • each of the filter schedulers in the scheduler cluster cooperates and determines the scheduling result in each corresponding virtual group, and is obtained by the filter scheduler that obtains the scheduling request.
  • the scheduling result determines that one or more servers are final scheduling results, which avoids resource competition problems caused by multiple filtering schedulers working in parallel in the prior art.
  • each filter scheduler uses the resource camping information to record the resource information required for the determined scheduling result, and solves the problem of scheduling failure caused by the inability of the record server resource occupancy in the database in the prior art to be updated in real time.
  • the dispatcher cluster resource allocation message improves the ability of the scheduler cluster to manage new resources in large data.
  • FIG. 1 is a schematic diagram of a scheduling system according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for resource scheduling according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart diagram of another method for resource scheduling according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic flowchart diagram of another method for resource scheduling according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic flowchart diagram of another method for resource scheduling according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic diagram of an apparatus for resource scheduling according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a filter scheduler according to an embodiment of the present invention.
  • the scheduling system includes a management node, a task allocation node, a filter scheduler, a server, and a database, wherein two or more filters are used.
  • the scheduler forms a scheduler cluster.
  • the management node may pre-create a virtual group for each filter scheduler in the scheduling system, and the virtual group includes all servers that the filter scheduler can schedule, that is, the virtual group includes one or more servers, and A server belongs to only one virtual group.
  • the management node creates one virtual group for each filter scheduler in advance, including:
  • the virtual group 1 is a virtual group associated with the filter scheduler 1, and the virtual group includes the server 1 and the server 2.
  • the virtual group 2 is a virtual group associated with the filter scheduler 2, which includes the server 3 and the server 4.
  • the virtual group 3 is a virtual group associated with the filter scheduler 3, which includes the server 5 and the server 6.
  • the correspondence between the filter scheduler, the virtual group, and the server can utilize database records as shown in FIG.
  • the database is also used to record the used resource information and available resource information of each server, for example, the usage and availability of the server's CPU, memory, disk, network card and other resources.
  • the filtered scheduler can query its associated virtual group and the available resource information of each server in the virtual group through the database.
  • the filter scheduler may also record the correspondence between the filter scheduler, the virtual group, and the server by using a specified file.
  • the management node may divide the server into different virtual groups according to attributes such as an identification (ID), an operating system type, and a hard disk type.
  • each virtual group can be the same or different.
  • three types of filter schedulers are included in the scheduler cluster, and two virtual servers in the virtual group corresponding to each filter scheduler are exemplified in detail.
  • the management node may adjust the number of servers in each virtual group according to a predefined adjustment policy. For example, if there is a faulty server in the virtual group 1, the management node can adjust each virtual according to the priority order of the filter scheduler. The number of servers in the quasi-group; if a new filter scheduler is added to the scheduling system, the management node can add the server to a virtual group associated with the filter scheduler according to the processing capability of each filter scheduler. in.
  • the virtual group may also be managed by the task assignment node, that is, the task assignment node creates a virtual group for each filter scheduler and dynamically adjusts the number of servers in the virtual group.
  • management node and the task allocation node in FIG. 1 may be deployed in the same server, or may be deployed in different servers separately, which is not limited by the present invention.
  • management node and the filter scheduler shown in FIG. 1 are deployed in the same server as an example for detailed description.
  • the virtual group may also be managed by a third party management device or device outside the scheduling system that is capable of learning all of the filtered scheduler and server information.
  • the task allocation node is further configured to receive the scheduling request message, and store the scheduling request message carrying the service requirement in a message queue (Message Queue, MQ), where each filtering scheduler in the scheduling system is monitored.
  • MQ message Queue
  • the scheduling request message is obtained, and the final scheduling result is determined, and then the final scheduling result is sent to the message.
  • the task assignment node is sent by the task assignment node to the one or more servers corresponding to the final scheduling result.
  • the message queue is a container for saving messages during the transmission of the message.
  • the server 100 is used to deploy the message queue software, and the message queue software can use the memory of the server 100 to save and delete the task allocation node and the filtering method.
  • Message queue 1 is used to save messages transmitted between the task assignment node and the scheduling cluster, such as scheduling request messages and final scheduling results.
  • Message queue 2 is used to save messages transmitted between the filter schedulers, such as The task message is scheduled and the scheduling result determined by each filter scheduler.
  • the message queue software may also save the message in the form of a message queue cluster.
  • Each message queue cluster includes at least two message queues, and different message queue clusters are used to store different types of messages. For example, there are two in the storage system.
  • message queue cluster message queue cluster 1 is used to save messages transmitted between the task assignment node and the scheduler cluster.
  • one message queue in message queue cluster 1 is used to save the scheduling request message, and another message queue is used to save the final scheduling result.
  • Message queue cluster 2 is used to save messages transmitted between the filter schedulers.
  • one message queue in message queue cluster 2 is used to save scheduling task messages, and another message queue is used to save the schedule determined by each filter scheduler. result.
  • the message queue can be deployed by a separate server, or multiple servers can be deployed simultaneously, and server resources can be shared with other types of software.
  • a scenario in which a message queue is deployed by a separate server as shown in FIG. 1 is taken as an example for further elaboration.
  • the communication mode between the task allocation node and the filtering scheduler in the scheduling system and all the filtering schedulers may also be implemented by using other asynchronous communication methods such as a database, such as a Red is database.
  • a resource scheduling method provided by an embodiment of the present invention is further introduced in conjunction with FIG. 2, as shown in the figure, the method includes:
  • the first filter scheduler acquires a scheduling request message.
  • the scheduling request message carries the service requirement, and the first filtering scheduler is any filtering type in the scheduling system. scheduler.
  • the manner in which the first filter scheduler obtains the scheduling request message may be a manner of listening to the message queue, that is, when there is a scheduling request message to be processed in the message queue, the scheduling request message is obtained from the message team.
  • the scheduling task message may also be stored in the database, and the manner in which the first filtering scheduler obtains the scheduling request message may also be performed by listening to the database, that is, when there is a scheduling request message to be processed in the database, the slave database Obtain the scheduling request message.
  • the task assignment node may also send the scheduling request message directly to the first filtered scheduler.
  • the first filtering scheduler converts the scheduling request message into a scheduling task message, and notifies each filtering scheduler in the scheduling system by asynchronous communication.
  • the scheduling task message carries the service requirement and the role information of the first filtering scheduler, and the task scheduling message is used to indicate that each filtering scheduler in the scheduling system determines the scheduling result in the associated virtual group according to the service requirement.
  • the scheduling result is summarized into a first filtered scheduler, and the scheduling result includes one or more servers that meet the business requirements.
  • the first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and the scheduling task message may be stored in the message queue, and each filtering scheduler in the scheduling system is listening to the message. When there is a scheduled task message to be processed in the queue, the scheduling task message is obtained.
  • the first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and may also store the scheduling task message in a database used for asynchronous communication, such as a Red is database. All filter schedulers obtain the scheduled task message by periodically listening to the database.
  • the first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and may also obtain an IP address of all filtering schedulers in the scheduling system from the database, according to the IP address.
  • the scheduled task message is sent to all filter schedulers except the first filter scheduler.
  • the first filter scheduler acquires a scheduling result determined by the filter scheduler in the scheduling system according to the scheduling task message.
  • the filtering scheduler in the scheduling system determines, according to the role information in the scheduling task message, a message queue used by the first filtering scheduler to receive the scheduling result, and stores the scheduling result in the message queue.
  • the first filter scheduler listens to the message queue, and obtains the scheduling result when there is a new scheduling result in the message queue.
  • the first filter scheduler determines a final scheduling result in the acquired scheduling result according to a preset algorithm.
  • satisfying the preset condition includes that the quantity of the first filter scheduler acquiring the scheduling result satisfies the first threshold; or the number of the first filter scheduler acquiring the scheduling result satisfies the first threshold and the receiving time meets the second threshold.
  • the final scheduling result determined by the first filter scheduler includes one or more servers that meet the business requirements.
  • each of the filter schedulers in the scheduler system determines the scheduling result in the respective set of servers that can be scheduled according to the same scheduling request, and sends the scheduling result to the filtering schedule for acquiring the scheduling request message.
  • the filter scheduler determines one or more servers as the final scheduling result among all the acquired scheduling results, and only one filter scheduler determines the scheduling result in the prior art.
  • the parallel processing of multiple filter schedulers solves the problem of long processing time and low efficiency of scheduling tasks in the prior art, and improves resource scheduling capability and resource allocation efficiency of the scheduling system.
  • the following is a description of the resource scheduling method provided by the embodiment of the present invention.
  • the method includes:
  • the first filtered scheduler obtains a scheduling request message in a message queue.
  • the task allocation node After receiving the scheduling request message sent by the application layer, the task allocation node stores the scheduling request message in the message queue, and the first filtering scheduler obtains the scheduling request message, where the first filtering scheduler is a scheduling Any filter scheduler that obtains the scheduling request message in the system.
  • the service requirement carried in the scheduling request message, the service requirement includes information about creating a virtual machine, virtual machine migration information, and virtual machine resource scheduling.
  • Table 1 shows an example of a message format for a scheduling request message:
  • each filtering scheduler in the scheduling system identifies, by means of the interception manner, whether there is a scheduling request message to be processed in the message queue.
  • the idle scheduling filter scheduler will The scheduling request is obtained from the message queue.
  • the first filtering scheduler that obtains the scheduling request message is responsible for processing the scheduling request.
  • the message queue software deletes the scheduling request message in the message queue to avoid waste of resources caused by repeated processing. The scheduler cannot obtain the scheduling request message again.
  • the first filter scheduler converts the scheduling request message into a scheduling task message, and stores the scheduling task message in a message queue.
  • the first filtered scheduler adds the role information of the first filtered scheduler in the scheduling request message.
  • the scheduling task message is used to indicate that the filtering scheduler in the scheduling cluster determines the scheduling result, and sends the determined scheduling result to the first filtering scheduler.
  • the scheduling task message also carries the service requirement, that is, the service requirement carried in the scheduling request message in step S301.
  • the scheduling task message may further include identifier information and IP address information of the first filter scheduler.
  • Table 2 is an example of a message format in which the first filter scheduler converts the scheduling request message in Table 1 into a scheduling task message:
  • the scheduling request message is converted into a scheduling task message in the message grid.
  • the identifier and role information of the first filter scheduler and the IP address of the first filter scheduler are added.
  • the message format included in the scheduling request message and the scheduling request task message in Table 1 and Table 2 is only an example. In a specific implementation process, a message format of other content may also be included.
  • the first filtering scheduler that obtains the scheduling request message may record the role information of each filtering scheduler in the current scheduling task message by using the data table in the specified file or the database.
  • the role of the filter scheduler may include both Leader and Worker, wherein the filter scheduler of the Worker role is responsible for filtering the associated virtual in the set of at least one server that it can schedule.
  • the group determines one or more servers that meet the service requirements as the scheduling result;
  • the filter scheduler of the Leader role is a filter scheduler that obtains the scheduling request message, and is responsible for converting the scheduling request message into a scheduling task message, and notifying the scheduling system. All the filter schedulers have scheduling task messages to be processed, summarize the scheduling results determined by the filter scheduler of all the worker roles, and select one or more services satisfying the service requirements among all the summarized scheduling results according to the preset algorithm. For the final scheduling results.
  • the filtering scheduler 1 acquires the scheduling request message, the filtering scheduler 1 records the role information in the processing of the current scheduling request message, and the filtering scheduler 1 is this.
  • the leader of the scheduling request message, the filter scheduler 2 and the filter scheduler 3 are all Worker roles.
  • the filter scheduler 1 may also have a Worker role, then the filter scheduler 1, the filter scheduler 2, and The filter scheduler 3 is responsible for determining the scheduling result in its associated virtual group, and transmitting the determined scheduling result to the filter scheduler 1, and the filter scheduler 1 is responsible for obtaining the filter scheduler according to the scheduled task message. Determine the scheduling results and determine one or more servers as the final scheduling results.
  • the role information is temporary information, that is, it is only valid during the processing of the current scheduling request message.
  • each scheduling request message is determined by a leader role of the filtering scheduler to determine the final scheduling result, and each type of role Only one message can be processed at a time, that is, the filter role of the Leader role can only process one scheduling request message at a time, and the filter scheduler of the Worker role can only process one scheduling task message at a time.
  • the filtering scheduler releases the role information corresponding to the current scheduling request message processing.
  • the first filtering scheduler stores the scheduling task message in the message queue, so that the filtering scheduler in the scheduling system can listen to the message queue, obtain the scheduling task message from the message queue, and process the message.
  • the scheduling task message may be saved in the message queue for storing the scheduling request message in step S301, and all the filtering schedulers in the scheduling system identify the scheduling request message and the scheduling task message during the process of listening to the message queue.
  • the identifier distinguishes between different scheduling request messages and scheduling task messages; optionally, the scheduling request message may also be saved by using a separate message queue, and all filtering schedulers in the scheduling system identify whether there are scheduled scheduling task messages by listening to the specified message queue. .
  • the scheduling task in a manner that the scheduling request message is deleted after being acquired by the first filtering scheduler in step S301, the scheduling task is stored in the message queue in step S302, and the scheduling task is in the processing process of the current scheduling request. It persists until the first filter processes the scheduled task, and then notifies the message queue software to delete the scheduled task message, so that all the filtered schedulers in the storage cluster can acquire the scheduled task in an asynchronous manner. After the filtering scheduler in the storage cluster obtains the scheduling task, it can determine that each filtering scheduler is correct. The server in the virtual group that is best suited to perform the business needs in the scheduled task.
  • the first filtering scheduler may also save the scheduling task message in a database for asynchronous communication, and each filtering scheduler periodically listens to the database manner. Identify and obtain the scheduled task message to be processed.
  • the first filtering scheduler may also obtain the IP addresses of all the filtering schedulers in the scheduling system from the database, and directly report to each filtering according to the IP address.
  • the dispatcher sends the scheduled task message.
  • the first filter scheduler obtains the scheduling task message in a message queue, and saves the determined scheduling result in a message queue.
  • the filtering scheduler of each idle state in the scheduling system acquires the scheduling request message and processes it by means of interception.
  • the first filter scheduler detects that there is a scheduled task message to be processed, and the first filter scheduler is in an idle state, the first filter scheduler obtains the schedule task message and is associated with the virtual group. Select one or more servers in the group that meet the business requirements as the scheduling result.
  • each filter scheduler can only process one scheduled task message at a time, that is, each filter scheduler will acquire and process a new schedule in the message queue only after the current scheduled task message is processed. Task message.
  • FIG. 4 is a flowchart of a method for determining a scheduling result by the filtering scheduler. As shown in the figure, the specific method includes:
  • the filter scheduler determines, according to the service requirement, a server that meets the service requirement in the virtual group associated with the filter scheduler.
  • the server that meets the service requirement is determined by the filter scheduler according to the service requirement and the remaining available resources of the server in the virtual group associated with the filter scheduler, that is, the virtual group associated with the filter scheduler. Identify one or more servers that meet the business needs.
  • the filter scheduler calculates the sorted servers according to the predefined weight algorithm calculation, and sequentially selects one or more servers as the scheduling result in sequence.
  • each filter scheduler calculates a weight of a server that satisfies a business requirement according to a predefined weight algorithm, and sorts the server for the weight, and sequentially selects one or more of a sequence from high to low or low to high.
  • the servers serve as the determined scheduling results.
  • the predefined weight algorithm may define at least one of a server resource, a memory resource, a disk remaining amount, a disk read/write times per second, and a network bandwidth according to a customized requirement of a specific service application. The weights are calculated and the weight of the server is calculated.
  • the scheduling result further includes weight information of the server.
  • the service requirement carried in the scheduling request message is to create a virtual machine with 2 CPUs, 8 GB memory, 32 G disks, and 1 network card.
  • the server that satisfies the business requirement includes two servers; if the business application has customization requirements for the remaining amount of the disk and memory of the server, the predefined right In the value algorithm, the available memory weight of the server is 0.6, and the available disk weight is 0.4.
  • the available memory resource of the server 1 is 10G
  • the available disk is 100G
  • the available memory resource of the server 2 is 20G
  • the available disk is 100G
  • the weights of the servers satisfying the service requirement are the server 2 and the server 1 in descending order
  • the filter scheduler 1 determines that the server 1 is The scheduling result of the scheduling request message in the server set that it can schedule.
  • the scheduling result further includes the weight information 50 of the server 2.
  • Table 3 is an example of a message format of a scheduling result in the above embodiment:
  • each filter scheduler in the scheduling system selects at least one server that satisfies the service requirement as the scheduling result in the manner in which the server can be scheduled according to the first screening and reordering.
  • the filtering scheduler sends the determined scheduling result to the specified filtering scheduler according to the role information in the scheduling task, for example, to the first filtering scheduler in step S301.
  • the manner in which the filtering scheduler sends the scheduling result to the first filtering schedule may be any one of the following modes:
  • the filter scheduler stores the determined scheduling result in the message queue according to the role information in the scheduling task message.
  • the message queue for storing the scheduling result determined by the filter scheduler may be the same as the message queue for saving the scheduling request message in step S301.
  • the first filter scheduler distinguishes the scheduling request message and the scheduling task by specifying the message format.
  • the message and the scheduling result, wherein the specified message format for determining the scheduling result may be the "scheduling result" in Table 3.
  • the scheduling result may also be directly sent to the message queue of the first filtering scheduler for receiving the scheduling result according to the role information in the scheduling task message.
  • Manner 2 Send the determined scheduling result to the first filtering scheduler according to the IP address of the first filtering scheduler in the scheduling task message.
  • the first filter scheduler if there is a Leader role and a Worker role in the current task, when the first filter scheduler is used as the Leader role of the scheduled task message, the first filter type The scheduler may be in a non-idle state, and the scheduled task message may not be the first scheduled task message to be processed in the message queue. To simplify the implementation process, the first filter will save the converted schedule task message directly. In the message queue, when the first filter scheduler is in an idle state, the scheduled task message is re-acquired for processing, and the scheduling result is stored in a message queue for saving the scheduling result or stored in the local storage.
  • the scheduled task message may also be stored in the local storage, when the first filter scheduler is idle.
  • the scheduling task message identifier distinguishes different scheduling task messages, and the locally saved scheduling task message is preferentially processed.
  • the other filter scheduler in the scheduling system acquires a scheduling task message in the message queue, and stores the determined scheduling result in the message queue.
  • the other filter scheduler is a filter scheduler of any idle state except the first filter scheduler in the scheduler cluster, and other filter schedules exist when there are scheduled task tasks to be processed in the message queue.
  • the device also obtains the scheduling task message, and selects at least one server that meets the service requirement in the associated virtual group as the scheduling result according to the service requirement carried in the scheduling task message.
  • the process of determining the scheduling result by the other filtering scheduler is the same as that described in step S303, and details are not described herein again.
  • the first filter scheduler obtains a scheduling result determined by each filter scheduler in the scheduler system.
  • the manner in which the first filtering scheduler obtains the scheduling result is the manner in which the filtering scheduler sends the scheduling result in step S303, and the first filtering scheduler may obtain the scheduling result from the message queue, or may receive the filtering scheduling.
  • the scheduling result sent by the device is the manner in which the filtering scheduler sends the scheduling result in step S303, and the first filtering scheduler may obtain the scheduling result from the message queue, or may receive the filtering scheduling. The scheduling result sent by the device.
  • the first filter scheduler determines, in the acquired scheduling result, a final scheduling result according to the preset algorithm, where one or more servers satisfying the service requirement are included in the final scheduling result.
  • the preset condition may be any one of the following methods:
  • Manner 1 The first filter scheduler summarizes the number of scheduling results to meet the first threshold.
  • Manner 2 The first filter scheduler receives the number of scheduling results that meet the first threshold and the receiving time meets the second threshold.
  • each filter scheduler can only process one scheduled task message at a time.
  • the first filtering scheduler is When the final scheduling result is determined, the first threshold may be set. When the number of the summarized scheduling results meets the first threshold, one or more servers are selected as the final scheduling result in the obtained scheduling result.
  • the first filtering scheduler may limit the receiving time in addition to the number of the scheduled scheduling results, when both meet the requirements, that is, in the summarized scheduling result. Choose a final scheduling result.
  • the first filter scheduler may further select a final scheduling result after receiving the scheduling result sent by all the filtering schedulers in the scheduling system, that is, selecting one of all servers in the scheduling system or A plurality of servers satisfying the business requirements are used as the final scheduling result, and the final scheduling result is one or more servers that satisfy the optimal business requirements.
  • processing manner that the first filtering scheduler determines the final scheduling result in the scheduling result according to the preset algorithm includes any one of the following manners:
  • the first filter scheduler sorts all the servers in the obtained scheduling result according to the weight determined by the predefined weight algorithm, and sequentially selects one or more servers that meet the service requirements as the final scheduling result.
  • Table 4 is an example of the scheduling result summarized by the first filter scheduler. It is assumed that the service requirement is to create one virtual machine, and the first filter scheduler determines the weight according to the predefined weight algorithm to all servers. Enter The row sorting from high to low is server 3, server 5, and server 1. The final scheduling result is server 3, that is, server 3 is the best server that satisfies the business requirements.
  • Scheduling result server information Weight information Scheduling result 1 Server 1 46 Scheduling result 2 Server 3 60 Scheduling result 3 Server 5 55
  • the predefined weight algorithm may be the same as the method for determining the weight in step S303b, or the weight of the server resource may be redefined according to the specific application requirement, and the server weight is calculated.
  • the server resource includes a CPU type, a disk type, a network card type, and Available CPU resources, available memory resources, disk remaining amount, network bandwidth, disk read/write times per second, CPU remaining amount, memory remaining amount, disk remaining amount, etc., the final scheduling result is the optimal one to meet the business requirements. Or multiple servers.
  • the predefined weight algorithm may also determine the weight of the server resource according to the service application not paying attention to the resource information, and calculate the weight information of each server.
  • the first filter scheduler may sequentially select the sequence from low.
  • One or more servers that meet high business needs are the final scheduling results.
  • the first filter scheduler selects one or more servers as the final scheduling result in the received scheduling result determined by each filter scheduler in sequence.
  • Manner 3 The first filter scheduler randomly selects one or more servers from the scheduling result as a final scheduling result.
  • the second scheduling method may be determined according to the second filtering mode, that is, the first filtering scheduler determines the final scheduling result according to the receiving time sequence or a random manner, and the final scheduling result is obtained. It includes at least one server that meets business needs.
  • the first filtering scheduler after determining the final scheduling result, notifies the message queue software to delete the processed scheduling task message. At the same time, the first filter scheduler also sends the optimal scheduling result to the task assignment node, and the task assignment node sends the service requirement in the scheduling task to the server corresponding to the final scheduling result, and the server performs the business requirement.
  • the specific implementation process
  • step S301 to step S306 when there is a scheduling request message to be processed in the scheduling system, the scheduling request message is obtained by a filtering scheduler, the scheduling request message is converted into a scheduling task message, and the scheduling is performed.
  • the request message is stored in the message queue, and each filter scheduler in the scheduler system processes the scheduled task message, and summarizes the determined scheduling result to the filter scheduler, and the filter scheduler follows the preset algorithm.
  • the optimal one or more servers that meet the business requirements are determined in the aggregated scheduling result as the final scheduling result.
  • each filtering scheduler in the scheduling system divides and cooperates and performs parallel processing, which solves the problem that the scheduling processing time is long and the efficiency is low in the prior art, and the whole scheduling system is improved. Scheduling capability and resource scheduling efficiency.
  • each filter scheduler may also record the records recorded in the prior art by recording resource camp-on information after determining the scheduling result in the corresponding virtual group.
  • the available resources of the server cannot be updated in real time, which causes the filter scheduler to misjudge the problem of scheduling failure.
  • the specific method is as shown in FIG. 5, and the method includes:
  • the filter scheduler records resource camping information after determining the scheduling result according to the scheduling task message.
  • the resource camping information is used to record the scheduling result determined by the filter scheduler.
  • the specifications of the virtual machine include 2 CPUs, 10 Gbytes of memory, 2 20 G disks, and 1 network card, assuming that the filter scheduler determines the virtual group associated with it. If the server 1 in the group is used as the scheduling result, the filtering scheduler records the above scheduling task message and the scheduling result as resource camping information.
  • Table 5 shows an example of resource preemption information
  • the filter scheduler may record resource preemption information by using a specified file, or may use a database to record resource camp-on information.
  • the resource pre-emption information recorded by the first filter scheduler is an information identifier recorded by the filter scheduler, and the physical resources are not actually divided in the server corresponding to the first scheduling result.
  • the filtering scheduler processes the filtering method for the server involved in the resource camping information during the processing.
  • the scheduler may first obtain the available resource information of the server in the database, subtract the resource preemption information recorded by the filter scheduler, determine the remaining resource information of the server, and determine the server according to the remaining resources of the server. Whether it is possible to execute the business requirements in the new scheduled task message.
  • the first filter scheduler determines the final scheduling result
  • the first filter scheduler notifies the filter scheduler of the final scheduling result, so that the filter scheduler clears the recorded resource camp-on information.
  • the final scheduling result is notified to all the filter schedulers in the scheduling system, so that the filtered scheduler in the scheduling system can clear the recorded resource camp-on information according to the final scheduling result.
  • the notification mode may store the final scheduling result in the message queue, or obtain the IP addresses of all the schedulers except the first filter scheduler in the database, and send the final scheduling result according to the IP address information.
  • process of clearing resource camp-on information includes the following two situations:
  • Case 2 If the server in the final scheduling result belongs to the virtual group associated with the filter scheduler, the filter scheduler clears the recorded resource camp-on information after the server in the final scheduling result completes the service processing. .
  • the server notifies the database in the scheduling system to update its resource occupancy, and notifies the server that the corresponding filter scheduler service requirement is successfully processed.
  • the scheduler accordingly clears the recorded resource preemption information.
  • each filtering scheduler in the scheduling system divides and cooperates, determines scheduling results in respective associated virtual groups, and summarizes all scheduling results by a filtering scheduler. The final scheduling result is determined.
  • the same scheduling request message is processed by multiple filtering schedulers in parallel, which reduces the scheduling processing time and improves the processing efficiency of the scheduling system.
  • each filter scheduler uses resource preemption information to record the resource information required for the determined scheduling result, thereby solving the scheduling failure problem caused by the fact that the record server resource occupancy cannot be updated in real time in the database in the prior art, thereby Improved the ability of the scheduler cluster to manage new resources in large data.
  • a method and a scheduling system for resource scheduling according to an embodiment of the present invention are described in detail above with reference to FIG. 1 to FIG. 5 .
  • a filter scheduler according to an embodiment of the present invention will be described below with reference to FIG. 6 to FIG. 7 . .
  • Figure 6 is a device 600 for resource scheduling according to an embodiment of the present invention.
  • the device 600 includes an obtaining unit 601, a processing unit 602, and a determining unit 603.
  • the acquiring unit is configured to acquire a scheduling request message, where the scheduling request message carries a service requirement;
  • the processing unit is configured to convert the scheduling request message into a scheduling task message, and notify each filtering scheduler in the scheduling system by using an asynchronous communication manner, where the scheduling task message carries the service a demand and a role information of the device, the scheduling task message is used to indicate that the filter scheduler determines a scheduling result in a virtual group associated with the filter scheduler according to the service requirement, and the scheduling result is Sent to the device, the scheduling result includes one or more servers that meet the service requirements;
  • the obtaining unit is further configured to acquire a scheduling result that is determined by the filtering scheduler in the scheduling system according to the scheduling task message;
  • the determining unit is configured to determine, in the preset scheduling result, a final scheduling result according to a preset algorithm, where the final scheduling result includes one or more servers that meet the service requirement. .
  • the apparatus 600 of the embodiment of the present invention may be implemented by an Application Specific Integrated Circuit (ASIC) or a Programmable Logic Device (PLD), and the PLD may be a complex program logic device ( Complex Programmable Logic Device (CPLD), Field-Programmable Gate Array (FPGA), Generic Array Logic (GAL), or any combination thereof.
  • ASIC Application Specific Integrated Circuit
  • PLD Programmable Logic Device
  • CPLD Complex Programmable Logic Device
  • FPGA Field-Programmable Gate Array
  • GAL Generic Array Logic
  • each of the filter schedulers in the scheduler system determines the scheduling result in the respective set of servers that can be scheduled according to the same scheduling request, and sends the scheduling result to the filtering method of acquiring the scheduling request message.
  • the scheduler selects a final scheduling result among all the scheduled scheduling results when the preset condition is met, and the plurality of filtering is compared with the prior art that only one filtering scheduler determines the scheduling result.
  • Parallel processing of the scheduler solves the problem of long processing time and low efficiency of scheduling tasks in the prior art. The problem is to improve the resource scheduling capability and resource allocation efficiency of the scheduling system.
  • the processing unit notifying, by asynchronous communication, each of the filtering schedulers in the scheduling system includes: storing the scheduling task message in the message queue, so that each of the filtering schedulers Listening to the message queue and obtaining the scheduling task message.
  • each filtering scheduler is notified that there is a scheduling task message to be processed, and the scheduling task message may be stored in a message queue, where each filtering scheduler exists in the listening message queue.
  • the scheduled task message is obtained when the task message is scheduled to be processed.
  • the message queue software deletes the scheduling request message in the message queue to avoid waste of resources caused by repeated processing.
  • the scheduler cannot obtain the scheduling request message again.
  • the scheduling task persists during the processing of the scheduling request until the first filter processes the scheduling task, and then notifies the message queue software to delete the scheduling task message, so that all the filtering schedulers in the storage cluster can be asynchronous. The way to get the scheduled task.
  • the filtering scheduler in the storage cluster can determine the server in the virtual group corresponding to each filtering scheduler that is most suitable for performing the business requirements in the scheduling task.
  • the first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and may also store the scheduling task message in a database used for asynchronous communication, such as a Red is database. All filter schedulers obtain the scheduled task message by periodically listening to the database.
  • the first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and may also obtain an IP address of all filtering schedulers in the scheduling system from the database, according to the IP address.
  • the scheduled task message is sent to all filter schedulers except the first filter scheduler.
  • the acquiring unit is further configured to obtain the scheduling task message
  • the processing unit is further configured to: determine, according to the service requirement, a server that meets the service requirement in a virtual group associated with the filter scheduler; sort the determined server according to a predefined weight algorithm, and One or more servers are sequentially selected in order as the scheduling result.
  • the preset condition includes: the first filter scheduler acquires the number of the scheduling results to meet a first threshold; or
  • the first filter scheduler obtains that the number of the scheduling results meets a first threshold and the receiving time satisfies a second threshold.
  • the determining unit determines, according to the preset algorithm, the final scheduling result in the acquired scheduling result, including any one of the following manners:
  • the predefined weight algorithm may be based on at least one of a CPU remaining amount of the server, a remaining memory amount, a remaining amount of the disk, a network traffic, a CPU type, a disk type, a network card type, and a number of times the disk reads and writes per second. Define different weights and calculate the weight of each server.
  • the device further includes a recording unit, and the recording unit is configured to: after determining the scheduling result, Recording resource pre-occupation information, where the resource pre-occupation information is used to identify resource information that needs to be occupied by the filtering result determined by the filtering scheduler in a corresponding server;
  • the processing unit is further configured to notify the filtered scheduler of the final scheduling result after the first filtered scheduler determines the final scheduling result.
  • each filtering scheduler in the scheduling system divides and cooperates, determines scheduling results in respective associated virtual groups, and summarizes all scheduling results by a filtering scheduler and determines final scheduling results.
  • multiple filtering schedulers are processed in parallel, which reduces the scheduling processing time and improves the processing efficiency of the scheduling system.
  • each filter scheduler uses resource preemption information to record the resource information required for the determined scheduling result, thereby solving the scheduling failure problem caused by the fact that the record server resource occupancy cannot be updated in real time in the database in the prior art, thereby Improved the ability of the scheduler cluster to manage new resources in large data.
  • Apparatus 600 in accordance with an embodiment of the present invention may correspond to performing the methods described in the embodiments of the present invention, and the above and other operations and/or functions of the various units in apparatus 600 are respectively implemented to implement the various methods of FIGS. 1 through 5. The corresponding process, for the sake of brevity, will not be described here.
  • FIG. 7 is a filter scheduler 700 provided by the present invention.
  • the filter scheduler 700 includes a processor 701, a memory 702, a communication interface 703, and a bus 704.
  • the processor 701 The memory 702 and the communication interface 703 are connected and communicate with each other via a bus 704 for storing computer execution instructions.
  • the processor 701 executes the memory 702.
  • the computer executes instructions to utilize the hardware resources in the filtered scheduler 700 to perform the following operations:
  • the scheduling task message carries the service requirement and the filtered scheduling
  • the role information of the device 700 the scheduling task message is used to instruct the filter scheduler to determine a scheduling result in a virtual group associated with the filter scheduler according to the service requirement, and send the scheduling result to the
  • the scheduling result includes one or more servers that meet the service requirements;
  • the final scheduling result is determined in the acquired scheduling result according to a preset algorithm, where the final scheduling result includes one or more servers that meet the service requirement.
  • the processor 701 may be a CPU, and the processor 701 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), and off-the-shelf programmable Gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGA off-the-shelf programmable Gate array
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 702 can include read only memory and random access memory and provides instructions and data to the processor 701. A portion of the memory 702 can also include a non-volatile random access memory. For example, the memory 702 can also store information of the device type.
  • the system bus 704 can include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as system bus 704 in the figure.
  • each filter scheduler uses the resource camping information to record the resource information required for the determined scheduling result, and solves the problem of scheduling failure caused by the inability of the record server resource occupancy in the database in the prior art to be updated in real time.
  • the dispatcher cluster resource allocation message improves the ability of the scheduler cluster to manage new resources in large data.
  • the filter scheduler 700 may correspond to the resource scheduling apparatus 600 in the embodiment of the present invention, and may correspond to performing corresponding ones in the method shown in FIG. 2 according to an embodiment of the present invention.
  • the above-mentioned and other operations and/or functions of the respective modules in the filter scheduler 700 are respectively implemented in order to implement the respective processes of the respective methods in FIG. 1 to FIG. 5, and are not described herein again for brevity.
  • each of the filter schedulers in the scheduler cluster cooperates and determines the scheduling result in each corresponding virtual group, and is summarized by the first filtered scheduler that obtains the scheduling request. All the results and finally determine the optimal scheduling result, avoiding the problem of resource competition caused by the parallel operation of multiple filter schedulers in the prior art.
  • each filter scheduler uses the resource camping information to record the resource information required for the determined scheduling result, and solves the problem of scheduling failure caused by the inability of the record server resource occupancy in the database in the prior art to be updated in real time.
  • the dispatcher cluster resource allocation message improves the ability of the scheduler cluster to manage new resources in large data.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the part of the technical solution of the present invention that contributes in essence or to the prior art or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method of various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present invention relates to a resource scheduling method and apparatus, and a filtered scheduler. The method comprises: a first filtered scheduler acquiring a scheduling request message carrying service requirements, converting the scheduling request message into a scheduling task message, and notifying each filtered scheduler in a scheduling system by means of asynchronous communication, wherein the scheduling task message is used for instructing the filtered scheduler to determine, according to the service requirements, a scheduling result in a virtual group associated with the filtered scheduler, and to send the scheduling result to the first filtered scheduler; acquiring a scheduling result determined, according to the scheduling task message, by the filtered scheduler in the scheduling system; and when a pre-set condition is satisfied, determining, according to a pre-set algorithm, a final scheduling result in the acquired scheduling result, the final scheduling result comprising one or more servers satisfying the service requirements. By means of the method, the processing capacity of scheduling and the scheduling efficiency of the whole scheduling system are improved.

Description

一种资源调度的方法、装置和过滤式调度器Method, device and filter scheduler for resource scheduling 技术领域Technical field
本发明涉及通信领域,尤其涉及虚拟化管理领域的一种资源调度的方法、装置和过滤式调度器。The present invention relates to the field of communications, and in particular, to a resource scheduling method, apparatus, and filter scheduler in the field of virtualization management.
背景技术Background technique
随着虚拟化技术的广泛应用,如何利用云计算管理平台更好地实现对资源的统一管理和调度的方法得到越来越多的关注,该管理平台重要技术之一为资源调度,即为业务请求分配到合适的资源,包括计算、存储、网络等资源,以此提高资源的利用率。With the widespread application of virtualization technology, how to use the cloud computing management platform to better realize the unified management and scheduling of resources has received more and more attention. One of the important technologies of the management platform is resource scheduling, which is the business. Requests are allocated to appropriate resources, including computing, storage, networking, etc., to improve resource utilization.
在云计算管理平台中,目前最常用的调度器是一种过滤式调度器,即在接收到调度请求时,首先按照调度请求中所携带的业务需求筛选出所有满足业务需求的服务器集合,再按照预定义权值计算方法对该服务器集合中所有服务器进行排序,调度器选择权值最高的服务器处理该业务需求。但随着大型数据中心中不断增加的业务场景,由单一的过滤式调度器来负责虚拟化系统中全部资源的调度无法满足业务需求,造成了严重的性能瓶颈,越来越多的数据中心采用多个过滤式调度器并行实施调度请求来分担整个大规模数据中心的调度任务。In the cloud computing management platform, the most commonly used scheduler is a filtering scheduler, that is, when receiving a scheduling request, first filtering out all the server sets satisfying the business requirements according to the business requirements carried in the scheduling request, and then All servers in the server set are sorted according to a predefined weight calculation method, and the scheduler selects the server with the highest weight to process the service demand. However, with the increasing business scenarios in large data centers, the single filter scheduler is responsible for the scheduling of all resources in the virtualized system, which cannot meet the business requirements, resulting in serious performance bottlenecks. More and more data centers adopt Multiple filter schedulers implement scheduling requests in parallel to share the scheduling tasks of the entire large-scale data center.
现有技术中调度系统中采用多个过滤式调度器组成调度器集群,当消息队列中存在待处理的多个调度请求时,调度器集群中的过滤式调度器会分别获取不同调度请求,并根据不同调度请求确定调度结果,但对于同一个调度请求来说,仍然是由一个过滤式调度器先在调度系统中的所有服务器中筛选出满足该调度请求的服务器集合,然后再按照预定义权值计算方法计算该服务器集合中所有服务器的权值,再依照权值对服务器进行排序,最终选出一个或多个服务器作为该调度请求的调度结果,在大规模数据中心中,上述调度方法由于需要同一个过滤式调度器在所有服务器中进行筛选和排序,导致同一调度任务的处理时间长、效率低。另一方面,现有技术中每个服务器的可用资源由数据库记录并保存,但是,服务器只有在完成调度请求中的业务需求时,才会通知数据库更新该服务器的可用资源情况。也就是说,数据库中记录的服务器的可用资源信息为非实时信息,过滤式调度器根据该信息所确定的服务器实际可能无法满足业务需求,从而影响过滤式调度器的判断,增加了调度失败的概率。因此,现有技术中多个过滤式调度器并行调度的方法存在调度请求处理时间长、效率低和误判导致业务处理失败的问题,影响调度系统的资源调度能力和资源分配效率。In the prior art, a plurality of filter schedulers are used in the scheduling system to form a scheduler cluster. When there are multiple scheduling requests to be processed in the message queue, the filter scheduler in the scheduler cluster separately obtains different scheduling requests, and The scheduling result is determined according to different scheduling requests, but for the same scheduling request, a filtered scheduler first filters out the server set that satisfies the scheduling request in all servers in the scheduling system, and then according to the predefined rights. The value calculation method calculates the weights of all the servers in the server set, and then sorts the servers according to the weights, and finally selects one or more servers as the scheduling result of the scheduling request. In the large-scale data center, the scheduling method is The same filter scheduler is required to filter and sort all servers, resulting in long processing time and low efficiency of the same scheduled task. On the other hand, the available resources of each server in the prior art are recorded and saved by the database, but the server only informs the database to update the available resources of the server when the business requirements in the scheduling request are completed. That is to say, the available resource information of the server recorded in the database is non-real-time information, and the server determined by the filter scheduler according to the information may not meet the service requirement, thereby affecting the judgment of the filter scheduler and increasing the scheduling failure. Probability. Therefore, the method for parallel scheduling of multiple filter schedulers in the prior art has the problems that the scheduling request processing time is long, the efficiency is low, and the misjudgment causes the service processing to fail, which affects the resource scheduling capability and resource allocation efficiency of the scheduling system.
发明内容Summary of the invention
本发明实施例提供了一种资源调度的方法、装置和过滤式调度器,可以解决现有技术中调度系统处理调度请求时间长、效率低和误判导致业务处理失败的问题,提升调度器系统的资源调度能力和资源分配效率。The embodiment of the invention provides a method, a device and a filter scheduler for resource scheduling, which can solve the problem that the scheduling system processes the scheduling request for a long time, the efficiency is low, and the misjudgment causes the service processing to fail, and the scheduler system is improved. Resource scheduling capabilities and resource allocation efficiency.
为了达到上述目的,本发明采用如下技术方案: In order to achieve the above object, the present invention adopts the following technical solutions:
第一方面,提供一种资源调度的方法,该方法应用于调度系统中,该调度系统中包括至少两个过滤式调度器和至少两个服务器,其中,每个过滤式调度器关联一个虚拟群组,每个虚拟群组中包括与该虚拟群组关联的过滤式调度器所能调度的所有服务器,且一个服务器只属于一个虚拟群组;首先,第一过滤式调度器获取调度请求消息,其中,该调度请求消息中携带业务需求,第一过滤式调度器为调度系统中任一过滤式调度器;然后,第一过滤式调度器将该调度请求消息转换为调度任务消息,并通过异步通信方式通知调度系统中的每个过滤式调度器,其中,该调度任务消息中携带业务需求和第一过滤式调度器的角色信息,该调度任务消息用于指示过滤式调度器根据业务需求在与该过滤式调度器关联的虚拟群组中确定调度结果,并将调度结果发送给第一过滤式调度器,该调度结果中包括满足业务需求的一个或多个服务器;接下来,第一过滤式调度器获取调度系统中的过滤式调度器根据调度任务消息确定的调度结果;当满足预置条件时,第一过滤式调度器按照预置算法在获取到的调度结果中确定最终调度结果,该最终调度结果中包括满足业务需求的一个或多个服务器。In a first aspect, a method for resource scheduling is provided, where the method is applied to a scheduling system, where the scheduling system includes at least two filter schedulers and at least two servers, wherein each filter scheduler is associated with one virtual group a group, each virtual group includes all servers that can be scheduled by the filter scheduler associated with the virtual group, and one server belongs to only one virtual group; first, the first filter scheduler obtains a scheduling request message, The scheduling request message carries a service requirement, and the first filtering scheduler is any filtering scheduler in the scheduling system; then, the first filtering scheduler converts the scheduling request message into a scheduling task message, and asynchronously The communication mode notifies each of the filter schedulers in the scheduling system, wherein the scheduled task message carries the service requirement and the role information of the first filter scheduler, where the schedule task message is used to indicate that the filter scheduler is in accordance with the service requirement. Determining the scheduling result in the virtual group associated with the filter scheduler, and transmitting the scheduling result to the first filter And the scheduling result includes one or more servers that meet the service requirement; next, the first filtering scheduler obtains a scheduling result determined by the filtering scheduler in the scheduling system according to the scheduling task message; when the preset condition is met The first filter scheduler determines a final scheduling result in the obtained scheduling result according to a preset algorithm, where the final scheduling result includes one or more servers that meet the service requirement.
值得说明的是,每个虚拟群组中包括一个或多个服务器。It is worth noting that each virtual group includes one or more servers.
可选地,调度任务消息中还可以包括第一过滤式调度器的标识信息和IP地址信息。Optionally, the scheduling task message may further include identifier information and IP address information of the first filter scheduler.
可选地,在调度任务消息处理过程中,获取调度请求消息的第一过滤式调度器可以利用指定文件或数据库中的数据表记录本次调度任务消息中每个过滤式调度器的角色信息,示例地,过滤式调度器的角色可以包括Leader和Worker两种,其中,Worker角色的过滤式调度器负责在其所能调度的至少一个服务器的集合中,经过筛选和排序后在其关联的虚拟群组中确定满足业务需求的一个或多个服务器为调度结果;Leader角色的过滤式调度器为获取调度请求消息的过滤式调度器,负责将调度请求消息转化为调度任务消息,通知调度系统中所有过滤式调度器存在待处理的调度任务消息,汇总所有Worker角色的过滤式调度器所确定的调度结果,并按照预置算法在所有汇总的调度结果中选择满足业务需求的一个或多个服务为为最终调度结果。Optionally, in the scheduling task message processing process, the first filtering scheduler that obtains the scheduling request message may record the role information of each filtering scheduler in the current scheduling task message by using the data table in the specified file or the database. For example, the role of the filter scheduler may include both Leader and Worker, wherein the filter scheduler of the Worker role is responsible for filtering the associated virtual in the set of at least one server that it can schedule. The group determines one or more servers that meet the service requirements as the scheduling result; the filter scheduler of the Leader role is a filter scheduler that obtains the scheduling request message, and is responsible for converting the scheduling request message into a scheduling task message, and notifying the scheduling system. All the filter schedulers have scheduling task messages to be processed, summarize the scheduling results determined by the filter scheduler of all the worker roles, and select one or more services satisfying the service requirements among all the summarized scheduling results according to the preset algorithm. For the final scheduling results.
值得说明的是,该角色信息为临时信息,即只在本次调度请求消息的处理过程中生效。当系统中同时存在多个调度请求消息时,不同过滤式调度器获取调度任务消息后,每个调度请求消息会由一个Leader角色的过滤式调度器负责确定最终调度结果,且每种类型的角色每次只能处理一种消息,即Leader角色的过滤式调度器每次只能处理一个调度请求消息,Worker角色的过滤式调度器每次只能处理一个调度任务消息。在调度请求消息处理结束之后,过滤式调度器即释放当前调度请求消息处理过程中所对应的角色信息。It is worth noting that the role information is temporary information, that is, it is only valid during the processing of the current scheduling request message. When multiple scheduling request messages exist in the system, after different filtering schedulers obtain scheduling task messages, each scheduling request message is determined by a leader role of the filtering scheduler to determine the final scheduling result, and each type of role Only one message can be processed at a time, that is, the filter role of the Leader role can only process one scheduling request message at a time, and the filter scheduler of the Worker role can only process one scheduling task message at a time. After the scheduling request message processing ends, the filtering scheduler releases the role information corresponding to the current scheduling request message processing.
在本实施例中,调度器系统中每个过滤式调度器均会根据同一个调度请求在各自能够调度的服务器集合中确定调度结果,并将该调度结果发送给获取调度请求消息的过滤式调度器,在满足预置条件时,由该过滤式调度器在汇总的所有调度结果中确定一个或多个服务器为最终调度结果,与现有技术中对于同一个调度请求消息仅有一个过滤式调度器确定调度结果相比,多个过滤式调度器并行处理解决了现有技术中调度任务处理时间长、效率低的问题,提升了调度系统的资源调度能力和资源分配效率。In this embodiment, each of the filter schedulers in the scheduler system determines the scheduling result in the respective set of servers that can be scheduled according to the same scheduling request, and sends the scheduling result to the filtering schedule for acquiring the scheduling request message. When the preset condition is met, the filter scheduler determines one or more servers as the final scheduling result among all the summarized scheduling results, and has only one filtering schedule for the same scheduling request message in the prior art. Compared with the scheduling result, the parallel processing of multiple filtering schedulers solves the problem of long processing time and low efficiency of scheduling tasks in the prior art, and improves the resource scheduling capability and resource allocation efficiency of the scheduling system.
在一种可能的实现方式中,所述通过异步通信方式通知所述调度系统中的每个过滤式调度器包括:第一过滤式调度器将所述调度任务消息存储在消息队列,以使得所述每 个过滤式调度器监听所述消息队列,并获取所述调度任务消息。In a possible implementation manner, the notifying, by the asynchronous communication manner, each filtering scheduler in the scheduling system includes: the first filtering scheduler storing the scheduling task message in a message queue, so that Every A filter scheduler listens to the message queue and acquires the scheduled task message.
值得说明的是,当消息队列中调度请求消息被任意一个过滤式调度器取走后,为避免重复处理导致资源浪费问题,消息队列软件会将该调度请求消息在消息队列中删除,其他过滤式调度器无法再次获取该调度请求消息。而调度任务在本次调度请求的处理过程中一直存在,直至第一过滤器处理完成调度任务后再通知消息队列软件删除该调度任务消息,以便于存储集群中所有过滤式调度器能够通过异步的方式获取该调度任务。存储集群中的过滤式调度器获取该调度任务后可以确定每个过滤式调度器所对应虚拟群组中最适合执行该调度任务中业务需求的服务器。It is worth noting that after the scheduling request message in the message queue is removed by any filter scheduler, the message queue software deletes the scheduling request message in the message queue to avoid waste of resources caused by repeated processing. The scheduler cannot obtain the scheduling request message again. The scheduling task persists during the processing of the scheduling request until the first filter processes the scheduling task, and then notifies the message queue software to delete the scheduling task message, so that all the filtering schedulers in the storage cluster can be asynchronous. The way to get the scheduled task. After obtaining the scheduling task, the filtering scheduler in the storage cluster can determine the server in the virtual group corresponding to each filtering scheduler that is most suitable for performing the business requirements in the scheduling task.
可选地,该调度任务消息也可以存储在数据库中,第一过滤式调度器获取调度请求消息的方式也可以通过监听数据库的方式,即当数据库中存在待处理的调度请求消息时,从数据库中获取该调度请求消息。Optionally, the scheduling task message may also be stored in the database, and the manner in which the first filtering scheduler obtains the scheduling request message may also be performed by listening to the database, that is, when there is a scheduling request message to be processed in the database, the slave database Obtain the scheduling request message.
在另一种可能的实现方式中,所述通过异步通信方式通知所述调度系统中的每个过滤式调度器包括:第一过滤式调度器将所述调度任务消息存储在数据库中,以使得所述每个过滤式调度器监听所述数据库,并获取所述调度任务消息。In another possible implementation manner, the notifying, by the asynchronous communication manner, each filtering scheduler in the scheduling system includes: the first filtering scheduler storing the scheduling task message in a database, so that Each of the filter schedulers listens to the database and acquires the scheduled task message.
在另一种可能的实现方式中,所述过滤式调度器根据所述业务需求在与所述过滤式调度器关联的虚拟群组中确定调度结果,包括:所述过滤式调度器获得所述调度任务消息;所述过滤式调度器根据所述业务需求在所述过滤式调度器关联的虚拟群组中确定满足所述业务需求的服务器;所述过滤式调度器根据预定义权值算法对确定出的服务器进行排序,并按照顺序依次选择一个或多个作为所述调度结果。In another possible implementation manner, the filtering scheduler determines, according to the service requirement, a scheduling result in a virtual group associated with the filtered scheduler, including: the filtering scheduler obtaining the Scheduling a task message; the filter scheduler determines, in the virtual group associated with the filter scheduler, a server that satisfies the service requirement according to the service requirement; and the filter scheduler performs a pair of predefined weight algorithm The determined servers are sorted, and one or more are sequentially selected in order as the scheduling result.
在另一种可能的实现方式中,所述预置条件包括:In another possible implementation manner, the preset conditions include:
所述第一过滤式调度器获取所述调度结果的数量满足第一阈值;或Obtaining, by the first filter scheduler, the number of the scheduling results meets a first threshold; or
所述第一过滤式调度器获取所述调度结果的数量满足第一阈值且接收时间满足第二阈值。The first filter scheduler obtains that the number of the scheduling results meets a first threshold and the receiving time satisfies a second threshold.
本领域技术人员应理解的是,每个过滤式调度器每次只能处理一个调度任务消息,当调度系统中同时存在多个调度任务消息需要处理时,对于同一个过滤式调度器,若当前调度任务请求消息长时间未处理完成,则该过滤式调度器无法获取和处理新的调度任务消息,为避免前一个调度任务处理过程过长对当前调度任务的影响,第一过滤式调度器在确定最终调度结果时,可以设置第一阈值,当汇总的调度结果的数量满足第一阈值时,即在所获取的调度结果中选择一个或多个服务器为最终调度结果。It should be understood by those skilled in the art that each filter scheduler can only process one scheduled task message at a time. When multiple scheduling task messages need to be processed simultaneously in the scheduling system, for the same filter scheduler, if current If the scheduled task request message is not processed for a long time, the filtered scheduler cannot acquire and process a new scheduled task message. To avoid the influence of the previous scheduling task processing process on the current scheduling task, the first filtering scheduler is When the final scheduling result is determined, the first threshold may be set. When the number of the summarized scheduling results meets the first threshold, one or more servers are selected as the final scheduling result in the obtained scheduling result.
在另一种可能的实现方式中,所述第一过滤式调度器按照预置算法在所述调度结果中确定最终调度结果的方法包括以下方式中的任意一种:In another possible implementation manner, the method for determining, by the first filtering scheduler, the final scheduling result in the scheduling result according to a preset algorithm includes any one of the following manners:
所述第一过滤式调度器按照所述预定义权值算法确定的权值对所述调度结果中所有服务器进行排序,依次选择一个或多个服务器为所述最终调度结果;或The first filter scheduler sorts all servers in the scheduling result according to the weight determined by the predefined weight algorithm, and sequentially selects one or more servers as the final scheduling result; or
所述第一过滤式调度器按照接收时间顺序依次从所述调度结果中选择一个或多个服务器为所述最终调度结果;或The first filter scheduler sequentially selects one or more servers from the scheduling result in the order of receiving time as the final scheduling result; or
所述第一过滤式调度器随机从所述调度结果中选择一个或多个服务器为所述最终调度结果;The first filter scheduler randomly selects one or more servers from the scheduling result as the final scheduling result;
其中,所述预定义权值算法可以根据服务器的CPU剩余量、内存剩余量、磁盘剩余量、网络流量、CPU类型、磁盘类型、网卡类型、磁盘每秒进行读写的次数中的至少 一种定义不同权重,并计算获得每个服务器的权值。The predefined weight algorithm may be based on at least a CPU, a remaining amount of memory, a remaining amount of the disk, a network traffic, a CPU type, a disk type, a network card type, and a number of times the disk reads and writes per second. One defines different weights and calculates the weight of each server.
值得说明的是,第一过滤式调度器在确定最终调度结果后,会通知消息队列软件删除已处理的调度任务消息。同时,第一过滤式调度器还会将该最佳调度结果发送给任务分配节点,任务分配节点会将调度任务中的业务需求发送给最终调度结果所对应的服务器,由该服务器执行业务需求的具体实施过程。It is worth noting that after determining the final scheduling result, the first filtering scheduler notifies the message queue software to delete the processed scheduling task message. At the same time, the first filter scheduler also sends the optimal scheduling result to the task assignment node, and the task assignment node sends the service requirement in the scheduling task to the server corresponding to the final scheduling result, and the server performs the business requirement. The specific implementation process.
综上所述,对于一个调度请求消息,调度系统中各个过滤式调度器分工协作,分别在各自关联的虚拟群组中确定调度结果,由一个过滤式调度器汇总过滤式调度器根据调度任务消息所确定的调度结果,并在上述调度结果中共确定一个或多个服务器为最终调度结果,与现有技术相比,对于同一个调度请求消息,由多个过滤式调度器并行处理,减少了调度处理时间,提升了调度系统的处理效率。另一方面,每个过滤式调度器利用资源预占信息记录其确定的调度结果所需资源信息,解决了现有技术中数据库中记录服务器资源占用情况无法实时更新所导致的调度失败问题,从而提高了调度器集群管理大型数据中新资源的能力。In summary, for a scheduling request message, each filtering scheduler in the scheduling system divides and cooperates, and respectively determines scheduling results in respective associated virtual groups, and a filtering scheduler summarizes the filtering scheduler according to the scheduling task message. Determining the scheduling result, and determining one or more servers as the final scheduling result in the foregoing scheduling result, compared with the prior art, the same scheduling request message is processed by multiple filtering schedulers in parallel, reducing scheduling Processing time improves the processing efficiency of the scheduling system. On the other hand, each filter scheduler uses resource preemption information to record the resource information required for the determined scheduling result, thereby solving the scheduling failure problem caused by the fact that the record server resource occupancy cannot be updated in real time in the database in the prior art, thereby Improved the ability of the scheduler cluster to manage new resources in large data.
第二方面,提供一种资源调度的装置,所述装置包括用于执行第一方面或第一方面任一种可能实现方式中的资源调度方法的各个模块。In a second aspect, an apparatus for resource scheduling is provided, the apparatus comprising various modules for performing the resource scheduling method of the first aspect or any of the possible implementations of the first aspect.
第三方面,提供一种资源调度的方法,该方法应用于调度系统中,该调度系统中包括至少两个过滤式调度器和至少两个服务器,其中,每个过滤式调度器关联一个虚拟群组,每个虚拟群组中包括与该虚拟群组关联的过滤式调度器所能调度的所有服务器,且一个服务器只属于一个虚拟群组;首先,第一过滤式调度器获取调度请求消息,其中,该调度请求消息中携带业务需求,第一过滤式调度器为调度系统中任一过滤式调度器;然后,第一过滤式调度器将调度请求消息转换为调度任务消息,并将该调度任务消息发送给调度系统中除第一过滤式调度器之外的其他服务器,该调度任务消息中携带业务需求和第一过滤式调度器的角色信息,该调度任务消息用于指示调度系统中除第一过滤式调度器之外的其他过滤式调度器根据业务需求在与其他过滤式调度器关联的虚拟群组中确定调度结果,并将调度结果发送给所述第一过滤式调度器;接下来,第一过滤式调度器获取调度系统中的过滤式调度器根据调度任务消息确定的调度结果;当满足预置条件时,第一过滤式调度器按照预置算法在获取到的调度结果中确定最终调度结果,最终调度结果中包括满足业务需求的一个或多个服务器。In a third aspect, a method for resource scheduling is provided, where the method is applied to a scheduling system, where the scheduling system includes at least two filter schedulers and at least two servers, wherein each filter scheduler is associated with one virtual group a group, each virtual group includes all servers that can be scheduled by the filter scheduler associated with the virtual group, and one server belongs to only one virtual group; first, the first filter scheduler obtains a scheduling request message, The scheduling request message carries a service requirement, and the first filtering scheduler is any filtering scheduler in the scheduling system; then, the first filtering scheduler converts the scheduling request message into a scheduling task message, and the scheduling is performed. The task message is sent to the server in the scheduling system except the first filter scheduler, where the scheduling task message carries the service requirement and the role information of the first filter scheduler, and the schedule task message is used to indicate the scheduling system. Other filter schedulers other than the first filter scheduler are associated with other filter schedulers based on business requirements. Determining a scheduling result in the quasi-group, and transmitting the scheduling result to the first filtering scheduler; next, the first filtering scheduler acquires a scheduling result determined by the filtering scheduler in the scheduling system according to the scheduling task message; When the preset condition is met, the first filter scheduler determines the final scheduling result in the acquired scheduling result according to the preset algorithm, and the final scheduling result includes one or more servers that meet the service requirement.
通过上述内容的描述,第一过滤式和调度系统中的其他过滤式调度器直接通信,对于同一个调度请求消息,有调度系统中各个过滤式调度器分工协作,并由获取调度请求消息的过滤式调度器确定确定最终调度结果,减少了处理时长,提升了调度请求消息的处理效率。Through the description of the foregoing content, the first filtering type and other filtering schedulers in the scheduling system directly communicate. For the same scheduling request message, each filtering scheduler in the scheduling system divides and cooperates, and the filtering of the scheduling request message is obtained. The scheduler determines the final scheduling result, reduces the processing time, and improves the processing efficiency of the scheduling request message.
在一种可能的实现方式中,所述预置条件包括:In a possible implementation manner, the preset conditions include:
所述第一过滤式调度器获取所述调度结果的数量满足第一阈值;或Obtaining, by the first filter scheduler, the number of the scheduling results meets a first threshold; or
所述第一过滤式调度器获取所述调度结果的数量满足第一阈值且接收时间满足第二阈值。The first filter scheduler obtains that the number of the scheduling results meets a first threshold and the receiving time satisfies a second threshold.
在另一种可能的实现方式中,所述第一过滤式调度器按照预置算法在所述获取到的调度结果中确定最终调度结果的方法包括以下方式中的任意一种:In another possible implementation manner, the method for determining, by the first filtering scheduler, the final scheduling result in the acquired scheduling result according to a preset algorithm includes any one of the following manners:
所述第一过滤式调度器按照所述预定义权值算法确定的权值对所述调度结果中所 有服务器进行排序,依次选择一个或多个服务器为所述最终调度结果;或The weight of the first filter scheduler determined according to the predefined weight algorithm is used in the scheduling result There are servers to sort, and one or more servers are selected in turn for the final scheduling result; or
所述第一过滤式调度器按照接收时间顺序依次从所述调度结果中选择一个或多个服务器为所述最终调度结果;或The first filter scheduler sequentially selects one or more servers from the scheduling result in the order of receiving time as the final scheduling result; or
所述第一过滤式调度器随机从所述调度结果中选择一个或多个服务器为所述最终调度结果;The first filter scheduler randomly selects one or more servers from the scheduling result as the final scheduling result;
其中,所述预定义权值算法可以根据服务器的CPU剩余量、内存剩余量、磁盘剩余量、网络流量、CPU类型、磁盘类型、网卡类型、磁盘每秒进行读写的次数中的至少一种定义不同权重,并计算获得服务器的权值。The predefined weight algorithm may be based on at least one of a CPU remaining amount of the server, a remaining memory amount, a remaining amount of the disk, a network traffic, a CPU type, a disk type, a network card type, and a number of times the disk reads and writes per second. Define different weights and calculate the weight of the obtained server.
通过上述内容的描述,对于一个调度请求消息,调度系统中各个过滤式调度器分工协作,分别在各自关联的虚拟群组中确定调度结果,由一个过滤式调度器汇总所有调度结果并确定最终调度结果,与现有技术相比,对于同一个调度请求消息,由多个过滤式调度器并行处理,减少了调度处理时间,提升了调度系统的处理效率。另一方面,每个过滤式调度器利用资源预占信息记录其确定的调度结果所需资源信息,解决了现有技术中数据库中记录服务器资源占用情况无法实时更新所导致的调度失败问题,从而提高了调度器集群管理大型数据中新资源的能力。Through the description of the foregoing content, for a scheduling request message, each filtering scheduler in the scheduling system divides and cooperates, determines scheduling results in respective associated virtual groups, and summarizes all scheduling results by a filtering scheduler and determines final scheduling. As a result, compared with the prior art, for the same scheduling request message, multiple filtering schedulers are processed in parallel, which reduces the scheduling processing time and improves the processing efficiency of the scheduling system. On the other hand, each filter scheduler uses resource preemption information to record the resource information required for the determined scheduling result, thereby solving the scheduling failure problem caused by the fact that the record server resource occupancy cannot be updated in real time in the database in the prior art, thereby Improved the ability of the scheduler cluster to manage new resources in large data.
第四方面,提供一种过滤式调度器,所述过滤式调度器包括处理器、存储器、通信接口、总线,所述处理器、存储器和通信接口之间通过总线连接并完成相互间通信,所述存储器用于存储计算机执行指令,所述过滤式调度器运行时,所述处理器执行所述存储器中的计算机执行指令以利用所述过滤式调度器中的硬件资源执行第一方面及第一方面中任一种可能实现方式中所述的方法。In a fourth aspect, a filter scheduler is provided, where the filter scheduler includes a processor, a memory, a communication interface, and a bus, and the processor, the memory, and the communication interface are connected by a bus and complete communication with each other. The memory is configured to store computer execution instructions, and when the filter scheduler is running, the processor executes a computer execution instruction in the memory to perform the first aspect and the first with hardware resources in the filter scheduler Any of the aspects described in the possible implementations.
第五方面,提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第一方面及第一方面中任一种可能实现方式中的方法的指令。A fifth aspect, a computer readable medium for storing a computer program, the computer program comprising instructions for performing the method of the first aspect and the possible implementation of any of the first aspects.
综上所述,对于一个调度请求,调度器集群中各个过滤式调度器分工协作,分别在各自对应的虚拟群组中确定调度结果,并由获取该调度请求的过滤式调度器在所获取到的调度结果中确定一个或多个服务器为最终调度结果,避免了现有技术中多个过滤式调度器并行工作导致资源竞争问题。另一方面,每个过滤式调度器利用资源预占信息记录其确定的调度结果所需资源信息,解决了现有技术中数据库中记录服务器资源占用情况无法实时更新所导致的调度失败问题,提升了调度器集群资源分配的消息,从而提高了调度器集群管理大型数据中新资源的能力。In summary, for a scheduling request, each of the filter schedulers in the scheduler cluster cooperates and determines the scheduling result in each corresponding virtual group, and is obtained by the filter scheduler that obtains the scheduling request. The scheduling result determines that one or more servers are final scheduling results, which avoids resource competition problems caused by multiple filtering schedulers working in parallel in the prior art. On the other hand, each filter scheduler uses the resource camping information to record the resource information required for the determined scheduling result, and solves the problem of scheduling failure caused by the inability of the record server resource occupancy in the database in the prior art to be updated in real time. The dispatcher cluster resource allocation message improves the ability of the scheduler cluster to manage new resources in large data.
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,显而易见地,下面所描述的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings to be used in the embodiments of the present invention will be briefly described below. It is obvious that the drawings described below are only some embodiments of the present invention, Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图1为本发明实施例提供的一种调度系统的示意图;FIG. 1 is a schematic diagram of a scheduling system according to an embodiment of the present invention;
图2为本发明实施例提供的一种资源调度的方法的流程示意图;2 is a schematic flowchart of a method for resource scheduling according to an embodiment of the present invention;
图3为本发明实施例提供的另一种资源调度的方法的流程示意图;FIG. 3 is a schematic flowchart diagram of another method for resource scheduling according to an embodiment of the present disclosure;
图4为本发明实施例提供的另一种资源调度的方法的流程示意图; FIG. 4 is a schematic flowchart diagram of another method for resource scheduling according to an embodiment of the present disclosure;
图5为本发明实施例提供的另一种资源调度的方法的流程示意图;FIG. 5 is a schematic flowchart diagram of another method for resource scheduling according to an embodiment of the present disclosure;
图6为本发明实施例提供的一种资源调度的装置的示意图;FIG. 6 is a schematic diagram of an apparatus for resource scheduling according to an embodiment of the present invention;
图7为本发明实施例提供的一种过滤式调度器的示意图。FIG. 7 is a schematic diagram of a filter scheduler according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都应属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of the present invention.
图1为本发明提供的一种调度系统的示意图,如图所示,该调度系统中包括管理节点、任务分配节点、过滤式调度器、服务器和数据库,其中,两个或两个以上过滤式调度器组成调度器集群。1 is a schematic diagram of a scheduling system provided by the present invention. As shown in the figure, the scheduling system includes a management node, a task allocation node, a filter scheduler, a server, and a database, wherein two or more filters are used. The scheduler forms a scheduler cluster.
管理节点可以预先为调度系统中每个过滤式调度器创建一个虚拟群组,虚拟群组中包括该过滤式调度器所能调度的所有服务器,即虚拟群组中包括一个或多个服务器,且一个服务器仅归属于一个虚拟群组。The management node may pre-create a virtual group for each filter scheduler in the scheduling system, and the virtual group includes all servers that the filter scheduler can schedule, that is, the virtual group includes one or more servers, and A server belongs to only one virtual group.
示例地,如图1所示调度系统,调度系统中存在3个过滤式调度器,管理节点预先为每个过滤式调度器创建1个虚拟群组,包括:For example, as shown in FIG. 1 , there are three filter schedulers in the scheduling system. The management node creates one virtual group for each filter scheduler in advance, including:
虚拟群组1为过滤式调度器1关联的虚拟群组,该虚拟群组中包括服务器1和服务器2。The virtual group 1 is a virtual group associated with the filter scheduler 1, and the virtual group includes the server 1 and the server 2.
虚拟群组2为过滤式调度器2关联的虚拟群组,该虚拟群组中包括服务器3和服务器4。The virtual group 2 is a virtual group associated with the filter scheduler 2, which includes the server 3 and the server 4.
虚拟群组3为过滤式调度器3关联的虚拟群组,该虚拟群组中包括服务器5和服务器6。The virtual group 3 is a virtual group associated with the filter scheduler 3, which includes the server 5 and the server 6.
过滤式调度器、虚拟群组和服务器的对应关系可以利用如图1中所示的数据库记录。该数据库还用于记录每个服务器的已用资源信息和可用资源信息,例如,服务器的CPU、内存、磁盘、网卡等资源的已使用情况和可用情况。在过滤式调度器处理调度请求时,过滤式调度器可以通过数据库查询其关联的虚拟群组和该虚拟群组中每个服务器的可用资源信息。The correspondence between the filter scheduler, the virtual group, and the server can utilize database records as shown in FIG. The database is also used to record the used resource information and available resource information of each server, for example, the usage and availability of the server's CPU, memory, disk, network card and other resources. When the filtered scheduler processes the scheduling request, the filtered scheduler can query its associated virtual group and the available resource information of each server in the virtual group through the database.
可选地,过滤式调度器也可以利用指定文件记录过滤式调度器、虚拟群组和服务器之间的对应关系。Optionally, the filter scheduler may also record the correspondence between the filter scheduler, the virtual group, and the server by using a specified file.
作为一个可能的实施例,管理节点在创建虚拟群组时,可以按照服务器的标识(Identification,ID)、操作系统类型、硬盘类型等属性将其划分到不同的虚拟群组中。As a possible embodiment, when creating a virtual group, the management node may divide the server into different virtual groups according to attributes such as an identification (ID), an operating system type, and a hard disk type.
值得说明的是,每个虚拟群组中服务器的个数可以相同,也可以不同。在本发明的以下具体描述中,以调度器集群中包括三个过滤式调度器,每个过滤式调度器所对应的虚拟群组中包括两个服务器为例进行详细阐述。It is worth noting that the number of servers in each virtual group can be the same or different. In the following detailed description of the present invention, three types of filter schedulers are included in the scheduler cluster, and two virtual servers in the virtual group corresponding to each filter scheduler are exemplified in detail.
可选地,当虚拟群组中存在故障服务器或调度系统中存在新增服务器时,管理节点可以按照预定义调整策略,调整每个虚拟群组中服务器的数量。例如,若虚拟群组1中存在故障服务器,则管理节点可以按照过滤式调度器的优先级顺序,调整每个虚 拟群组中服务器的数量;若调度系统中新增一台过滤式调度器,管理节点可以按照每个过滤式调度器的处理能力,将该服务器添加到一个过滤式调度器关联的虚拟群组中。Optionally, when there is a faulty server in the virtual group or a new server exists in the scheduling system, the management node may adjust the number of servers in each virtual group according to a predefined adjustment policy. For example, if there is a faulty server in the virtual group 1, the management node can adjust each virtual according to the priority order of the filter scheduler. The number of servers in the quasi-group; if a new filter scheduler is added to the scheduling system, the management node can add the server to a virtual group associated with the filter scheduler according to the processing capability of each filter scheduler. in.
可选地,虚拟群组也可以由任务分配节点管理,即由任务分配节点为每个过滤式调度器创建虚拟群组,并动态调整虚拟群组中服务器的数量。Alternatively, the virtual group may also be managed by the task assignment node, that is, the task assignment node creates a virtual group for each filter scheduler and dynamically adjusts the number of servers in the virtual group.
值得说明的是,图1中管理节点和任务分配节点可以部署在同一个服务器中,也可以分开部署在不同的服务器中,本发明不作限制。在本发明的以下描述中,以图1所示管理节点和过滤式调度器部署在同一个服务器为例进行详细描述。It should be noted that the management node and the task allocation node in FIG. 1 may be deployed in the same server, or may be deployed in different servers separately, which is not limited by the present invention. In the following description of the present invention, the management node and the filter scheduler shown in FIG. 1 are deployed in the same server as an example for detailed description.
可选地,虚拟群组也可以由调度系统外能够获知所有过滤式调度器和服务器信息的第三方管理设备或装置管理。Alternatively, the virtual group may also be managed by a third party management device or device outside the scheduling system that is capable of learning all of the filtered scheduler and server information.
在调度系统中,任务分配节点还用于接收调度请求消息,并将携带业务需求的调度请求消息存放在消息队列(Message Queue,MQ)中,调度系统中每个过滤式调度器均通过监听的方式,监听消息队列中是否存在待处理的调度请求消息,当监听到存在待处理的调度请求消息时,则获取该调度请求消息,并进行处理确定最终调度结果,然后将该最终调度结果发送给任务分配节点,由任务分配节点将该业务需求发送给最终调度结果所对应的一个或多个服务器执行。In the scheduling system, the task allocation node is further configured to receive the scheduling request message, and store the scheduling request message carrying the service requirement in a message queue (Message Queue, MQ), where each filtering scheduler in the scheduling system is monitored. In the mode, if there is a scheduling request message to be processed in the message queue, if the scheduling request message is to be processed, the scheduling request message is obtained, and the final scheduling result is determined, and then the final scheduling result is sent to the message. The task assignment node is sent by the task assignment node to the one or more servers corresponding to the final scheduling result.
消息队列是在消息的传输过程中保存消息的容器,如图1所示调度系统中,服务器100用于部署消息队列软件,消息队列软件可以利用服务器100的存储器保存和删除任务分配节点和过滤式调度器之间传递的消息,及所有过滤式调度器之间传递的消息,其中,服务器100中包括至少一个消息队列,每个消息队列可以根据初始配置保存不同类型的消息,例如,存储系统中存在两个消息队列,消息队列1用于保存任务分配节点和调度集群之间传递的消息,如调度请求消息和最终调度结果,消息队列2用于保存过滤式调度器之间传递的消息,如调度任务消息和每个过滤式调度器确定的调度结果。可选地,消息队列软件也可以采用消息队列集群形式保存消息,每个消息队列集群中包括至少两个消息队列,不同消息队列集群用于存储不同类型的消息,例如,存储系统中存在两个消息队列集群,消息队列集群1用于保存任务分配节点和调度器集群之间传递的消息,如消息队列集群1中一个消息队列用于保存调度请求消息,另一个消息队列用于保存最终调度结果;消息队列集群2用于保存过滤式调度器之间传递的消息,如消息队列集群2中一个消息队列用于保存调度任务消息,另一个消息队列用于保存每个过滤式调度器确定的调度结果。The message queue is a container for saving messages during the transmission of the message. In the scheduling system shown in FIG. 1, the server 100 is used to deploy the message queue software, and the message queue software can use the memory of the server 100 to save and delete the task allocation node and the filtering method. Messages passed between the schedulers, and messages transmitted between all filter schedulers, wherein the server 100 includes at least one message queue, and each message queue can store different types of messages according to an initial configuration, for example, in a storage system. There are two message queues. Message queue 1 is used to save messages transmitted between the task assignment node and the scheduling cluster, such as scheduling request messages and final scheduling results. Message queue 2 is used to save messages transmitted between the filter schedulers, such as The task message is scheduled and the scheduling result determined by each filter scheduler. Optionally, the message queue software may also save the message in the form of a message queue cluster. Each message queue cluster includes at least two message queues, and different message queue clusters are used to store different types of messages. For example, there are two in the storage system. Message queue cluster, message queue cluster 1 is used to save messages transmitted between the task assignment node and the scheduler cluster. For example, one message queue in message queue cluster 1 is used to save the scheduling request message, and another message queue is used to save the final scheduling result. Message queue cluster 2 is used to save messages transmitted between the filter schedulers. For example, one message queue in message queue cluster 2 is used to save scheduling task messages, and another message queue is used to save the schedule determined by each filter scheduler. result.
值得说明的是,在具体实施过程中,消息队列可以利用单独服务器部署,也可以利用多台服务器同时部署该软件,还可以与其他类型的软件共享服务器资源。在本发明的以下描述中,以图1所示由单独服务器部署消息队列的场景为例进行进一步详细阐述。It is worth noting that during the implementation process, the message queue can be deployed by a separate server, or multiple servers can be deployed simultaneously, and server resources can be shared with other types of software. In the following description of the present invention, a scenario in which a message queue is deployed by a separate server as shown in FIG. 1 is taken as an example for further elaboration.
可选地,上述调度系统中任务分配节点和过滤式调度器之间,及所有过滤式调度器之间通信方式也可以利用数据库等其他异步通信方式实现,例如Red i s数据库。Optionally, the communication mode between the task allocation node and the filtering scheduler in the scheduling system and all the filtering schedulers may also be implemented by using other asynchronous communication methods such as a database, such as a Red is database.
接下来,结合图2进一步介绍本发明实施例提供的一种资源调度方法,如图所示,所述方法包括:Next, a resource scheduling method provided by an embodiment of the present invention is further introduced in conjunction with FIG. 2, as shown in the figure, the method includes:
S201、第一过滤式调度器获取调度请求消息。S201. The first filter scheduler acquires a scheduling request message.
其中,调度请求消息中携带业务需求,第一过滤式调度器为调度系统中任一过滤式 调度器。第一过滤式调度器获取调度请求消息的方式可以为通过监听消息队列的方式,即当消息队列中存在待处理的调度请求消息时,从消息队中获取该调度请求消息。The scheduling request message carries the service requirement, and the first filtering scheduler is any filtering type in the scheduling system. scheduler. The manner in which the first filter scheduler obtains the scheduling request message may be a manner of listening to the message queue, that is, when there is a scheduling request message to be processed in the message queue, the scheduling request message is obtained from the message team.
可选地,该调度任务消息也可以存储在数据库中,第一过滤式调度器获取调度请求消息的方式也可以通过监听数据库的方式,即当数据库中存在待处理的调度请求消息时,从数据库中获取该调度请求消息。Optionally, the scheduling task message may also be stored in the database, and the manner in which the first filtering scheduler obtains the scheduling request message may also be performed by listening to the database, that is, when there is a scheduling request message to be processed in the database, the slave database Obtain the scheduling request message.
可选地,任务分配节点还可以直接向第一过滤式调度器发送该调度请求消息。Optionally, the task assignment node may also send the scheduling request message directly to the first filtered scheduler.
S202、第一过滤式调度器将调度请求消息转换为调度任务消息,并通过异步通信方式通知调度系统中每个过滤式调度器。S202. The first filtering scheduler converts the scheduling request message into a scheduling task message, and notifies each filtering scheduler in the scheduling system by asynchronous communication.
具体地,调度任务消息中携带业务需求和第一过滤式调度器的角色信息,任务调度消息用于指示调度系统中每个过滤式调度器根据业务需求在关联的虚拟群组中确定调度结果,并将调度结果汇总给第一过滤式调度器,该调度结果中包括满足业务需求的一个或多个服务器。Specifically, the scheduling task message carries the service requirement and the role information of the first filtering scheduler, and the task scheduling message is used to indicate that each filtering scheduler in the scheduling system determines the scheduling result in the associated virtual group according to the service requirement. The scheduling result is summarized into a first filtered scheduler, and the scheduling result includes one or more servers that meet the business requirements.
第一过滤式调度器在调度系统中通知每个过滤式调度器存在待处理的调度任务消息,可以将该调度任务消息存储在消息队列中,调度系统中每个过滤式调度器在监听到消息队列中存在待处理的调度任务消息时,获取该调度任务消息。The first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and the scheduling task message may be stored in the message queue, and each filtering scheduler in the scheduling system is listening to the message. When there is a scheduled task message to be processed in the queue, the scheduling task message is obtained.
可选地,第一过滤式调度器在调度系统中通知每个过滤式调度器存在待处理的调度任务消息,也可以将调度任务消息存储在用作异步通信的数据库中,如Red i s数据库,所有过滤式调度器通过定期监听该数据库的方式获取该调度任务消息。Optionally, the first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and may also store the scheduling task message in a database used for asynchronous communication, such as a Red is database. All filter schedulers obtain the scheduled task message by periodically listening to the database.
可选地,第一过滤式调度器在调度系统中通知每个过滤式调度器存在待处理的调度任务消息,还可以从数据库中获取调度系统中所有过滤式调度器的IP地址,根据IP地址将调度任务消息发送给除第一过滤式调度器外的所有过滤式调度器。Optionally, the first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and may also obtain an IP address of all filtering schedulers in the scheduling system from the database, according to the IP address. The scheduled task message is sent to all filter schedulers except the first filter scheduler.
S203、第一过滤式调度器获取调度系统中的过滤式调度器根据调度任务消息所确定的调度结果。S203. The first filter scheduler acquires a scheduling result determined by the filter scheduler in the scheduling system according to the scheduling task message.
具体地,调度系统中的过滤式调度器在确定调度结果后,根据调度任务消息中的角色信息确定第一过滤式调度器用于接收调度结果的消息队列,并将调度结果存储该消息队列中,第一过滤式调度器监听该消息队列,当该消息队列中存在新增调度结果时,获取该调度结果。Specifically, after determining the scheduling result, the filtering scheduler in the scheduling system determines, according to the role information in the scheduling task message, a message queue used by the first filtering scheduler to receive the scheduling result, and stores the scheduling result in the message queue. The first filter scheduler listens to the message queue, and obtains the scheduling result when there is a new scheduling result in the message queue.
S204、当满足预置条件时,第一过滤式调度器按照预置算法在所获取到的调度结果中确定最终调度结果。S204. When the preset condition is met, the first filter scheduler determines a final scheduling result in the acquired scheduling result according to a preset algorithm.
具体地,满足预置条件包括第一过滤式调度器获取调度结果的数量满足第一阈值;或第一过滤式调度器获取调度结果的数量满足第一阈值且接收时间满足第二阈值。第一过滤式调度器所确定的最终调度结果中包括满足业务需求的一个或多个服务器。Specifically, satisfying the preset condition includes that the quantity of the first filter scheduler acquiring the scheduling result satisfies the first threshold; or the number of the first filter scheduler acquiring the scheduling result satisfies the first threshold and the receiving time meets the second threshold. The final scheduling result determined by the first filter scheduler includes one or more servers that meet the business requirements.
在本实施例中,调度器系统中每个过滤式调度器均会根据同一个调度请求在各自能够调度的服务器集合中确定调度结果,并将该调度结果发送给获取调度请求消息的过滤式调度器,在满足预置条件时,由该过滤式调度器在所获取到的所有调度结果中确定一个或多个服务器为最终调度结果,与现有技术中仅有一个过滤式调度器确定调度结果相比,多个过滤式调度器并行处理解决了现有技术中调度任务处理时间长、效率低的问题,提升了调度系统的资源调度能力和资源分配效率。 In this embodiment, each of the filter schedulers in the scheduler system determines the scheduling result in the respective set of servers that can be scheduled according to the same scheduling request, and sends the scheduling result to the filtering schedule for acquiring the scheduling request message. When the preset condition is met, the filter scheduler determines one or more servers as the final scheduling result among all the acquired scheduling results, and only one filter scheduler determines the scheduling result in the prior art. In contrast, the parallel processing of multiple filter schedulers solves the problem of long processing time and low efficiency of scheduling tasks in the prior art, and improves resource scheduling capability and resource allocation efficiency of the scheduling system.
下面,以任务分配节点、过滤式调度器之间的通信方式为消息队列为例,结合图3详细介绍本发明实施例提供的一种资源调度方法,如图所示,所述方法包括:The following is a description of the resource scheduling method provided by the embodiment of the present invention. The method includes:
S301、第一过滤式调度器在消息队列中获取调度请求消息。S301. The first filtered scheduler obtains a scheduling request message in a message queue.
其中,任务分配节点在接收应用层发送的调度请求消息后,将该调度请求消息存放在消息队列中,第一过滤式调度器获取到该调度请求消息,其中,第一过滤式调度器为调度系统中获取该调度请求消息的任一过滤式调度器。该调度请求消息中携带的业务需求,该业务需求包括创建虚拟机的信息、虚拟机迁移信息、虚拟机资源调度等业务需求信息。After receiving the scheduling request message sent by the application layer, the task allocation node stores the scheduling request message in the message queue, and the first filtering scheduler obtains the scheduling request message, where the first filtering scheduler is a scheduling Any filter scheduler that obtains the scheduling request message in the system. The service requirement carried in the scheduling request message, the service requirement includes information about creating a virtual machine, virtual machine migration information, and virtual machine resource scheduling.
表1为一种调度请求消息的消息格式的示例:Table 1 shows an example of a message format for a scheduling request message:
表1Table 1
Figure PCTCN2017106553-appb-000001
Figure PCTCN2017106553-appb-000001
具体地,调度系统中每个过滤式调度器通过监听方式识别消息队列中是否存在待处理的调度请求消息,当消息队列中存在待处理的调度请求消息时,空闲状态的过滤式调度器均会到消息队列中获取该调度请求,此时,第一个获取该调度请求消息的过滤式调度器负责处理该调度请求。Specifically, each filtering scheduler in the scheduling system identifies, by means of the interception manner, whether there is a scheduling request message to be processed in the message queue. When there is a scheduling request message to be processed in the message queue, the idle scheduling filter scheduler will The scheduling request is obtained from the message queue. At this time, the first filtering scheduler that obtains the scheduling request message is responsible for processing the scheduling request.
值得说明的是,当消息队列中调度请求消息被任意一个过滤式调度器取走后,为避免重复处理导致资源浪费问题,消息队列软件会将该调度请求消息在消息队列中删除,其他过滤式调度器无法再次获取该调度请求消息。It is worth noting that after the scheduling request message in the message queue is removed by any filter scheduler, the message queue software deletes the scheduling request message in the message queue to avoid waste of resources caused by repeated processing. The scheduler cannot obtain the scheduling request message again.
S302、第一过滤式调度器将该调度请求消息转化为调度任务消息,并将该调度任务消息存放在消息队列中。S302. The first filter scheduler converts the scheduling request message into a scheduling task message, and stores the scheduling task message in a message queue.
具体地,第一过滤式调度器在调度请求消息中添加第一过滤式调度器的角色信息。调度任务消息用于指示调度集群中过滤式调度器在确定调度结果,并将确定的调度结果发送给第一过滤式调度器。该调度任务消息中还携带业务需求,即步骤S301中调度请求消息中携带的业务需求。Specifically, the first filtered scheduler adds the role information of the first filtered scheduler in the scheduling request message. The scheduling task message is used to indicate that the filtering scheduler in the scheduling cluster determines the scheduling result, and sends the determined scheduling result to the first filtering scheduler. The scheduling task message also carries the service requirement, that is, the service requirement carried in the scheduling request message in step S301.
可选地,调度任务消息中还可以包括第一过滤式调度器的标识信息和IP地址信息。Optionally, the scheduling task message may further include identifier information and IP address information of the first filter scheduler.
表2为第一过滤式调度器将表1中调度请求消息转化为调度任务消息的消息格式的一种示例:Table 2 is an example of a message format in which the first filter scheduler converts the scheduling request message in Table 1 into a scheduling task message:
表2Table 2
Figure PCTCN2017106553-appb-000002
Figure PCTCN2017106553-appb-000002
由上述表1和表2可知,调度请求消息转化为调度任务消息的过程中,在消息格 式中添加了第一过滤式调度器的标识和角色信息,及第一过滤式调度器的IP地址。表1和表2中调度请求消息和调度请求任务消息中所包含的消息格式仅为一种示例,在具体实施过程中,还可以包括其他内容的消息格式。It can be seen from Table 1 and Table 2 above that the scheduling request message is converted into a scheduling task message in the message grid. The identifier and role information of the first filter scheduler and the IP address of the first filter scheduler are added. The message format included in the scheduling request message and the scheduling request task message in Table 1 and Table 2 is only an example. In a specific implementation process, a message format of other content may also be included.
可选地,在调度任务消息处理过程中,获取调度请求消息的第一过滤式调度器可以利用指定文件或数据库中的数据表记录本次调度任务消息中每个过滤式调度器的角色信息,示例地,过滤式调度器的角色可以包括Leader和Worker两种,其中,Worker角色的过滤式调度器负责在其所能调度的至少一个服务器的集合中,经过筛选和排序后在其关联的虚拟群组中确定满足业务需求的一个或多个服务器为调度结果;Leader角色的过滤式调度器为获取调度请求消息的过滤式调度器,负责将调度请求消息转化为调度任务消息,通知调度系统中所有过滤式调度器存在待处理的调度任务消息,汇总所有Worker角色的过滤式调度器所确定的调度结果,并按照预置算法在所有汇总的调度结果中选择满足业务需求的一个或多个服务为为最终调度结果。Optionally, in the scheduling task message processing process, the first filtering scheduler that obtains the scheduling request message may record the role information of each filtering scheduler in the current scheduling task message by using the data table in the specified file or the database. For example, the role of the filter scheduler may include both Leader and Worker, wherein the filter scheduler of the Worker role is responsible for filtering the associated virtual in the set of at least one server that it can schedule. The group determines one or more servers that meet the service requirements as the scheduling result; the filter scheduler of the Leader role is a filter scheduler that obtains the scheduling request message, and is responsible for converting the scheduling request message into a scheduling task message, and notifying the scheduling system. All the filter schedulers have scheduling task messages to be processed, summarize the scheduling results determined by the filter scheduler of all the worker roles, and select one or more services satisfying the service requirements among all the summarized scheduling results according to the preset algorithm. For the final scheduling results.
示例地,如图1所示调度系统中,若过滤式调度器1获取调度请求消息,则过滤式调度器1记录本次调度请求消息处理过程中的角色信息,过滤式调度器1为本次调度请求消息的Leader,过滤式调度器2和过滤式调度器3均为Worker角色,可选地,过滤式调度器1还可以具有Worker角色,则过滤式调度器1、过滤式调度器2和过滤式调度器3分别负责在其关联的虚拟群组中确定调度结果,并将所确定的调度结果发送给过滤式调度器1,由过滤式调度器1负责获取过滤式调度器根据调度任务消息确定的调度结果,并确定一个或多个服务器为最终调度结果。For example, in the scheduling system shown in FIG. 1, if the filtering scheduler 1 acquires the scheduling request message, the filtering scheduler 1 records the role information in the processing of the current scheduling request message, and the filtering scheduler 1 is this. The leader of the scheduling request message, the filter scheduler 2 and the filter scheduler 3 are all Worker roles. Alternatively, the filter scheduler 1 may also have a Worker role, then the filter scheduler 1, the filter scheduler 2, and The filter scheduler 3 is responsible for determining the scheduling result in its associated virtual group, and transmitting the determined scheduling result to the filter scheduler 1, and the filter scheduler 1 is responsible for obtaining the filter scheduler according to the scheduled task message. Determine the scheduling results and determine one or more servers as the final scheduling results.
值得说明的是,该角色信息为临时信息,即只在本次调度请求消息的处理过程中生效。当系统中同时存在多个调度请求消息时,不同过滤式调度器获取调度任务消息后,每个调度请求消息会由一个Leader角色的过滤式调度器负责确定最终调度结果,且每种类型的角色每次只能处理一种消息,即Leader角色的过滤式调度器每次只能处理一个调度请求消息,Worker角色的过滤式调度器每次只能处理一个调度任务消息。在调度请求消息处理结束之后,过滤式调度器即释放当前调度请求消息处理过程中所对应的角色信息。It is worth noting that the role information is temporary information, that is, it is only valid during the processing of the current scheduling request message. When multiple scheduling request messages exist in the system, after different filtering schedulers obtain scheduling task messages, each scheduling request message is determined by a leader role of the filtering scheduler to determine the final scheduling result, and each type of role Only one message can be processed at a time, that is, the filter role of the Leader role can only process one scheduling request message at a time, and the filter scheduler of the Worker role can only process one scheduling task message at a time. After the scheduling request message processing ends, the filtering scheduler releases the role information corresponding to the current scheduling request message processing.
进一步地,第一过滤式调度器将调度任务消息存储在消息队列中,以便于调度系统中的过滤式调度器可以监听该消息队列,从该消息队列中获取该调度任务消息并进行处理。Further, the first filtering scheduler stores the scheduling task message in the message queue, so that the filtering scheduler in the scheduling system can listen to the message queue, obtain the scheduling task message from the message queue, and process the message.
具体地,调度任务消息可以保存在步骤S301中用于存放调度请求消息的消息队列中,则调度系统中所有过滤式调度器在监听该消息队列过程中,通过识别调度请求消息标识和调度任务消息标识区分不同调度请求消息和调度任务消息;可选地,也可以利用一个单独的消息队列保存调度请求消息,调度系统中所有过滤式调度器通过监听指定消息队列识别是否存在待处理的调度任务消息。Specifically, the scheduling task message may be saved in the message queue for storing the scheduling request message in step S301, and all the filtering schedulers in the scheduling system identify the scheduling request message and the scheduling task message during the process of listening to the message queue. The identifier distinguishes between different scheduling request messages and scheduling task messages; optionally, the scheduling request message may also be saved by using a separate message queue, and all filtering schedulers in the scheduling system identify whether there are scheduled scheduling task messages by listening to the specified message queue. .
值得说明的是,与步骤S301中调度请求消息被第一过滤式调度器获取后即被删除的方式不同,步骤S302中调度任务存放到消息队列后,调度任务在本次调度请求的处理过程中一直存在,直至第一过滤器处理完成调度任务后再通知消息队列软件删除该调度任务消息,以便于存储集群中所有过滤式调度器能够通过异步的方式获取该调度任务。存储集群中的过滤式调度器获取该调度任务后可以确定每个过滤式调度器所对 应虚拟群组中最适合执行该调度任务中业务需求的服务器。It is to be noted that, in a manner that the scheduling request message is deleted after being acquired by the first filtering scheduler in step S301, the scheduling task is stored in the message queue in step S302, and the scheduling task is in the processing process of the current scheduling request. It persists until the first filter processes the scheduled task, and then notifies the message queue software to delete the scheduled task message, so that all the filtered schedulers in the storage cluster can acquire the scheduled task in an asynchronous manner. After the filtering scheduler in the storage cluster obtains the scheduling task, it can determine that each filtering scheduler is correct. The server in the virtual group that is best suited to perform the business needs in the scheduled task.
可选地,第一过滤式调度器在将调度请求消息转化调度任务消息后,也可以将该调度任务消息保存在用于异步通信的数据库中,每个过滤式调度器通过周期性监听数据库方式识别并获取待处理的调度任务消息。Optionally, after the scheduling request message is converted into the scheduling task message, the first filtering scheduler may also save the scheduling task message in a database for asynchronous communication, and each filtering scheduler periodically listens to the database manner. Identify and obtain the scheduled task message to be processed.
可选地,第一过滤式调度器在将调度请求转化为调度任务消息后,也可以从数据库中获取调度系统中所有过滤式调度器的IP地址,并根据IP地址直接向每个过滤式调度器发送该调度任务消息。Optionally, after converting the scheduling request into the scheduling task message, the first filtering scheduler may also obtain the IP addresses of all the filtering schedulers in the scheduling system from the database, and directly report to each filtering according to the IP address. The dispatcher sends the scheduled task message.
S303、第一过滤式调度器在消息队列中获取该调度任务消息,并将确定的调度结果保存在消息队列中。S303. The first filter scheduler obtains the scheduling task message in a message queue, and saves the determined scheduling result in a message queue.
当消息队列中存在待处理调度任务消息时,调度系统中每个空闲状态的过滤式调度器都会通过监听的方式获取该调度请求消息并处理。当第一过滤式调度器监听到存在待处理的调度任务消息,且此时第一过滤式调度器为空闲状态时,第一过滤式调度器获取该调度任务消息,并在其关联的虚拟群组中选择一个或多个满足业务需求的服务器作为调度结果。When there is a scheduled scheduling task message in the message queue, the filtering scheduler of each idle state in the scheduling system acquires the scheduling request message and processes it by means of interception. When the first filter scheduler detects that there is a scheduled task message to be processed, and the first filter scheduler is in an idle state, the first filter scheduler obtains the schedule task message and is associated with the virtual group. Select one or more servers in the group that meet the business requirements as the scheduling result.
值得说明的是,每个过滤式调度器每次只能处理一个调度任务消息,即每个过滤式调度器只有在当前调度任务消息处理完成后,才会到消息队列中获取和处理新的调度任务消息。It is worth noting that each filter scheduler can only process one scheduled task message at a time, that is, each filter scheduler will acquire and process a new schedule in the message queue only after the current scheduled task message is processed. Task message.
具体地,调度系统中每个过滤式调度器确定调度结果的方法均相同,图4为过滤式调度器确定调度结果的过程的方法流程图,如图所示,具体方法包括:Specifically, the method for determining the scheduling result is the same for each filtering scheduler in the scheduling system. FIG. 4 is a flowchart of a method for determining a scheduling result by the filtering scheduler. As shown in the figure, the specific method includes:
S303a、过滤式调度器根据业务需求在过滤式调度器关联的虚拟群组中确定满足业务需求的服务器。S303a. The filter scheduler determines, according to the service requirement, a server that meets the service requirement in the virtual group associated with the filter scheduler.
其中,满足业务需求的服务器是过滤式调度器根据业务需求和该过滤式调度器关联的虚拟群组中服务器的剩余可用资源情况所确定的,即为在该过滤式调度器关联的虚拟群组中确定满足该业务需求的一个或多个服务器。The server that meets the service requirement is determined by the filter scheduler according to the service requirement and the remaining available resources of the server in the virtual group associated with the filter scheduler, that is, the virtual group associated with the filter scheduler. Identify one or more servers that meet the business needs.
S303b、过滤式调度器根据预定义权值算法计算对确定出的服务器进行排序,并按照顺序依次选择一个或多个服务器作为所述调度结果。S303b: The filter scheduler calculates the sorted servers according to the predefined weight algorithm calculation, and sequentially selects one or more servers as the scheduling result in sequence.
具体地,每个过滤式调度器按照预定义权值算法计算满足业务需求的服务器的权值,并针对权值对服务器进行排序,依次选择顺序从高到低或从低到高的一个或多个服务器作为所确定的调度结果。其中,预定义权值算法可以根据具体业务应用的定制化需求,对服务器的CPU资源、内存资源、磁盘剩余量、磁盘每秒进行读写的次数、网络带宽等属性中的至少一种定义不同的权重,并计算服务器的权值。Specifically, each filter scheduler calculates a weight of a server that satisfies a business requirement according to a predefined weight algorithm, and sorts the server for the weight, and sequentially selects one or more of a sequence from high to low or low to high. The servers serve as the determined scheduling results. The predefined weight algorithm may define at least one of a server resource, a memory resource, a disk remaining amount, a disk read/write times per second, and a network bandwidth according to a customized requirement of a specific service application. The weights are calculated and the weight of the server is calculated.
可选地,调度结果中还包括服务器的权值信息。Optionally, the scheduling result further includes weight information of the server.
示例地,若过滤式调度器1所能调度的服务器包括服务器1和服务器2,调度请求消息中携带的业务需求为创建1台2个CPU、8G内存、32G磁盘、1个网卡的虚拟机,经筛选确定服务器1和服务器2均满足创建虚拟机的规格要求,则满足业务需求的服务器包括两个服务器;假设业务应用对服务器的磁盘和内存的剩余量有定制化要求,则在预定义权值算法中按照服务器的可用内存权重为0.6、可用磁盘权重为0.4进行计算。具体地,若服务器1可用内存资源为10G,可用磁盘为100G;服务器2可用内存资源为20G,可用磁盘为100G,则服务器1的权值为46(0.6×10+0.4×100=46), 服务器2的权值为50(0.5×20+0.4×100=50),则满足业务需求的服务器的权值排序从高到低依次为服务器2、服务器1,过滤式调度器1确定服务器1为该调度请求消息在其所能调度的服务器集合中的调度结果,可选地,该调度结果中还包括服务器2的权值信息50。For example, if the server that can be scheduled by the filter scheduler 1 includes the server 1 and the server 2, the service requirement carried in the scheduling request message is to create a virtual machine with 2 CPUs, 8 GB memory, 32 G disks, and 1 network card. After screening, it is determined that both server 1 and server 2 meet the specification requirements for creating a virtual machine, and the server that satisfies the business requirement includes two servers; if the business application has customization requirements for the remaining amount of the disk and memory of the server, the predefined right In the value algorithm, the available memory weight of the server is 0.6, and the available disk weight is 0.4. Specifically, if the available memory resource of the server 1 is 10G, the available disk is 100G, the available memory resource of the server 2 is 20G, and the available disk is 100G, and the weight of the server 1 is 46 (0.6×10+0.4×100=46). The weight of the server 2 is 50 (0.5×20+0.4×100=50), and the weights of the servers satisfying the service requirement are the server 2 and the server 1 in descending order, and the filter scheduler 1 determines that the server 1 is The scheduling result of the scheduling request message in the server set that it can schedule. Optionally, the scheduling result further includes the weight information 50 of the server 2.
表3为上述实施例中一种调度结果的消息格式的示例:Table 3 is an example of a message format of a scheduling result in the above embodiment:
表3table 3
Figure PCTCN2017106553-appb-000003
Figure PCTCN2017106553-appb-000003
通过步骤S303a至S303b的描述,调度系统中每个过滤式调度器在其所能调度的服务器中按照先筛选再排序的方式,选择满足业务需求的至少一个服务器作为调度结果。Through the description of steps S303a to S303b, each filter scheduler in the scheduling system selects at least one server that satisfies the service requirement as the scheduling result in the manner in which the server can be scheduled according to the first screening and reordering.
进一步地,调度系统中过滤式调度器在确定调度结果之后,会根据调度任务中角色信息将确定的调度结果发送给指定过滤式调度器,如发送给步骤S301中的第一过滤式调度器。其中,过滤式调度器向第一过滤式调度发送调度结果的方式可以为以下方式中的任意一种:Further, after the scheduling result is determined, the filtering scheduler sends the determined scheduling result to the specified filtering scheduler according to the role information in the scheduling task, for example, to the first filtering scheduler in step S301. The manner in which the filtering scheduler sends the scheduling result to the first filtering schedule may be any one of the following modes:
方式一:过滤式调度器根据调度任务消息中的角色信息将所确定的调度结果存储在消息队列中。Manner 1: The filter scheduler stores the determined scheduling result in the message queue according to the role information in the scheduling task message.
其中,存储过滤式调度器所确定的调度结果的消息队列,可以与步骤S301中保存调度请求消息的消息队列相同,此时,第一过滤式调度器通过指定消息格式区分调度请求消息、调度任务消息和调度结果,其中,确定调度结果的指定消息格式可以为表3中的“调度结果”。也可以根据调度任务消息中角色信息将调度结果直接发送给第一过滤式调度器用于接收调度结果的消息队列中。The message queue for storing the scheduling result determined by the filter scheduler may be the same as the message queue for saving the scheduling request message in step S301. At this time, the first filter scheduler distinguishes the scheduling request message and the scheduling task by specifying the message format. The message and the scheduling result, wherein the specified message format for determining the scheduling result may be the "scheduling result" in Table 3. The scheduling result may also be directly sent to the message queue of the first filtering scheduler for receiving the scheduling result according to the role information in the scheduling task message.
方式二、根据调度任务消息中第一过滤式调度器的IP地址,向第一过滤式调度器发送所确定的调度结果。Manner 2: Send the determined scheduling result to the first filtering scheduler according to the IP address of the first filtering scheduler in the scheduling task message.
应理解的是,对于第一过滤式调度器而言,若在本次任务中同时具有Leader和Worker角色,在第一过滤式调度器作为本次调度任务消息的Leader角色时,第一过滤式调度器可能为非空闲状态,且在消息队列中本次调度任务消息可能不是最先需要处理的调度任务消息,为简化具体实施过程,第一过滤式会将转化后的调度任务消息直接保存在消息队列中,当第一过滤式调度器为空闲状态时,重新获取该调度任务消息进行处理,并将调度结果存放在用于保存调度结果的消息队列中或保存在本地存储器中。可选地,第一过滤式调度器在同时具有一个调度任务消息的Leader和Worker角色时,也可以将调度任务消息存储在本地存储器中,当第一过滤式调度器为空闲状 态时,通过调度任务消息标识区分不同调度任务消息,优先对本地保存的调度任务消息进行处理。It should be understood that, for the first filter scheduler, if there is a Leader role and a Worker role in the current task, when the first filter scheduler is used as the Leader role of the scheduled task message, the first filter type The scheduler may be in a non-idle state, and the scheduled task message may not be the first scheduled task message to be processed in the message queue. To simplify the implementation process, the first filter will save the converted schedule task message directly. In the message queue, when the first filter scheduler is in an idle state, the scheduled task message is re-acquired for processing, and the scheduling result is stored in a message queue for saving the scheduling result or stored in the local storage. Optionally, when the first filter scheduler has a Leader role and a Worker role for scheduling task messages, the scheduled task message may also be stored in the local storage, when the first filter scheduler is idle. In the state, the scheduling task message identifier distinguishes different scheduling task messages, and the locally saved scheduling task message is preferentially processed.
S304、调度系统中其他过滤式调度器在消息队列中获取调度任务消息,并将确定的调度结果存储在消息队列中。S304. The other filter scheduler in the scheduling system acquires a scheduling task message in the message queue, and stores the determined scheduling result in the message queue.
具体地,其他过滤式调度器为调度器集群中除第一过滤式调度器之外的任一空闲状态的过滤式调度器,在消息队列中存在待处理的调度任务消息时,其他过滤式调度器也会获取该调度任务消息,并按照调度任务消息中所携带的业务需求在其关联的虚拟群组中选择满足业务需求的至少一个服务器作为调度结果。其他过滤式调度器确定调度结果的过程与步骤S303中所述方法相同,在此不再赘述。Specifically, the other filter scheduler is a filter scheduler of any idle state except the first filter scheduler in the scheduler cluster, and other filter schedules exist when there are scheduled task tasks to be processed in the message queue. The device also obtains the scheduling task message, and selects at least one server that meets the service requirement in the associated virtual group as the scheduling result according to the service requirement carried in the scheduling task message. The process of determining the scheduling result by the other filtering scheduler is the same as that described in step S303, and details are not described herein again.
S305、第一过滤式调度器获取调度器系统中每个过滤式调度器所确定的调度结果。S305. The first filter scheduler obtains a scheduling result determined by each filter scheduler in the scheduler system.
具体地,第一过滤式调度器获取调度结果的方式如步骤S303过滤式调度器发送调度结果的方式,可以是第一过滤式调度器从消息队列中获取调度结果,也可以是接收过滤式调度器发送的调度结果。Specifically, the manner in which the first filtering scheduler obtains the scheduling result is the manner in which the filtering scheduler sends the scheduling result in step S303, and the first filtering scheduler may obtain the scheduling result from the message queue, or may receive the filtering scheduling. The scheduling result sent by the device.
S306、当满足预置条件时,第一过滤式调度器按照预置算法在所获取到的调度结果中确定最终调度结果,该最终调度结果中满足业务需求的一个或多个服务器。S306. When the preset condition is met, the first filter scheduler determines, in the acquired scheduling result, a final scheduling result according to the preset algorithm, where one or more servers satisfying the service requirement are included in the final scheduling result.
其中,预置条件可以是以下方式的任意一种:The preset condition may be any one of the following methods:
方式一:第一过滤式调度器汇总调度结果的数量满足第一阈值。Manner 1: The first filter scheduler summarizes the number of scheduling results to meet the first threshold.
方式二:第一过滤式调度器接收调度结果的数量满足第一阈值且接收时间满足第二阈值。Manner 2: The first filter scheduler receives the number of scheduling results that meet the first threshold and the receiving time meets the second threshold.
本领域技术人员应理解的是,每个过滤式调度器每次只能处理一个调度任务消息,当调度系统中同时存在多个调度任务消息需要处理时,对于同一个过滤式调度器,若当前调度任务请求消息长时间未处理完成,则该过滤式调度器无法获取和处理新的调度任务消息,为避免前一个调度任务处理过程过长对当前调度任务的影响,第一过滤式调度器在确定最终调度结果时,可以设置第一阈值,当汇总的调度结果的数量满足第一阈值时,即在所获取的调度结果中选择一个或多个服务器为最终调度结果。It should be understood by those skilled in the art that each filter scheduler can only process one scheduled task message at a time. When multiple scheduling task messages need to be processed simultaneously in the scheduling system, for the same filter scheduler, if current If the scheduled task request message is not processed for a long time, the filtered scheduler cannot acquire and process a new scheduled task message. To avoid the influence of the previous scheduling task processing process on the current scheduling task, the first filtering scheduler is When the final scheduling result is determined, the first threshold may be set. When the number of the summarized scheduling results meets the first threshold, one or more servers are selected as the final scheduling result in the obtained scheduling result.
可选地,第一过滤式调度器在确定最终调度结果时,除限制汇总的调度结果的数量之外,还可以同时限制接收时间,当二者均满足要求时,即在汇总的调度结果中选择一个最终调度结果。Optionally, when determining the final scheduling result, the first filtering scheduler may limit the receiving time in addition to the number of the scheduled scheduling results, when both meet the requirements, that is, in the summarized scheduling result. Choose a final scheduling result.
可选地,在具体实施过程中,第一过滤式调度器还可以在接收调度系统中所有过滤式调度器发送的调度结果后再选择最终调度结果,即在调度系统中所有服务器中选择一个或多个满足业务需求的服务器作为最终调度结果,此最终调度结果为满足业务需求的最优的一个或多个服务器。Optionally, in a specific implementation process, the first filter scheduler may further select a final scheduling result after receiving the scheduling result sent by all the filtering schedulers in the scheduling system, that is, selecting one of all servers in the scheduling system or A plurality of servers satisfying the business requirements are used as the final scheduling result, and the final scheduling result is one or more servers that satisfy the optimal business requirements.
进一步地,第一过滤式调度器按照预置算法在所述调度结果中确定最终调度结果的处理方式包括以下方式中的任意一种:Further, the processing manner that the first filtering scheduler determines the final scheduling result in the scheduling result according to the preset algorithm includes any one of the following manners:
方式一:第一过滤式调度器按照预定义权值算法确定的权值,对所获取的调度结果中所有服务器进行排序,依次选择满足业务需求的一个或多个服务器为所述最终调度结果。Manner 1: The first filter scheduler sorts all the servers in the obtained scheduling result according to the weight determined by the predefined weight algorithm, and sequentially selects one or more servers that meet the service requirements as the final scheduling result.
示例地,表4为第一过滤式调度器汇总的调度结果的一种示例,假设业务需求为创建1台虚拟机,第一过滤式调度器根据预定义权值算法确定的权值对所有服务器进 行排序由高到低依次为服务器3、服务器5、服务器1,则最终调度结果为服务器3,即服务器3为最佳的满足业务需求的服务器。For example, Table 4 is an example of the scheduling result summarized by the first filter scheduler. It is assumed that the service requirement is to create one virtual machine, and the first filter scheduler determines the weight according to the predefined weight algorithm to all servers. Enter The row sorting from high to low is server 3, server 5, and server 1. The final scheduling result is server 3, that is, server 3 is the best server that satisfies the business requirements.
表4Table 4
调度结果Scheduling result 服务器信息server information 权值信息Weight information
调度结果1Scheduling result 1 服务器1Server 1 4646
调度结果2Scheduling result 2 服务器3Server 3 6060
调度结果3Scheduling result 3 服务器5Server 5 5555
其中,预定义权值算法可以与步骤S303b中确定权值的方法相同,也可以根据具体应用需求重新定义服务器资源的权重并计算服务器的权值,服务器资源包括CPU类型、磁盘类型、网卡类型、可用CPU资源、可用内存资源、磁盘剩余量、网络带宽、磁盘每秒进行读写的次数、CPU剩余量、内存剩余量、磁盘剩余量等,则最终调度结果为满足业务需求的最优的一个或多个服务器。The predefined weight algorithm may be the same as the method for determining the weight in step S303b, or the weight of the server resource may be redefined according to the specific application requirement, and the server weight is calculated. The server resource includes a CPU type, a disk type, a network card type, and Available CPU resources, available memory resources, disk remaining amount, network bandwidth, disk read/write times per second, CPU remaining amount, memory remaining amount, disk remaining amount, etc., the final scheduling result is the optimal one to meet the business requirements. Or multiple servers.
可选地,预定义权值算法中也可以按照业务应用不关注资源信息确定服务器资源的权重,并计算每个服务器的权值信息,此时,第一过滤式调度器可以依次选择顺序从低到高的满足业务需求的一个或多个服务器为所述最终调度结果。Optionally, the predefined weight algorithm may also determine the weight of the server resource according to the service application not paying attention to the resource information, and calculate the weight information of each server. At this time, the first filter scheduler may sequentially select the sequence from low. One or more servers that meet high business needs are the final scheduling results.
方式二:第一过滤式调度器按照接收时间顺序依次在接收的每个过滤式调度器所确定的调度结果中,选择一个或多个服务器为最终调度结果。Manner 2: The first filter scheduler selects one or more servers as the final scheduling result in the received scheduling result determined by each filter scheduler in sequence.
方式三:第一过滤式调度器随机从所述调度结果中选择一个或多个个服务器为最终调度结果。Manner 3: The first filter scheduler randomly selects one or more servers from the scheduling result as a final scheduling result.
除采用方式一外,为提高处理效率,减少调度系统处理时长,也可以按照方式二和方式三,即第一过滤式调度器按照接收时间顺序或随机的方式确定最终调度结果,该最终调度结果中包括满足业务需求的至少一个服务器。In addition to mode 1, in order to improve the processing efficiency and reduce the processing time of the scheduling system, the second scheduling method may be determined according to the second filtering mode, that is, the first filtering scheduler determines the final scheduling result according to the receiving time sequence or a random manner, and the final scheduling result is obtained. It includes at least one server that meets business needs.
值得说明的是,第一过滤式调度器在确定最终调度结果后,会通知消息队列软件删除已处理的调度任务消息。同时,第一过滤式调度器还会将该最佳调度结果发送给任务分配节点,任务分配节点会将调度任务中的业务需求发送给最终调度结果所对应的服务器,由该服务器执行业务需求的具体实施过程。It is worth noting that after determining the final scheduling result, the first filtering scheduler notifies the message queue software to delete the processed scheduling task message. At the same time, the first filter scheduler also sends the optimal scheduling result to the task assignment node, and the task assignment node sends the service requirement in the scheduling task to the server corresponding to the final scheduling result, and the server performs the business requirement. The specific implementation process.
通过步骤S301至步骤S306的描述,当调度系统中存在待处理的调度请求消息时,会由一个过滤式调度器获取该调度请求消息,将该调度请求消息转化为调度任务消息,并将该调度请求消息存放在消息队列中,调度器系统中每个过滤式调度器均会处理该调度任务消息,并将确定的调度结果汇总给该过滤式调度器,由该过滤式调度器按照预置算法在汇总的调度结果中确定满足业务需求的最优的一个或多个服务器为最终调度结果。与现有技术相比,对于同一个调度请求消息,调度系统中各个过滤式调度器分工协作,并行处理,解决了现有技术中调度处理时间长、效率低的问题,提高了整个调度系统的调度能力和资源调度效率。Through the description of step S301 to step S306, when there is a scheduling request message to be processed in the scheduling system, the scheduling request message is obtained by a filtering scheduler, the scheduling request message is converted into a scheduling task message, and the scheduling is performed. The request message is stored in the message queue, and each filter scheduler in the scheduler system processes the scheduled task message, and summarizes the determined scheduling result to the filter scheduler, and the filter scheduler follows the preset algorithm. The optimal one or more servers that meet the business requirements are determined in the aggregated scheduling result as the final scheduling result. Compared with the prior art, for the same scheduling request message, each filtering scheduler in the scheduling system divides and cooperates and performs parallel processing, which solves the problem that the scheduling processing time is long and the efficiency is low in the prior art, and the whole scheduling system is improved. Scheduling capability and resource scheduling efficiency.
在本发明的另一个可能的实施例中,每个过滤式调度器在确定其所对应的虚拟群组中的调度结果之后,也可以通过记录资源预占信息解决现有技术中数据中所记录的服务器的可用资源无法实时更新,导致过滤式调度器误判造成调度失败的问题,具体方法如图5所示,所述方法包括: In another possible embodiment of the present invention, each filter scheduler may also record the records recorded in the prior art by recording resource camp-on information after determining the scheduling result in the corresponding virtual group. The available resources of the server cannot be updated in real time, which causes the filter scheduler to misjudge the problem of scheduling failure. The specific method is as shown in FIG. 5, and the method includes:
S501、过滤式调度器在根据调度任务消息确定调度结果之后,记录资源预占信息。S501. The filter scheduler records resource camping information after determining the scheduling result according to the scheduling task message.
具体地,资源预占信息用于记录过滤式调度器所确定的调度结果。例如,若调度任务消息1中携带的业务需求为创建虚拟机,虚拟机的规格包括2个CPU、10G内存、2个20G磁盘,1个网卡,假设过滤式调度器确定在其关联的虚拟群组中服务器1作为调度结果,则该过滤式调度器会将以上调度任务消息、调度结果作为资源预占信息记录。Specifically, the resource camping information is used to record the scheduling result determined by the filter scheduler. For example, if the service requirement carried in the scheduling task message 1 is to create a virtual machine, the specifications of the virtual machine include 2 CPUs, 10 Gbytes of memory, 2 20 G disks, and 1 network card, assuming that the filter scheduler determines the virtual group associated with it. If the server 1 in the group is used as the scheduling result, the filtering scheduler records the above scheduling task message and the scheduling result as resource camping information.
表5为一种资源预占信息的示例:Table 5 shows an example of resource preemption information:
Figure PCTCN2017106553-appb-000004
Figure PCTCN2017106553-appb-000004
可选地,过滤式调度器可以利用指定文件记录资源预占信息,也可以利用数据库记录资源预占信息。Optionally, the filter scheduler may record resource preemption information by using a specified file, or may use a database to record resource camp-on information.
值得说明的是,第一过滤式调度器所记录的资源预占信息为过滤式调度器所记录的一种信息标识,并未真正在第一调度结果所对应的服务器中划分物理资源。It is to be noted that the resource pre-emption information recorded by the first filter scheduler is an information identifier recorded by the filter scheduler, and the physical resources are not actually divided in the server corresponding to the first scheduling result.
可选地,在记录资源预占信息且未最终确定调度结果时,若再次执行新的调度任务消息,过滤式调度器在处理过程中,针对资源预占信息中所涉及的服务器,该过滤式调度器可以先在数据库中获取该服务器的可用资源信息,再减去该过滤式调度器所记录的资源预占信息,确定该服务器的剩余资源信息,再根据该服务器的剩余资源情况判断该服务器是否能够执行新的调度任务消息中的业务需求。Optionally, when the resource preemption information is recorded and the scheduling result is not finally determined, if the new scheduling task message is executed again, the filtering scheduler processes the filtering method for the server involved in the resource camping information during the processing. The scheduler may first obtain the available resource information of the server in the database, subtract the resource preemption information recorded by the filter scheduler, determine the remaining resource information of the server, and determine the server according to the remaining resources of the server. Whether it is possible to execute the business requirements in the new scheduled task message.
S502、当第一过滤式调度器确定最终调度结果时,第一过滤式调度器通知过滤式调度器最终调度结果,以使得过滤式调度器清除所记录的资源预占信息。S502. When the first filter scheduler determines the final scheduling result, the first filter scheduler notifies the filter scheduler of the final scheduling result, so that the filter scheduler clears the recorded resource camp-on information.
当第一过滤式调度器确定最终调度结果之后,会通知调度系统中所有过滤式调度器该最终调度结果,以便调度系统中过滤式调度器可以根据最终调度结果清除所记录的资源预占信息。其中,通知方式可以将最终调度结果存放在消息队列中,也可以在数据库中获取除第一过滤式调度器之外的所有调度器的IP地址,根据IP地址信息发送最终调度结果。After the first filter scheduler determines the final scheduling result, the final scheduling result is notified to all the filter schedulers in the scheduling system, so that the filtered scheduler in the scheduling system can clear the recorded resource camp-on information according to the final scheduling result. The notification mode may store the final scheduling result in the message queue, or obtain the IP addresses of all the schedulers except the first filter scheduler in the database, and send the final scheduling result according to the IP address information.
进一步地,清除资源预占信息的过程包括以下两种情况:Further, the process of clearing resource camp-on information includes the following two situations:
情况一:若最终调度结果中的服务器不属于过滤式调度器所关联的虚拟群组中,则该过滤式调度器直接清除其所记录的资源预占信息。Case 1: If the server in the final scheduling result does not belong to the virtual group associated with the filter scheduler, the filter scheduler directly clears the resource camp-on information recorded by the filter scheduler.
情况二:若最终调度结果中的服务器属于过滤式调度器所关联的虚拟群组中,则该过滤式调度器在最终调度结果中的服务器完成业务处理的之后,清除所记录的资源预占信息。Case 2: If the server in the final scheduling result belongs to the virtual group associated with the filter scheduler, the filter scheduler clears the recorded resource camp-on information after the server in the final scheduling result completes the service processing. .
值得说明的是,最终调度结果所对应的服务器完成业务需求后,服务器会通知调度系统中的数据库更新其资源占用情况,并通知该服务器所对应的过滤式调度器业务需求处理成功,该过滤式调度器据此清除所记录的资源预占信息。It is worth noting that after the server corresponding to the final scheduling result completes the service requirement, the server notifies the database in the scheduling system to update its resource occupancy, and notifies the server that the corresponding filter scheduler service requirement is successfully processed. The scheduler accordingly clears the recorded resource preemption information.
综上所述,对于一个调度请求消息,调度系统中各个过滤式调度器分工协作,分别在各自关联的虚拟群组中确定调度结果,由一个过滤式调度器汇总所有调度结果并 确定最终调度结果,与现有技术相比,对于同一个调度请求消息,由多个过滤式调度器并行处理,减少了调度处理时间,提升了调度系统的处理效率。另一方面,每个过滤式调度器利用资源预占信息记录其确定的调度结果所需资源信息,解决了现有技术中数据库中记录服务器资源占用情况无法实时更新所导致的调度失败问题,从而提高了调度器集群管理大型数据中新资源的能力。In summary, for a scheduling request message, each filtering scheduler in the scheduling system divides and cooperates, determines scheduling results in respective associated virtual groups, and summarizes all scheduling results by a filtering scheduler. The final scheduling result is determined. Compared with the prior art, the same scheduling request message is processed by multiple filtering schedulers in parallel, which reduces the scheduling processing time and improves the processing efficiency of the scheduling system. On the other hand, each filter scheduler uses resource preemption information to record the resource information required for the determined scheduling result, thereby solving the scheduling failure problem caused by the fact that the record server resource occupancy cannot be updated in real time in the database in the prior art, thereby Improved the ability of the scheduler cluster to manage new resources in large data.
值得说明的是,对于上述方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明所必须的。It should be noted that, for the above method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the present invention is not limited by the described action sequence, and secondly, Those skilled in the art should also appreciate that the embodiments described in the specification are all preferred embodiments and the actions involved are not necessarily required by the present invention.
本领域的技术人员根据以上描述的内容,能够想到的其他合理的步骤组合,也属于本发明的保护范围内。其次,本领域技术人员也应该熟悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明所必须的。Other reasonable combinations of steps that can be conceived by those skilled in the art in light of the above description are also within the scope of the present invention. Secondly, those skilled in the art should also be familiar with the embodiments described in the specification, which are all preferred embodiments, and the actions involved are not necessarily required by the present invention.
上文中结合图1至图5,详细描述了根据本发明实施例所提供的资源调度的方法和调度系统,下面将结合图6至图7,描述根据本发明实施例所提供的过滤式调度器。A method and a scheduling system for resource scheduling according to an embodiment of the present invention are described in detail above with reference to FIG. 1 to FIG. 5 . A filter scheduler according to an embodiment of the present invention will be described below with reference to FIG. 6 to FIG. 7 . .
图6为本发明实施例提供的一种资源调度的装置600,该装置600包括获取单元601、处理单元602、确定单元603;Figure 6 is a device 600 for resource scheduling according to an embodiment of the present invention. The device 600 includes an obtaining unit 601, a processing unit 602, and a determining unit 603.
所述获取单元,用于获取调度请求消息,所述调度请求消息中携带业务需求;The acquiring unit is configured to acquire a scheduling request message, where the scheduling request message carries a service requirement;
所述处理单元,用于将所述调度请求消息转换为调度任务消息,并通过异步通信方式通知所述调度系统中的每个过滤式调度器,其中,所述调度任务消息中携带所述业务需求和所述装置的角色信息,所述调度任务消息用于指示过滤式调度器根据所述业务需求在与所述过滤式调度器关联的虚拟群组中确定调度结果,并将所述调度结果发送给所述装置,所述调度结果包括满足所述业务需求的一个或多个服务器;The processing unit is configured to convert the scheduling request message into a scheduling task message, and notify each filtering scheduler in the scheduling system by using an asynchronous communication manner, where the scheduling task message carries the service a demand and a role information of the device, the scheduling task message is used to indicate that the filter scheduler determines a scheduling result in a virtual group associated with the filter scheduler according to the service requirement, and the scheduling result is Sent to the device, the scheduling result includes one or more servers that meet the service requirements;
所述获取单元,还用于获取所述调度系统中的过滤式调度器根据所述调度任务消息确定的调度结果;The obtaining unit is further configured to acquire a scheduling result that is determined by the filtering scheduler in the scheduling system according to the scheduling task message;
所述确定单元,用于当满足预置条件时,按照预置算法在所述获取到的调度结果中确定最终调度结果,所述最终调度结果中包括满足所述业务需求的一个或多个服务器。The determining unit is configured to determine, in the preset scheduling result, a final scheduling result according to a preset algorithm, where the final scheduling result includes one or more servers that meet the service requirement. .
应理解的是,本发明实施例的装置600可以通过专用集成电路(Application Specific Integrated Circuit,ASIC)实现,或可编程逻辑器件(Programmable Logic Device,PLD)实现,上述PLD可以是复杂程序逻辑器件(Complex Programmable Logic Device,CPLD),现场可编程门阵列(Field-Programmable Gate Array,FPGA),通用阵列逻辑(Generic Array Logic,GAL)或其任意组合。通过软件实现图2所示的资源调度的处理方法时,装置600及其各个模块也可以为软件模块。It should be understood that the apparatus 600 of the embodiment of the present invention may be implemented by an Application Specific Integrated Circuit (ASIC) or a Programmable Logic Device (PLD), and the PLD may be a complex program logic device ( Complex Programmable Logic Device (CPLD), Field-Programmable Gate Array (FPGA), Generic Array Logic (GAL), or any combination thereof. When the processing method of resource scheduling shown in FIG. 2 is implemented by software, the device 600 and each module thereof may also be software modules.
通过上述装置600的描述,调度器系统中每个过滤式调度器均会根据同一个调度请求在各自能够调度的服务器集合中确定调度结果,并将该调度结果发送给获取调度请求消息的过滤式调度器,在满足预置条件时,由该过滤式调度器在汇总的所有调度结果中选择一个最终调度结果,与现有技术中仅有一个过滤式调度器确定调度结果相比,多个过滤式调度器并行处理解决了现有技术中调度任务处理时间长、效率低的问 题,提升了调度系统的资源调度能力和资源分配效率。Through the description of the apparatus 600, each of the filter schedulers in the scheduler system determines the scheduling result in the respective set of servers that can be scheduled according to the same scheduling request, and sends the scheduling result to the filtering method of acquiring the scheduling request message. The scheduler selects a final scheduling result among all the scheduled scheduling results when the preset condition is met, and the plurality of filtering is compared with the prior art that only one filtering scheduler determines the scheduling result. Parallel processing of the scheduler solves the problem of long processing time and low efficiency of scheduling tasks in the prior art. The problem is to improve the resource scheduling capability and resource allocation efficiency of the scheduling system.
可选地,所述处理单元通过异步通信方式通知所述调度系统中的每个过滤式调度器包括:将所述调度任务消息存储在所述消息队列,以使得所述每个过滤式调度器监听所述消息队列,并获取所述调度任务消息。Optionally, the processing unit notifying, by asynchronous communication, each of the filtering schedulers in the scheduling system includes: storing the scheduling task message in the message queue, so that each of the filtering schedulers Listening to the message queue and obtaining the scheduling task message.
具体地,在调度系统中通知每个过滤式调度器存在待处理的调度任务消息,可以将该调度任务消息存储在消息队列中,调度系统中每个过滤式调度器在监听到消息队列中存在待处理的调度任务消息时,获取该调度任务消息。Specifically, in the scheduling system, each filtering scheduler is notified that there is a scheduling task message to be processed, and the scheduling task message may be stored in a message queue, where each filtering scheduler exists in the listening message queue. The scheduled task message is obtained when the task message is scheduled to be processed.
值得说明的是,当消息队列中调度请求消息被任意一个过滤式调度器取走后,为避免重复处理导致资源浪费问题,消息队列软件会将该调度请求消息在消息队列中删除,其他过滤式调度器无法再次获取该调度请求消息。而调度任务在本次调度请求的处理过程中一直存在,直至第一过滤器处理完成调度任务后再通知消息队列软件删除该调度任务消息,以便于存储集群中所有过滤式调度器能够通过异步的方式获取该调度任务。存储集群中的过滤式调度器获取该调度任务后可以确定每个过滤式调度器所对应虚拟群组中最适合执行该调度任务中业务需求的服务器。It is worth noting that after the scheduling request message in the message queue is removed by any filter scheduler, the message queue software deletes the scheduling request message in the message queue to avoid waste of resources caused by repeated processing. The scheduler cannot obtain the scheduling request message again. The scheduling task persists during the processing of the scheduling request until the first filter processes the scheduling task, and then notifies the message queue software to delete the scheduling task message, so that all the filtering schedulers in the storage cluster can be asynchronous. The way to get the scheduled task. After obtaining the scheduling task, the filtering scheduler in the storage cluster can determine the server in the virtual group corresponding to each filtering scheduler that is most suitable for performing the business requirements in the scheduling task.
可选地,第一过滤式调度器在调度系统中通知每个过滤式调度器存在待处理的调度任务消息,也可以将调度任务消息存储在用作异步通信的数据库中,如Red i s数据库,所有过滤式调度器通过定期监听该数据库的方式获取该调度任务消息。Optionally, the first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and may also store the scheduling task message in a database used for asynchronous communication, such as a Red is database. All filter schedulers obtain the scheduled task message by periodically listening to the database.
可选地,第一过滤式调度器在调度系统中通知每个过滤式调度器存在待处理的调度任务消息,还可以从数据库中获取调度系统中所有过滤式调度器的IP地址,根据IP地址将调度任务消息发送给除第一过滤式调度器外的所有过滤式调度器。Optionally, the first filtering scheduler notifies each filtering scheduler that there is a scheduling task message to be processed in the scheduling system, and may also obtain an IP address of all filtering schedulers in the scheduling system from the database, according to the IP address. The scheduled task message is sent to all filter schedulers except the first filter scheduler.
可选地,所述获取单元,还用于获得所述调度任务消息;Optionally, the acquiring unit is further configured to obtain the scheduling task message;
所述处理单元,还用于根据所述业务需求在所述过滤式调度器关联的虚拟群组中确定满足所述业务需求的服务器;根据预定义权值算法对确定出的服务器进行排序,并按照顺序依次选择一个或多个服务器作为所述调度结果。The processing unit is further configured to: determine, according to the service requirement, a server that meets the service requirement in a virtual group associated with the filter scheduler; sort the determined server according to a predefined weight algorithm, and One or more servers are sequentially selected in order as the scheduling result.
可选地,所述预置条件包括:所述第一过滤式调度器获取所述调度结果的数量满足第一阈值;或Optionally, the preset condition includes: the first filter scheduler acquires the number of the scheduling results to meet a first threshold; or
所述第一过滤式调度器获取所述调度结果的数量满足第一阈值且接收时间满足第二阈值。The first filter scheduler obtains that the number of the scheduling results meets a first threshold and the receiving time satisfies a second threshold.
可选地,所述确定单元按照预置算法在所述获取到的调度结果中确定最终调度结果包括以下方式中的任意一种:Optionally, the determining unit determines, according to the preset algorithm, the final scheduling result in the acquired scheduling result, including any one of the following manners:
按照所述预定义权值算法确定的权值对所述调度结果中所有服务器进行排序,依次选择一个或多个服务器为所述最终调度结果;或Sorting all servers in the scheduling result according to the weight determined by the predefined weight algorithm, and sequentially selecting one or more servers as the final scheduling result; or
按照接收时间顺序依次从所述调度结果中选择一个或多个服务器为所述最终调度结果;或Selecting one or more servers from the scheduling results in sequence according to the receiving time order as the final scheduling result; or
随机从所述调度结果中选择一个或多个服务器为所述最终调度结果;Randomly selecting one or more servers from the scheduling results as the final scheduling result;
其中,所述预定义权值算法可以根据服务器的CPU剩余量、内存剩余量、磁盘剩余量、网络流量、CPU类型、磁盘类型、网卡类型、磁盘每秒进行读写的次数中的至少一种定义不同权重,并计算获得每个服务器的权值。The predefined weight algorithm may be based on at least one of a CPU remaining amount of the server, a remaining memory amount, a remaining amount of the disk, a network traffic, a CPU type, a disk type, a network card type, and a number of times the disk reads and writes per second. Define different weights and calculate the weight of each server.
可选地,所述装置还包括记录单元;所述记录单元,用于在确定所述调度结果之后, 记录资源预占信息,所述资源预占信息用于标识所述过滤式调度器所确定的所述调度结果在对应的服务器中需要占用的资源信息;Optionally, the device further includes a recording unit, and the recording unit is configured to: after determining the scheduling result, Recording resource pre-occupation information, where the resource pre-occupation information is used to identify resource information that needs to be occupied by the filtering result determined by the filtering scheduler in a corresponding server;
所述处理单元,还用于在所述第一过滤式调度器确定所述最终调度结果之后,通知所述过滤式调度器所述最终调度结果。The processing unit is further configured to notify the filtered scheduler of the final scheduling result after the first filtered scheduler determines the final scheduling result.
综上所述,对于一个调度请求消息,调度系统中各个过滤式调度器分工协作,分别在各自关联的虚拟群组中确定调度结果,由一个过滤式调度器汇总所有调度结果并确定最终调度结果,与现有技术相比,对于同一个调度请求消息,由多个过滤式调度器并行处理,减少了调度处理时间,提升了调度系统的处理效率。另一方面,每个过滤式调度器利用资源预占信息记录其确定的调度结果所需资源信息,解决了现有技术中数据库中记录服务器资源占用情况无法实时更新所导致的调度失败问题,从而提高了调度器集群管理大型数据中新资源的能力。In summary, for a scheduling request message, each filtering scheduler in the scheduling system divides and cooperates, determines scheduling results in respective associated virtual groups, and summarizes all scheduling results by a filtering scheduler and determines final scheduling results. Compared with the prior art, for the same scheduling request message, multiple filtering schedulers are processed in parallel, which reduces the scheduling processing time and improves the processing efficiency of the scheduling system. On the other hand, each filter scheduler uses resource preemption information to record the resource information required for the determined scheduling result, thereby solving the scheduling failure problem caused by the fact that the record server resource occupancy cannot be updated in real time in the database in the prior art, thereby Improved the ability of the scheduler cluster to manage new resources in large data.
根据本发明实施例的装置600可对应于执行本发明实施例中描述的方法,并且装置600中的各个单元的上述和其它操作和/或功能分别为了实现图1至图5中的各个方法的相应流程,为了简洁,在此不再赘述。Apparatus 600 in accordance with an embodiment of the present invention may correspond to performing the methods described in the embodiments of the present invention, and the above and other operations and/or functions of the various units in apparatus 600 are respectively implemented to implement the various methods of FIGS. 1 through 5. The corresponding process, for the sake of brevity, will not be described here.
图7为本发明所提供的一种过滤式调度器700,如图7所示,所述过滤式调度器700包括处理器701、存储器702、通信接口703、总线704,所述处理器701、存储器702和通信接口703之间通过总线704连接并完成相互间通信,所述存储器702用于存储计算机执行指令,所述过滤式调度器700运行时,所述处理器701执行所述存储器702中的计算机执行指令以利用所述过滤式调度器700中的硬件资源执行以下操作:FIG. 7 is a filter scheduler 700 provided by the present invention. As shown in FIG. 7, the filter scheduler 700 includes a processor 701, a memory 702, a communication interface 703, and a bus 704. The processor 701, The memory 702 and the communication interface 703 are connected and communicate with each other via a bus 704 for storing computer execution instructions. When the filter scheduler 700 is in operation, the processor 701 executes the memory 702. The computer executes instructions to utilize the hardware resources in the filtered scheduler 700 to perform the following operations:
获取调度请求消息,所述调度请求消息中携带业务需求;Obtaining a scheduling request message, where the scheduling request message carries a service requirement;
将所述调度请求消息转换为调度任务消息,并通过异步通信方式通知所述调度系统中的每个过滤式调度器,其中,所述调度任务消息中携带所述业务需求和所述过滤式调度器700的角色信息,所述调度任务消息用于指示过滤式调度器根据所述业务需求在与所述过滤式调度器关联的虚拟群组中确定调度结果,并将所述调度结果发送给所述过滤式调度器700,所述调度结果包括满足所述业务需求的一个或多个服务器;Transmitting the scheduling request message into a scheduling task message, and notifying each of the filtering schedulers in the scheduling system by using an asynchronous communication manner, where the scheduling task message carries the service requirement and the filtered scheduling The role information of the device 700, the scheduling task message is used to instruct the filter scheduler to determine a scheduling result in a virtual group associated with the filter scheduler according to the service requirement, and send the scheduling result to the The filter scheduler 700, the scheduling result includes one or more servers that meet the service requirements;
获取所述调度系统中的过滤式调度器根据所述调度任务消息确定的调度结果;Obtaining a scheduling result determined by the filtering scheduler in the scheduling system according to the scheduling task message;
当满足预置条件时,按照预置算法在所述获取到的调度结果中确定最终调度结果,所述最终调度结果中包括满足所述业务需求的一个或多个服务器。When the preset condition is met, the final scheduling result is determined in the acquired scheduling result according to a preset algorithm, where the final scheduling result includes one or more servers that meet the service requirement.
应理解的是,在本发明实施例中,该处理器701可以是CPU,该处理器701还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that, in the embodiment of the present invention, the processor 701 may be a CPU, and the processor 701 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), and off-the-shelf programmable Gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
该存储器702可以包括只读存储器和随机存取存储器,并向处理器701提供指令和数据。存储器702的一部分还可以包括非易失性随机存取存储器。例如,存储器702还可以存储设备类型的信息。The memory 702 can include read only memory and random access memory and provides instructions and data to the processor 701. A portion of the memory 702 can also include a non-volatile random access memory. For example, the memory 702 can also store information of the device type.
该系统总线704除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为系统总线704。The system bus 704 can include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as system bus 704 in the figure.
通过上述内容的描述,对于一个调度请求,调度器集群中各个过滤式调度器分工 协作,分别在各自对应的虚拟群组中确定调度结果,并由第一个获取该调度请求的过滤式调度器汇总所有结果并最终确定最佳调度结果,避免了现有技术中多个过滤式调度器并行工作导致资源竞争问题。另一方面,每个过滤式调度器利用资源预占信息记录其确定的调度结果所需资源信息,解决了现有技术中数据库中记录服务器资源占用情况无法实时更新所导致的调度失败问题,提升了调度器集群资源分配的消息,从而提高了调度器集群管理大型数据中新资源的能力。Through the above description, for each scheduling request, the division of each filter scheduler in the scheduler cluster Collaboration, respectively determining the scheduling result in the respective corresponding virtual group, and collecting the results by the first filtering scheduler that obtains the scheduling request, and finally determining the optimal scheduling result, thereby avoiding multiple filtering methods in the prior art. The parallel operation of the scheduler leads to resource competition issues. On the other hand, each filter scheduler uses the resource camping information to record the resource information required for the determined scheduling result, and solves the problem of scheduling failure caused by the inability of the record server resource occupancy in the database in the prior art to be updated in real time. The dispatcher cluster resource allocation message improves the ability of the scheduler cluster to manage new resources in large data.
应理解的是,根据本发明实施例的过滤式调度器700可对应于本发明实施例中的资源调度的装置600,并可以对应于执行根据本发明实施例的图2所示方法中的相应主体,并且过滤式调度器700中的各个模块的上述和其它操作和/或功能分别为了实现图1至图5中的各个方法的相应流程,为了简洁,在此不再赘述。It should be understood that the filter scheduler 700 according to an embodiment of the present invention may correspond to the resource scheduling apparatus 600 in the embodiment of the present invention, and may correspond to performing corresponding ones in the method shown in FIG. 2 according to an embodiment of the present invention. The above-mentioned and other operations and/or functions of the respective modules in the filter scheduler 700 are respectively implemented in order to implement the respective processes of the respective methods in FIG. 1 to FIG. 5, and are not described herein again for brevity.
综上所述,对于一个调度请求,调度器集群中各个过滤式调度器分工协作,分别在各自对应的虚拟群组中确定调度结果,并由第一个获取该调度请求的过滤式调度器汇总所有结果并最终确定最佳调度结果,避免了现有技术中多个过滤式调度器并行工作导致资源竞争问题。另一方面,每个过滤式调度器利用资源预占信息记录其确定的调度结果所需资源信息,解决了现有技术中数据库中记录服务器资源占用情况无法实时更新所导致的调度失败问题,提升了调度器集群资源分配的消息,从而提高了调度器集群管理大型数据中新资源的能力。In summary, for a scheduling request, each of the filter schedulers in the scheduler cluster cooperates and determines the scheduling result in each corresponding virtual group, and is summarized by the first filtered scheduler that obtains the scheduling request. All the results and finally determine the optimal scheduling result, avoiding the problem of resource competition caused by the parallel operation of multiple filter schedulers in the prior art. On the other hand, each filter scheduler uses the resource camping information to record the resource information required for the determined scheduling result, and solves the problem of scheduling failure caused by the inability of the record server resource occupancy in the database in the prior art to be updated in real time. The dispatcher cluster resource allocation message improves the ability of the scheduler cluster to manage new resources in large data.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出 来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the part of the technical solution of the present invention that contributes in essence or to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method of various embodiments of the present invention. . The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims (13)

  1. 一种资源调度的方法,其特征在于,所述方法应用于调度系统中,所述调度系统中包括至少两个过滤式调度器和至少两个服务器,其中,每个过滤式调度器关联一个虚拟群组,每个虚拟群组中包括与该虚拟群组关联的过滤式调度器所能调度的所有服务器,且一个服务器仅归属于一个虚拟群组;所述方法包括:A method for resource scheduling, characterized in that the method is applied to a scheduling system, where the scheduling system includes at least two filter schedulers and at least two servers, wherein each filter scheduler is associated with one virtual a group, each virtual group includes all servers that can be scheduled by a filter scheduler associated with the virtual group, and one server belongs to only one virtual group; the method includes:
    第一过滤式调度器获取调度请求消息,所述调度请求消息中携带业务需求,所述第一过滤式调度器为所述调度系统中任一过滤式调度器;The first filter scheduler obtains a scheduling request message, where the scheduling request message carries a service requirement, and the first filter scheduler is any filter scheduler in the scheduling system;
    所述第一过滤式调度器将所述调度请求消息转换为调度任务消息,并通过异步通信方式通知所述调度系统中的每个过滤式调度器,其中,所述调度任务消息中携带所述业务需求和所述第一过滤式调度器的角色信息,所述调度任务消息用于指示过滤式调度器根据所述业务需求在与所述过滤式调度器关联的虚拟群组中确定调度结果,并将所述调度结果发送给所述第一过滤式调度器,所述调度结果包括满足所述业务需求的一个或多个服务器;The first filter scheduler converts the scheduling request message into a scheduling task message, and notifies each of the filtering schedulers in the scheduling system by using an asynchronous communication manner, where the scheduling task message carries the a service requirement and role information of the first filter scheduler, the schedule task message is used to instruct the filter scheduler to determine a scheduling result in a virtual group associated with the filter scheduler according to the service requirement, And sending the scheduling result to the first filtered scheduler, where the scheduling result includes one or more servers that meet the service requirement;
    所述第一过滤式调度器获取所述调度系统中的过滤式调度器根据所述调度任务消息确定的调度结果;Obtaining, by the first filter scheduler, a scheduling result determined by the filtering scheduler in the scheduling system according to the scheduling task message;
    当满足预置条件时,所述第一过滤式调度器按照预置算法在所述获取到的调度结果中确定最终调度结果,所述最终调度结果中包括满足所述业务需求的一个或多个服务器。When the preset condition is met, the first filter scheduler determines a final scheduling result in the acquired scheduling result according to a preset algorithm, where the final scheduling result includes one or more that meet the service requirement. server.
  2. 根据权利要求1所述方法,其特征在于,所述通过异步通信方式通知所述调度系统中的每个过滤式调度器包括:The method according to claim 1, wherein the notifying each of the filtering schedulers in the scheduling system by asynchronous communication comprises:
    所述第一过滤式调度器将所述调度任务消息存储在消息队列,以使得所述每个过滤式调度器监听所述消息队列,并获取所述调度任务消息。The first filtered scheduler stores the scheduled task message in a message queue such that each of the filtered schedulers listens to the message queue and acquires the scheduled task message.
  3. 根据权利要求1至2中任一所述方法,所述过滤式调度器根据所述业务需求在与所述过滤式调度器关联的虚拟群组中确定调度结果,包括:The method according to any one of claims 1 to 2, wherein the filter scheduler determines a scheduling result in a virtual group associated with the filter scheduler according to the service requirement, including:
    所述过滤式调度器获得所述调度任务消息;The filtering scheduler obtains the scheduling task message;
    所述过滤式调度器根据所述业务需求在所述过滤式调度器关联的虚拟群组中确定满足所述业务需求的服务器;The filter scheduler determines, according to the service requirement, a server that meets the service requirement in a virtual group associated with the filter scheduler;
    所述过滤式调度器根据预定义权值算法对确定出的服务器进行排序,并按照顺序依次选择一个或多个服务器作为所述调度结果。The filter scheduler sorts the determined servers according to a predefined weight algorithm, and sequentially selects one or more servers as the scheduling result in order.
  4. 根据权利要求1至3中任一项所述方法,其特征在于,所述满足预置条件包括:The method according to any one of claims 1 to 3, wherein the satisfying the preset condition comprises:
    所述第一过滤式调度器获取所述调度结果的数量满足第一阈值;或Obtaining, by the first filter scheduler, the number of the scheduling results meets a first threshold; or
    所述第一过滤式调度器获取所述调度结果的数量满足第一阈值且接收时间满足第二阈值。The first filter scheduler obtains that the number of the scheduling results meets a first threshold and the receiving time satisfies a second threshold.
  5. 根据权利要求1至4中任一所述方法,其特征在于,所述第一过滤式调度器按照预置算法在所述获取到的调度结果中确定最终调度结果的方法包括以下方式中的任意一种:The method according to any one of claims 1 to 4, wherein the method for determining, by the first filter scheduler, the final scheduling result in the acquired scheduling result according to a preset algorithm comprises any of the following manners. One:
    所述第一过滤式调度器按照所述预定义权值算法确定的权值对所述调度结果中所有服务器进行排序,依次选择一个或多个服务器为所述最终调度结果;或 The first filter scheduler sorts all servers in the scheduling result according to the weight determined by the predefined weight algorithm, and sequentially selects one or more servers as the final scheduling result; or
    所述第一过滤式调度器按照接收时间顺序依次从所述调度结果中选择一个或多个服务器为所述最终调度结果;或The first filter scheduler sequentially selects one or more servers from the scheduling result in the order of receiving time as the final scheduling result; or
    所述第一过滤式调度器随机从所述调度结果中选择一个或多个服务器为所述最终调度结果;The first filter scheduler randomly selects one or more servers from the scheduling result as the final scheduling result;
    其中,所述预定义权值算法可以根据服务器的CPU剩余量、内存剩余量、磁盘剩余量、网络流量、CPU类型、磁盘类型、网卡类型、磁盘每秒进行读写的次数中的至少一种定义不同权重,并计算获得每个服务器的权值。The predefined weight algorithm may be based on at least one of a CPU remaining amount of the server, a remaining memory amount, a remaining amount of the disk, a network traffic, a CPU type, a disk type, a network card type, and a number of times the disk reads and writes per second. Define different weights and calculate the weight of each server.
  6. 根据权利要求1至5中任一所述方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 5, wherein the method further comprises:
    所述过滤式调度器在确定所述调度结果之后,记录资源预占信息,所述资源预占信息用于标识所述过滤式调度器所确定的所述调度结果在对应的服务器中需要占用的资源信息;After the filtering scheduler determines the scheduling result, the resource pre-occupation information is used to identify that the scheduling result determined by the filtering scheduler needs to be occupied in the corresponding server. Resource information
    则在所述第一过滤式调度器确定所述最终调度结果之后,所述方法还包括:After the first filtered scheduler determines the final scheduling result, the method further includes:
    所述第一过滤式调度器通知所述过滤式调度器所述最终调度结果,以使得所述过滤式调度器清除所述资源预占信息。The first filter scheduler notifies the filter scheduler of the final scheduling result, so that the filter scheduler clears the resource camp-on information.
  7. 一种资源调度的装置,其特征在于,所述装置包括获取单元、处理单元、确定单元;An apparatus for resource scheduling, wherein the apparatus includes an acquiring unit, a processing unit, and a determining unit;
    所述获取单元,用于获取调度请求消息,所述调度请求消息中携带业务需求;The acquiring unit is configured to acquire a scheduling request message, where the scheduling request message carries a service requirement;
    所述处理单元,用于将所述调度请求消息转换为调度任务消息,并通过异步通信方式通知所述调度系统中的每个过滤式调度器,其中,所述调度任务消息中携带所述业务需求和所述装置的角色信息,所述调度任务消息用于指示过滤式调度器根据所述业务需求在与所述过滤式调度器关联的虚拟群组中确定调度结果,并将所述调度结果发送给所述装置,所述调度结果包括满足所述业务需求的一个或多个服务器;The processing unit is configured to convert the scheduling request message into a scheduling task message, and notify each filtering scheduler in the scheduling system by using an asynchronous communication manner, where the scheduling task message carries the service a demand and a role information of the device, the scheduling task message is used to indicate that the filter scheduler determines a scheduling result in a virtual group associated with the filter scheduler according to the service requirement, and the scheduling result is Sent to the device, the scheduling result includes one or more servers that meet the service requirements;
    所述获取单元,还用于获取所述调度系统中的过滤式调度器根据所述调度任务消息确定的调度结果;The obtaining unit is further configured to acquire a scheduling result that is determined by the filtering scheduler in the scheduling system according to the scheduling task message;
    所述确定单元,用于当满足预置条件时,按照预置算法在所述获取到的调度结果中确定最终调度结果,所述最终调度结果中包括满足所述业务需求的一个或多个服务器。The determining unit is configured to determine, in the preset scheduling result, a final scheduling result according to a preset algorithm, where the final scheduling result includes one or more servers that meet the service requirement. .
  8. 根据权利要求7所述装置,其特征在于,所述处理单元通过异步通信方式通知所述调度系统中的每个过滤式调度器包括:The apparatus according to claim 7, wherein the processing unit notifies each of the scheduling schedulers in the scheduling system by asynchronous communication means that:
    将所述调度任务消息存储在所述消息队列,以使得所述每个过滤式调度器监听所述消息队列,并获取所述调度任务消息。The scheduling task message is stored in the message queue such that each of the filtering schedulers listens to the message queue and acquires the scheduling task message.
  9. 根据权利要求7至8中任一所述装置,其特征在于,Apparatus according to any one of claims 7 to 8 wherein:
    所述获取单元,还用于获得所述调度任务消息;The obtaining unit is further configured to obtain the scheduling task message;
    所述处理单元,还用于根据所述业务需求在所述过滤式调度器关联的虚拟群组中确定满足所述业务需求的服务器;根据预定义权值算法对确定出的服务器进行排序,并按照顺序依次选择一个或多个服务器作为所述调度结果。The processing unit is further configured to: determine, according to the service requirement, a server that meets the service requirement in a virtual group associated with the filter scheduler; sort the determined server according to a predefined weight algorithm, and One or more servers are sequentially selected in order as the scheduling result.
  10. 根据权利要求7至9中任一所述装置,其特征在于,所述满足预置条件包括:The apparatus according to any one of claims 7 to 9, wherein said satisfying preset conditions comprises:
    所述第一过滤式调度器获取所述调度结果的数量满足第一阈值;或 Obtaining, by the first filter scheduler, the number of the scheduling results meets a first threshold; or
    所述第一过滤式调度器获取所述调度结果的数量满足第一阈值且接收时间满足第二阈值。The first filter scheduler obtains that the number of the scheduling results meets a first threshold and the receiving time satisfies a second threshold.
  11. 根据权利要求7至10中任一所述装置,其特征在于,所述确定单元按照预置算法在所述获取到的调度结果中确定最终调度结果包括以下方式中的任意一种:The apparatus according to any one of claims 7 to 10, wherein the determining unit determines, according to a preset algorithm, the final scheduling result in the acquired scheduling result, including any one of the following manners:
    按照所述预定义权值算法确定的权值对所述调度结果中所有服务器进行排序,依次选择一个或多个服务器为所述最终调度结果;或Sorting all servers in the scheduling result according to the weight determined by the predefined weight algorithm, and sequentially selecting one or more servers as the final scheduling result; or
    按照接收时间顺序依次从所述调度结果中选择一个或多个服务器为所述最终调度结果;或Selecting one or more servers from the scheduling results in sequence according to the receiving time order as the final scheduling result; or
    随机从所述调度结果中选择一个或多个服务器为所述最终调度结果;Randomly selecting one or more servers from the scheduling results as the final scheduling result;
    其中,所述预定义权值算法可以根据服务器的CPU剩余量、内存剩余量、磁盘剩余量、网络流量、CPU类型、磁盘类型、网卡类型、磁盘每秒进行读写的次数中的至少一种定义不同权重,并计算获得每个服务器的权值。The predefined weight algorithm may be based on at least one of a CPU remaining amount of the server, a remaining memory amount, a remaining amount of the disk, a network traffic, a CPU type, a disk type, a network card type, and a number of times the disk reads and writes per second. Define different weights and calculate the weight of each server.
  12. 根据权利要求7至11中任一所述装置,其特征在于,所述装置还包括记录单元;Apparatus according to any one of claims 7 to 11, wherein said apparatus further comprises a recording unit;
    所述记录单元,用于在确定所述调度结果之后,记录资源预占信息,所述资源预占信息用于标识所述过滤式调度器所确定的所述调度结果在对应的服务器中需要占用的资源信息;The recording unit is configured to: after the determining the scheduling result, record resource pre-occupation information, where the resource pre-occupation information is used to identify that the scheduling result determined by the filtering scheduler needs to be occupied in a corresponding server. Resource information;
    所述处理单元,还用于在所述第一过滤式调度器确定所述最终调度结果之后,通知所述过滤式调度器所述最终调度结果。The processing unit is further configured to notify the filtered scheduler of the final scheduling result after the first filtered scheduler determines the final scheduling result.
  13. 一种过滤式调度器,其特征在于,所述过滤式调度器包括处理器、存储器、通信接口、总线,所述处理器、存储器和通信接口之间通过总线连接并完成相互间的通信,所述存储器中用于存储计算机执行指令,所述过滤式调度器运行时,所述处理器执行所述存储器中的计算机执行指令以利用所述过滤式调度器中的硬件资源执行权利要求1至6中任一所述的方法。 A filter scheduler, wherein the filter scheduler includes a processor, a memory, a communication interface, and a bus, and the processor, the memory, and the communication interface are connected by a bus and complete communication with each other. In the memory for storing computer execution instructions, when the filter scheduler is running, the processor executes computer execution instructions in the memory to perform claims 1 to 6 using hardware resources in the filter scheduler Any of the methods described.
PCT/CN2017/106553 2016-10-19 2017-10-17 Resource scheduling method and apparatus, and filtered scheduler WO2018072687A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610914532.5 2016-10-19
CN201610914532.5A CN107968802B (en) 2016-10-19 2016-10-19 Resource scheduling method and device and filtering type scheduler

Publications (1)

Publication Number Publication Date
WO2018072687A1 true WO2018072687A1 (en) 2018-04-26

Family

ID=61997130

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/106553 WO2018072687A1 (en) 2016-10-19 2017-10-17 Resource scheduling method and apparatus, and filtered scheduler

Country Status (2)

Country Link
CN (2) CN111258737B (en)
WO (1) WO2018072687A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109343941A (en) * 2018-08-14 2019-02-15 阿里巴巴集团控股有限公司 Task processing method, device, electronic equipment and computer readable storage medium
CN111182047A (en) * 2019-12-24 2020-05-19 中国银联股份有限公司 Method and system for transferring files between large data platforms across a network
CN111831420A (en) * 2020-07-20 2020-10-27 北京百度网讯科技有限公司 Method and device for task scheduling, electronic equipment and computer-readable storage medium
CN113032126A (en) * 2021-04-07 2021-06-25 北京理工大学 High-concurrency cloud workflow scheduling engine cross-cluster communication system and method
CN113760513A (en) * 2021-09-16 2021-12-07 康键信息技术(深圳)有限公司 Distributed task scheduling method, device, equipment and medium

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971920B (en) * 2018-09-30 2021-11-26 武汉斗鱼网络科技有限公司 Message degradation method and related device
CN110109976B (en) * 2019-05-15 2021-09-10 成都四方伟业软件股份有限公司 Data processing method, device, system and storage medium
CN110267060B (en) * 2019-07-24 2021-03-26 北京视界云天科技有限公司 Video file storage injection method and device, computer equipment and storage medium
CN110912967A (en) * 2019-10-31 2020-03-24 北京浪潮数据技术有限公司 Service node scheduling method, device, equipment and storage medium
CN111198749A (en) * 2020-01-06 2020-05-26 紫光云技术有限公司 Method for improving scheduling efficiency of creating virtual machine physical node
CN111240822B (en) * 2020-01-15 2023-11-17 华为技术有限公司 Task scheduling method, device, system and storage medium
CN113382424B (en) * 2020-03-10 2023-07-18 中国移动通信集团辽宁有限公司 LTE base station hardware resource scheduling processing method and device
CN113112139A (en) * 2021-04-07 2021-07-13 上海联蔚盘云科技有限公司 Cloud platform bill processing method and equipment
CN114429313B (en) * 2022-04-01 2022-07-05 苏州万店掌网络科技有限公司 Weight scheduling method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662636A (en) * 2012-03-27 2012-09-12 北京华如科技股份有限公司 Two-layer virtual machines-based concurrent job scheduling method
US9141433B2 (en) * 2009-12-18 2015-09-22 International Business Machines Corporation Automated cloud workload management in a map-reduce environment
CN105159762A (en) * 2015-08-03 2015-12-16 冷明 Greedy strategy based heuristic cloud computing task scheduling method
CN105893158A (en) * 2016-06-08 2016-08-24 北京工业大学 Big data hybrid scheduling model on private cloud condition

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8205208B2 (en) * 2007-07-24 2012-06-19 Internaitonal Business Machines Corporation Scheduling grid jobs using dynamic grid scheduling policy
CN101957780B (en) * 2010-08-17 2013-03-20 中国电子科技集团公司第二十八研究所 Resource state information-based grid task scheduling processor and grid task scheduling processing method
US8984519B2 (en) * 2010-11-17 2015-03-17 Nec Laboratories America, Inc. Scheduler and resource manager for coprocessor-based heterogeneous clusters
US9229774B1 (en) * 2012-07-13 2016-01-05 Google Inc. Systems and methods for performing scheduling for a cluster
CN104503832B (en) * 2014-12-22 2017-07-28 西安电子科技大学 A kind of scheduling virtual machine system and method for fair and efficiency balance

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9141433B2 (en) * 2009-12-18 2015-09-22 International Business Machines Corporation Automated cloud workload management in a map-reduce environment
CN102662636A (en) * 2012-03-27 2012-09-12 北京华如科技股份有限公司 Two-layer virtual machines-based concurrent job scheduling method
CN105159762A (en) * 2015-08-03 2015-12-16 冷明 Greedy strategy based heuristic cloud computing task scheduling method
CN105893158A (en) * 2016-06-08 2016-08-24 北京工业大学 Big data hybrid scheduling model on private cloud condition

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109343941A (en) * 2018-08-14 2019-02-15 阿里巴巴集团控股有限公司 Task processing method, device, electronic equipment and computer readable storage medium
CN109343941B (en) * 2018-08-14 2023-02-21 创新先进技术有限公司 Task processing method and device, electronic equipment and computer readable storage medium
CN111182047A (en) * 2019-12-24 2020-05-19 中国银联股份有限公司 Method and system for transferring files between large data platforms across a network
CN111182047B (en) * 2019-12-24 2023-04-07 中国银联股份有限公司 Method and system for transferring files between large data platforms across a network
CN111831420A (en) * 2020-07-20 2020-10-27 北京百度网讯科技有限公司 Method and device for task scheduling, electronic equipment and computer-readable storage medium
CN111831420B (en) * 2020-07-20 2023-08-08 北京百度网讯科技有限公司 Method for task scheduling, related device and computer program product
CN113032126A (en) * 2021-04-07 2021-06-25 北京理工大学 High-concurrency cloud workflow scheduling engine cross-cluster communication system and method
CN113032126B (en) * 2021-04-07 2022-09-20 北京理工大学 High-concurrency cloud workflow scheduling engine cross-cluster communication system and method
CN113760513A (en) * 2021-09-16 2021-12-07 康键信息技术(深圳)有限公司 Distributed task scheduling method, device, equipment and medium

Also Published As

Publication number Publication date
CN107968802B (en) 2020-02-14
CN107968802A (en) 2018-04-27
CN111258737A (en) 2020-06-09
CN111258737B (en) 2023-12-08

Similar Documents

Publication Publication Date Title
WO2018072687A1 (en) Resource scheduling method and apparatus, and filtered scheduler
CN107087019B (en) Task scheduling method and device based on end cloud cooperative computing architecture
EP3072260B1 (en) Methods, systems, and computer readable media for a network function virtualization information concentrator
CN107241281B (en) Data processing method and device
CN102281329B (en) Resource scheduling method and system for platform as a service (Paas) cloud platform
US10091215B1 (en) Client isolation in a distributed queue
US10200295B1 (en) Client selection in a distributed strict queue
US9577961B2 (en) Input/output management in a distributed strict queue
WO2019001092A1 (en) Load balancing engine, client, distributed computing system, and load balancing method
US9584593B2 (en) Failure management in a distributed strict queue
US9571414B2 (en) Multi-tiered processing using a distributed strict queue
WO2012037760A1 (en) Method, server and system for improving alarm processing efficiency
US9535749B2 (en) Methods for managing work load bursts and devices thereof
US20150381549A1 (en) Message batching in a distributed strict queue
US9577972B1 (en) Message inspection in a distributed strict queue
US9577878B2 (en) Geographic awareness in a distributed strict queue
CN111831408A (en) Asynchronous task processing method and device, electronic equipment and medium
US10986036B1 (en) Method and apparatus for orchestrating resources in multi-access edge computing (MEC) network
CN115168012A (en) Thread pool concurrent thread number determining method and related product
CN116841720A (en) Resource allocation method, apparatus, computer device, storage medium and program product
CN113794755A (en) Shared service pushing method and system based on micro-service architecture
CN111158899A (en) Data acquisition method, data acquisition device, task management center and task management system
WO2024087663A1 (en) Job scheduling method and apparatus, and chip
US20230261951A1 (en) System and method to provide priority based quality of service for telemetry data
WO2023093200A1 (en) Method and apparatus for asynchronously processing tasks, and storage medium and electronic apparatus

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: 17862850

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: 17862850

Country of ref document: EP

Kind code of ref document: A1