CN112631746A - Service scheduling method and device, electronic equipment and storage medium - Google Patents
Service scheduling method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112631746A CN112631746A CN202011423456.0A CN202011423456A CN112631746A CN 112631746 A CN112631746 A CN 112631746A CN 202011423456 A CN202011423456 A CN 202011423456A CN 112631746 A CN112631746 A CN 112631746A
- Authority
- CN
- China
- Prior art keywords
- service
- processing time
- time
- scheduled
- service processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
技术领域technical field
本申请实施例涉及但不限于计算机技术领域,尤其涉及一种业务调度方法、装置、电子设备及存储介质。The embodiments of the present application relate to, but are not limited to, the field of computer technologies, and in particular, relate to a service scheduling method, apparatus, electronic device, and storage medium.
背景技术Background technique
大型计算系统,例如集群、并行系统、云,需要通过对业务的调度来优化机器的工作时间。对于有界并行的区间调度问题,是指在确定的时间区间内,以及在每台机器可并行执行的确定业务数的条件下,通过调度业务至不同机器,以最大程度地缩短机器的总工作时间,提高业务处理效率。Large-scale computing systems, such as clusters, parallel systems, and clouds, need to optimize the working hours of machines through business scheduling. For the bounded parallel interval scheduling problem, it means to minimize the total work of the machine by scheduling services to different machines within a certain time interval and under the condition that each machine can execute a certain number of services in parallel. time and improve business processing efficiency.
现有的业务调度方法通过最大业务处理时间与最小业务处理时间,获得多个业务处理时间区间,当新业务到来时,预判其业务处理时间,并将其调度至对应的业务处理时间区间的机器进行业务处理,即将处理时间相近的业务装箱至一个机器进行处理。但是当两个业务处理时间相差很小的业务被调度至不同业务处理区间的机器进行业务处理时,会导致整体业务处理效率的降低。The existing service scheduling method obtains multiple service processing time intervals through the maximum service processing time and the minimum service processing time. When a new service arrives, its service processing time is pre-judged, and it is scheduled to the corresponding service processing time interval. The machine performs business processing, that is, the business with similar processing time is packed into one machine for processing. However, when two services with a small difference in service processing time are dispatched to machines in different service processing intervals for service processing, the overall service processing efficiency will be reduced.
发明内容SUMMARY OF THE INVENTION
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this article. This summary is not intended to limit the scope of protection of the claims.
本申请实施例提供了一种业务调度方法、装置、电子设备及存储介质,通过将业务处理时间相近的业务调度至同一机器进行处理,优化机器的处理时间,进而提升整个并行系统的计算效率。The embodiments of the present application provide a service scheduling method, device, electronic device, and storage medium. By scheduling services with similar service processing time to the same machine for processing, the processing time of the machine is optimized, thereby improving the computing efficiency of the entire parallel system.
第一方面,本申请的实施例提供了一种业务调度方法,包括:获取第一业务的第一业务处理时间与第二业务的第二业务处理时间,所述第一业务处理时间大于等于所述第二业务处理时间;根据所述第一业务处理时间与所述第二业务处理时间,获取所述第一业务处理时间与所述第二业务处理时间的比值;若所述比值小于阈值,将所述第一业务与所述第二业务调度至同一机器处理。In a first aspect, an embodiment of the present application provides a service scheduling method, including: obtaining a first service processing time of a first service and a second service processing time of a second service, where the first service processing time is greater than or equal to all the second service processing time; obtain the ratio of the first service processing time and the second service processing time according to the first service processing time and the second service processing time; if the ratio is less than the threshold, The first service and the second service are scheduled to be processed on the same machine.
根据本发明实施例的业务调度方法,至少具有如下有益效果:通过计算两个业务的处理时间的比值,将处理时间相近的两项业务调度至同一机器处理,减少机器的处理时间。The service scheduling method according to the embodiment of the present invention has at least the following beneficial effects: by calculating the ratio of the processing time of the two services, two services with similar processing time are scheduled to the same machine for processing, thereby reducing the processing time of the machine.
根据本发明的一些实施例,还包括:所述阈值根据以下因素中的至少一个进行调整:所述机器可并行处理的最大业务处理数量;业务调度过程中第一时间窗内最大业务处理时间与最小业务处理时间的比值;其中,所述第一时间窗具有预设的第一时间长度。According to some embodiments of the present invention, it further includes: the threshold is adjusted according to at least one of the following factors: the maximum number of business processing that the machine can process in parallel; the maximum business processing time in the first time window in the business scheduling process The ratio of the minimum service processing time; wherein, the first time window has a preset first time length.
第二方面,本申请的实施例提供了一种业务调度方法,用于具有两个及以上的机器的并行系统,包括:获取当前待调度业务的待调度业务处理时间;获取所述计算系统中每个机器上的已调度业务处理时间集合;根据所述待调度业务处理时间与所述每个机器上的已调度业务处理时间集合,分别计算所述待调度业务处理时间与所述每个机器上的已调度业务处理时间集合中每一元素的比值,并通过调整两者作为分子与分母的顺序,使所述比值大于等于1;若对于每个已调度业务处理时间集合对应的比值均小于第一阈值,则将所述当前待调度业务调度至所述已调度业务处理时间集合对应的机器进行业务处理。In a second aspect, the embodiments of the present application provide a service scheduling method for a parallel system with two or more machines, including: obtaining the processing time of the service to be scheduled for the current service to be scheduled; obtaining the processing time of the service in the computing system The scheduled service processing time set on each machine; according to the to-be-scheduled service processing time and the scheduled service processing time set on each machine, calculate the to-be-scheduled service processing time and each machine respectively The ratio of each element in the scheduled service processing time set above, and by adjusting the order of the two as the numerator and denominator, the ratio is greater than or equal to 1; if the ratio corresponding to each scheduled service processing time set is less than or equal to 1 If the first threshold is set, the currently to-be-scheduled service is scheduled to the machine corresponding to the scheduled service processing time set for service processing.
根据本发明实施例的业务调度方法,至少具有如下有益效果:对待调度业务的处理时间与已分配至多个机器的已调度业务的处理时间逐一进行比值计算,获得与其处理时间相近的已调度业务对应的机器,进而通过将待调度业务调度至该机器,能短并行系统中使用的多台机器的总工作时间,提高并行系统的计算效率,进而减少系统能耗与开支。The service scheduling method according to the embodiment of the present invention has at least the following beneficial effects: the ratio between the processing time of the service to be scheduled and the processing time of the scheduled services that have been allocated to multiple machines is calculated one by one, and the corresponding processing time of the scheduled service that is similar to its processing time is obtained. Then, by scheduling the business to be scheduled to the machine, the total working time of multiple machines used in the parallel system can be shortened, the computing efficiency of the parallel system can be improved, and the system energy consumption and expenses can be reduced.
根据本发明的一些实施例,还包括:所述第一阈值根据以下因素中的至少一个进行调整:所述机器可并行处理的最大业务处理数量;业务调度过程中第一时间窗内最大业务处理时间与最小业务处理时间的比值;其中,所述第一时间窗具有预设的第一时间长度。According to some embodiments of the present invention, the method further includes: the first threshold is adjusted according to at least one of the following factors: the maximum number of business processes that the machine can process in parallel; the maximum number of business processes within the first time window in the business scheduling process The ratio of the time to the minimum service processing time; wherein, the first time window has a preset first time length.
根据本发明的一些实施例,还包括:所述业务调度过程还包括第二时间窗与第三时间窗,所述第二时间窗具有预设的第二时间长度,所述第三时间窗具有预设的第三时间长度,所述第二时间长度大于所述第一时间长度,所述第三时间长度小于所述第一时间长度;在业务调度过程中,根据所述第一时间窗,所述第二时间窗与所述第三时间窗,获得对应的所述第一阈值,第二阈值与第三阈值,分别计算根据所述第一阈值,所述第二阈值与所述第三阈值调度的不同机器的计算效率或当前业务处理时间。According to some embodiments of the present invention, it further includes: the service scheduling process further includes a second time window and a third time window, the second time window has a preset second time length, and the third time window has a preset third time length, the second time length is greater than the first time length, and the third time length is less than the first time length; in the service scheduling process, according to the first time window, For the second time window and the third time window, the corresponding first threshold, the second threshold and the third threshold are obtained, respectively, and the calculation is based on the first threshold, the second threshold and the third threshold. Computational efficiency or current business processing time of different machines scheduled by the threshold.
根据本发明的一些实施例,还包括:所述业务调度方法还包括:根据所述计算效率或当前业务处理时间,调整所述第一时间窗的时间长度。According to some embodiments of the present invention, the method further includes: the service scheduling method further includes: adjusting the time length of the first time window according to the calculation efficiency or the current service processing time.
根据本发明的一些实施例,还包括:所述根据计算效率或当前业务处理时间,调整所述第一时间窗的时间长度包括:实时更新最高计算效率对应的时间窗作为所述第一时间窗,或,定期更新最高计算效率对应的时间窗作为所述第一时间窗。According to some embodiments of the present invention, it further includes: the adjusting the time length of the first time window according to the computing efficiency or the current service processing time includes: updating the time window corresponding to the highest computing efficiency in real time as the first time window , or, regularly update the time window corresponding to the highest computing efficiency as the first time window.
根据本发明的一些实施例,还包括:若当前业务处理时间处于预设处理时间范围,则所述第一时间窗的时间长度不变。According to some embodiments of the present invention, the method further includes: if the current service processing time is within a preset processing time range, the time length of the first time window remains unchanged.
第三方面,本申请的实施例还提供了一种业务调度装置,用于执行如第一方面或第二方面所述的业务调度方法。In a third aspect, an embodiment of the present application further provides a service scheduling apparatus for executing the service scheduling method described in the first aspect or the second aspect.
根据本发明实施例的业务调度装置,至少具有如下有益效果:通过执行第一方面或第二方面实施例所述的业务调度方法,能够减少机器的处理时间,进而缩短并行系统中使用的多台机器的总工作时间,提高并行系统的计算效率,进而减少系统能耗与开支。The service scheduling apparatus according to the embodiment of the present invention has at least the following beneficial effects: by executing the service scheduling method described in the embodiment of the first aspect or the second aspect, the processing time of the machine can be reduced, thereby shortening the number of machines used in the parallel system. The total working time of the machine can improve the computing efficiency of the parallel system, thereby reducing the energy consumption and expenses of the system.
第四方面,本申请的实施例还提供了一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第一方面或第二方面所述的业务调度方法。In a fourth aspect, embodiments of the present application further provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, when the one or more programs are stored by the one or more programs or multiple processors execute, so that the one or more processors implement the service scheduling method according to the first aspect or the second aspect.
根据本发明实施例的电子设备,至少具有如下有益效果:通过执行第一方面或第二方面实施例所述的业务调度方法,能够减少机器的处理时间,进而缩短并行系统中使用的多台机器的总工作时间,提高并行系统的计算效率,进而减少系统能耗与开支。The electronic device according to the embodiment of the present invention has at least the following beneficial effects: by executing the service scheduling method described in the embodiment of the first aspect or the second aspect, the processing time of the machine can be reduced, thereby shortening the multiple machines used in the parallel system The total working time of the parallel system is improved, and the computing efficiency of the parallel system is improved, thereby reducing the energy consumption and expenditure of the system.
第五方面,本申请的实施例还提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行如上第一方面或第二方面所述的业务调度方法。In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, where the computer-executable instructions are used to execute the service scheduling method described in the first aspect or the second aspect above .
本申请实施例通过对待调度业务的处理时间与已分配至多个机器的已调度业务的处理时间逐一进行比值计算,获得与其处理时间相近的已调度业务对应的机器,进而通过将待调度业务调度至该机器,能短并行系统中使用的多台机器的总工作时间,提高并行系统的计算效率,进而减少系统能耗与开支。In this embodiment of the present application, by calculating the ratio between the processing time of the service to be scheduled and the processing time of the scheduled service allocated to multiple machines one by one, a machine corresponding to a scheduled service with a similar processing time is obtained, and then by scheduling the service to be scheduled to The machine can shorten the total working time of multiple machines used in the parallel system, improve the computing efficiency of the parallel system, and then reduce the energy consumption and expenses of the system.
本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请而了解。本申请的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the present application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the description, claims and drawings.
附图说明Description of drawings
下面结合附图和实施例对本发明做进一步的说明,其中:The present invention will be further described below in conjunction with the accompanying drawings and embodiments, wherein:
图1为传统业务调度方法的流程示意图;Fig. 1 is a schematic flowchart of a traditional service scheduling method;
图2为本申请一实施例提供的业务调度方法的流程示意图;FIG. 2 is a schematic flowchart of a service scheduling method provided by an embodiment of the present application;
图3为本申请另一实施例提供的业务调度方法的流程示意图;3 is a schematic flowchart of a service scheduling method provided by another embodiment of the present application;
图4为本申请一实施例提供的业务调度方法的流程示意图;FIG. 4 is a schematic flowchart of a service scheduling method provided by an embodiment of the present application;
图5为本申请另一实施例提供的微调参数组件具体计算过程的流程示意图;5 is a schematic flowchart of a specific calculation process of a fine-tuning parameter component provided by another embodiment of the present application;
图6为本申请另一实施例提供的微调参数组件具体计算过程的流程示意图;6 is a schematic flowchart of a specific calculation process of a fine-tuning parameter component provided by another embodiment of the present application;
图7为本申请另一实施例提供的选择业务处理机器的具体计算过程的流程示意图。FIG. 7 is a schematic flowchart of a specific calculation process for selecting a service processing machine according to another embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
需要说明的是,虽然在装置示意图中进行了功能模块划分,在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于装置中的模块划分,或流程图中的顺序执行所示出或描述的步骤。说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that although the functional modules are divided in the schematic diagram of the device, and the logical sequence is shown in the flowchart, in some cases, the modules may be divided differently from the device, or executed in the order in the flowchart. steps shown or described. The terms "first", "second" and the like in the description and claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
本申请实施例的描述中,除非另有明确的限定,设置、安装、连接等词语应做广义理解,所属技术领域技术人员可以结合技术方案的具体内容合理确定上述词语在本申请实施例中的具体含义。In the description of the embodiments of the present application, unless otherwise clearly defined, words such as setting, installation, and connection should be understood in a broad sense, and those skilled in the art can reasonably determine the meaning of the above-mentioned words in the embodiments of the present application in combination with the specific content of the technical solution. specific meaning.
下面结合附图,对本申请实施例作进一步阐述。The embodiments of the present application will be further described below with reference to the accompanying drawings.
现有的集群、并行计算系统、云等大规模计算系统中包含多个可执行计算的机器,通过合理调度业务至不同机器,能够有效的提高整个计算系统的计算效率。上述业务调度的前提是业务的处理时间是先验的,即业务处理时间可以很容易地被高精度预测出来,而现有的业务种类,例如云游戏、视频编码/转码作业和数据分析等业务具有重复性,因此其业务处理时间可以预先得知。Existing large-scale computing systems such as clusters, parallel computing systems, and clouds include multiple machines that can perform computations. By reasonably scheduling services to different machines, the computing efficiency of the entire computing system can be effectively improved. The premise of the above-mentioned business scheduling is that the processing time of the business is a priori, that is, the business processing time can be easily predicted with high precision, while the existing business types, such as cloud games, video encoding/transcoding operations, and data analysis, etc. The business is repetitive, so its business processing time can be known in advance.
图l为传统业务调度方法的流程示意图。如图1所示,传统业务调度方法至少包括:FIG. 1 is a schematic flowchart of a traditional service scheduling method. As shown in Figure 1, the traditional service scheduling method at least includes:
步骤S101:开始业务调度流程。Step S101: Start the service scheduling process.
步骤S102:根据业务列表中最大业务处理时间与最小业务处理时间的比值,及并行处理的最大业务数量进行参数调整。Step S102: Perform parameter adjustment according to the ratio of the maximum service processing time to the minimum service processing time in the service list and the maximum number of services processed in parallel.
具体地,首先,计算整个业务列表中的最大业务处理时间与最小业务处理时间的比率μ;Specifically, first, calculate the ratio μ of the maximum service processing time to the minimum service processing time in the entire service list;
步骤S103:获得分类。Step S103: Obtain the classification.
具体到,根据μ计算出分类总数n。以最大业务处理时间是15个时间单位,最小业务处理时间是1个时间单位为例,可以将整个业务处理时间分成4类,[1,2)、[2,4)、[4,8)、[8,16)。Specifically, the total number of classifications n is calculated according to μ. Taking the maximum business processing time of 15 time units and the minimum business processing time of 1 time unit as an example, the entire business processing time can be divided into 4 categories, [1, 2), [2, 4), [4, 8) , [8, 16).
步骤S104:新业务进入计算系统,等待调度。具体地,新业务ji进入系统等待调度。Step S104: The new service enters the computing system and waits for scheduling. Specifically, the new service ji enters the system and waits for scheduling.
步骤S105:获得任务的所属分类。具体地,假设业务ji的处理时间为b。当C≥0时,如果满足aC≤b≤aC+1(a为给定常数),则业务ji将归入C类。然后,业务ji被分配到第一个可用的、满足执行业务ji所需能力要求的机器。Step S105: Obtain the category to which the task belongs. Specifically, it is assumed that the processing time of service ji is b. When C≥0, if a C≤b≤a C +1 (a is a given constant) is satisfied, then the service ji will be classified into C class. Then, service ji is assigned to the first available machine that meets the capability requirements required to execute service ji .
然而,基于上述分类的方法可能会导致劣解,即在μ很大的情况下,即便是处理时间相近的业务,也会被分到两个分类所属的机器上去处理。更加具体地,假设在某个时间点,系统中有两个业务(jz和jz+1)到达等待处理,它们的处理时间分别为7.9个时间单位和8个时间单位。假设共有四个类别([1,2)、[2,4)、[4,8)、[8,16),基于上述分类方法,会将业务jz分配给属于类别[8,16)中的一台机器;同时将业务jz+1分配给属于类别[4,8)中的一台机器105。很明显,即使这些业务的处理时间相近,它们也被装箱分配到不同的机器上处理,这将导致系统整体计算效率的降低。However, the method based on the above classification may lead to an inferior solution, that is, when μ is large, even the business with similar processing time will be divided into the machines belonging to the two classifications for processing. More specifically, it is assumed that at a certain point in time, two services (j z and j z+1 ) arrive in the system to wait for processing, and their processing time is 7.9 time units and 8 time units, respectively. Assuming that there are four categories ([1,2), [2,4), [4,8), [8,16), based on the above classification method, the business j z will be assigned to those belonging to the category [8,16) one machine of ; meanwhile assigning business j z+1 to one machine 105 belonging to class [4, 8). Obviously, even if the processing time of these services is similar, they are boxed and assigned to different machines for processing, which will lead to a decrease in the overall computing efficiency of the system.
第一方面,本申请实施例提供了一种业务调度方法。图2为本申请另一实施例提供的业务调度方法的流程示意图。如图2所示,至少包括:In a first aspect, an embodiment of the present application provides a service scheduling method. FIG. 2 is a schematic flowchart of a service scheduling method provided by another embodiment of the present application. As shown in Figure 2, it includes at least:
步骤S201:获取第一业务的第一业务处理时间与第二业务的第二业务处理时间,第一业务处理时间大于等于第二业务处理时间。Step S201: Obtain the first service processing time of the first service and the second service processing time of the second service, where the first service processing time is greater than or equal to the second service processing time.
在本实施例中,第一业务与第二业务也可为任意的两个业务,且两个业务的业务处理时间已知。为了简化计算,令本实施例中的第一业务处理时间大于等于第二业务处理时间。在实际计算中,只要将处理时间较长的业务作为第一业务,处理时间较短的业务作为第二业务;如果两个业务的处理时间长度相等,则可以任意赋予第一业务与第二业务。In this embodiment, the first service and the second service may also be any two services, and the service processing times of the two services are known. In order to simplify the calculation, the processing time of the first service in this embodiment is set to be greater than or equal to the processing time of the second service. In actual calculation, as long as the service with a longer processing time is used as the first service, and the service with a shorter processing time is used as the second service; if the processing time lengths of the two services are equal, the first service and the second service can be assigned arbitrarily. .
步骤S202:根据第一业务处理时间与第二业务处理时间,获取第一业务处理时间与第二业务处理时间的比值。Step S202: Obtain the ratio of the first service processing time and the second service processing time according to the first service processing time and the second service processing time.
在本实施例中,因为第一业务处理时间大于等于第二业务处理时间,因此第一业务处理时间与第二业务处理时间的比值为大于等于1的数值。在这一步骤中,能够获得两个业务处理时间的相近程度。In this embodiment, because the processing time of the first service is greater than or equal to the processing time of the second service, the ratio of the processing time of the first service to the processing time of the second service is a value greater than or equal to 1. In this step, the approximation of the processing time of the two services can be obtained.
步骤S203:若比值小于阈值,将第一业务与第二业务调度至同一机器处理。Step S203: If the ratio is smaller than the threshold, schedule the first service and the second service to the same machine for processing.
当比值小于阈值,则说明两个业务的处理时间比较相近,那么将其分配到同一机器进行处理就能够提高整体的计算效率。而上述过程,可以被称为判断两个业务是否互斥,即如果比值大于阈值,则两个业务互斥,则不能被分配至同一机器处理,即不能装入同一个箱;如果比值小于阈值,则两个业务不相互斥,则可以被分配至同一机器处理,即可以装入同一个箱。When the ratio is less than the threshold, it means that the processing time of the two services is relatively similar, so allocating them to the same machine for processing can improve the overall computing efficiency. The above process can be called judging whether the two services are mutually exclusive, that is, if the ratio is greater than the threshold, the two services are mutually exclusive and cannot be assigned to the same machine for processing, that is, they cannot be loaded into the same box; if the ratio is less than the threshold , then the two services are not mutually exclusive, they can be assigned to the same machine for processing, that is, they can be loaded into the same box.
在一些实施例中,将处理时间相近的业务分配至同一机器处理的业务调度方法能够有效的提高系统的计算效率,尤其是当系统中包括多个机器以及多个处理时间长短不一的业务时,其对计算效率的提升效果尤为明显。In some embodiments, the business scheduling method of allocating services with similar processing time to the same machine for processing can effectively improve the computing efficiency of the system, especially when the system includes multiple machines and multiple services with different processing times , which has a particularly obvious effect on improving the computing efficiency.
在一些实施例中,阈值根据以下因素中的至少一个进行调整:机器可并行处理的最大业务处理数量;业务调度过程中第一时间窗内最大业务处理时间与最小业务处理时间的比值;其中,第一时间窗具有预设的第一时间长度。In some embodiments, the threshold is adjusted according to at least one of the following factors: the maximum number of service processing that the machine can process in parallel; the ratio of the maximum service processing time to the minimum service processing time in the first time window in the service scheduling process; wherein, The first time window has a preset first time length.
本领域技术人员可知,传统的技术会计算业务队列中处理时间最长与处理时间最短的比值,因此相当于是全局概念,本实施例中引入了时间窗的概念,用于限定一个具有确定时间长度的窗口,在该时间区间内进入的业务被归为属于该时间窗,且时间窗会不断滑动。在一些实施例中,第一阈值由第一时间窗内业务处理时间最长与第一时间窗内业务处理时间最短的比值决定。时间窗的设置相当于是一个局部概念,在简化计算的同时,还能够根据与当前待调度业务相邻比较近的业务的业务处理时间进行计算,保证参数的实时更新。Those skilled in the art know that the traditional technology will calculate the ratio of the longest processing time to the shortest processing time in the service queue, so it is equivalent to a global concept. Window, the business entered in this time interval is classified as belonging to this time window, and the time window will keep sliding. In some embodiments, the first threshold is determined by the ratio of the longest service processing time in the first time window to the shortest service processing time in the first time window. The setting of the time window is equivalent to a local concept. While simplifying the calculation, it can also be calculated according to the business processing time of the business that is adjacent to the current business to be scheduled, so as to ensure the real-time update of parameters.
第二方面,本申请实施例提供了一种业务调度方法。图2为本申请另一实施例提供的业务调度方法的流程示意图。如图2所示,至少包括:In a second aspect, an embodiment of the present application provides a service scheduling method. FIG. 2 is a schematic flowchart of a service scheduling method provided by another embodiment of the present application. As shown in Figure 2, it includes at least:
图3为本申请一实施例提供的业务调度方法的流程示意图。如图3所示,至少包括:FIG. 3 is a schematic flowchart of a service scheduling method provided by an embodiment of the present application. As shown in Figure 3, it includes at least:
步骤S301:获取当前待调度业务的待调度业务处理时间。Step S301 : Acquire the processing time of the to-be-scheduled service of the current to-be-scheduled service.
在一实施例中,当前待调度业务为未调度业务,其业务处理时间已知。In an embodiment, the currently to-be-scheduled service is an unscheduled service, and its service processing time is known.
步骤S302:获取计算系统中每个机器上的已调度业务处理时间集合。Step S302: Acquire the scheduled service processing time set on each machine in the computing system.
在一实施例中,计算系统具有多个用于计算的机器,且每个机器上都有已经分配的业务,这些业务被称为已调度业务。获取每个机器上已调度业务的处理时间,能够构成一个已调度业务处理时间的集合,而每个机器都有一个集合,则对于计算系统来讲,具有多个已调度业务处理时间的集合。In one embodiment, the computing system has multiple machines for computing, and each machine has assigned services, which are called scheduled services. Obtaining the processing time of scheduled services on each machine can form a set of scheduled service processing times, and each machine has a set, so for the computing system, there are multiple sets of scheduled service processing times.
步骤S303:根据待调度业务处理时间与每个机器上的已调度业务处理时间集合,分别计算待调度业务处理时间与每个机器上的已调度业务处理时间集合中每一元素的比值,并通过调整两者作为分子与分母的顺序,使比值大于等于1。Step S303: According to the service processing time to be scheduled and the scheduled service processing time set on each machine, calculate the ratio of the service processing time to be scheduled and each element in the scheduled service processing time set on each machine, and pass Adjust the order of the two as the numerator and denominator so that the ratio is greater than or equal to 1.
在本实施例中,计算的比值仍然为两个业务处理时间的比值。为了简化计算,使用较长的处理时间比较短的处理时间,获得大于等于1的比值。这种方式仅需计算一端的阈值,能够简化计算。In this embodiment, the calculated ratio is still the ratio of the two service processing times. To simplify the calculation, use a longer processing time than a shorter processing time to obtain a ratio greater than or equal to 1. This method only needs to calculate the threshold at one end, which can simplify the calculation.
步骤S304:若对于每个已调度业务处理时间集合对应的比值均小于第一阈值,则将当前待调度业务调度至已调度业务处理时间集合对应的机器进行业务处理。Step S304: If the ratio corresponding to each scheduled service processing time set is smaller than the first threshold, schedule the current to-be-scheduled service to the machine corresponding to the scheduled service processing time set for service processing.
在本实施例中,若对于每个已调度业务处理时间集合对应的比值均小于第一阈值,说明在调度至此机器上的所有业务的处理时间均与待调度业务的处理时间相近,在满足全部业务两两之间不互斥的前提下,可以调度至同一机器处理。In this embodiment, if the ratio corresponding to each scheduled service processing time set is less than the first threshold, it means that the processing time of all the services scheduled to this machine is similar to the processing time of the service to be scheduled, and the On the premise that the two services are not mutually exclusive, they can be dispatched to the same machine for processing.
值得注意的是,第一阈值根据以下因素中的至少一个进行调整:机器可并行处理的最大业务处理数量;业务调度过程中第一时间窗内最大业务处理时间与最小业务处理时间的比值;其中,第一时间窗具有预设的第一时间长度。It is worth noting that the first threshold is adjusted according to at least one of the following factors: the maximum number of business processing that the machine can process in parallel; the ratio of the maximum business processing time to the minimum business processing time in the first time window in the business scheduling process; wherein , the first time window has a preset first time length.
本领域技术人员可知,传统的技术会计算业务队列中处理时间最长与处理时间最短的比值,因此相当于是全局概念,本实施例中引入了时间窗的概念,用于限定一个具有确定时间长度的窗口,在该时间区间内进入的业务被归为属于该时间窗,且时间窗会不断滑动。在一些实施例中,第一阈值由第一时间窗内业务处理时间最长与第一时间窗内业务处理时间最短的比值决定。时间窗的设置相当于是一个局部概念,在简化计算的同时,还能够根据与当前待调度业务相邻比较近的业务的业务处理时间进行计算,保证参数的实时更新。Those skilled in the art know that the traditional technology will calculate the ratio of the longest processing time to the shortest processing time in the service queue, so it is equivalent to a global concept. Window, the business entered in this time interval is classified as belonging to this time window, and the time window will keep sliding. In some embodiments, the first threshold is determined by the ratio of the longest service processing time in the first time window to the shortest service processing time in the first time window. The setting of the time window is equivalent to a local concept. While simplifying the calculation, it can also be calculated according to the business processing time of the business that is adjacent to the current business to be scheduled, so as to ensure the real-time update of parameters.
值得注意的是,时间窗大小的选取会直接影响窗口内处理时间最长最短两个业务的选取,会直接影响阈值的选取,进而影响判断两个业务是否为互斥业务。It is worth noting that the selection of the time window size will directly affect the selection of the two services with the longest processing time and the shortest in the window, which will directly affect the selection of the threshold, which in turn affects the judgment of whether the two services are mutually exclusive services.
在上述实施例中,通过对待调度业务的处理时间与已分配至多个机器的已调度业务的处理时间逐一进行比值计算,获得与其处理时间相近的已调度业务对应的机器,进而通过将待调度业务调度至该机器,能缩短并行系统中使用的多台机器的总工作时间,提高并行系统的计算效率,进而减少系统能耗与开支。In the above embodiment, by calculating the ratio between the processing time of the service to be scheduled and the processing time of the scheduled service that has been allocated to multiple machines one by one, the machine corresponding to the scheduled service with a similar processing time is obtained, and then by dividing the service to be scheduled Scheduling to this machine can shorten the total working time of multiple machines used in the parallel system, improve the computing efficiency of the parallel system, and then reduce system energy consumption and expenses.
图4为本申请另一实施例提供的业务调度方法的流程示意图。如图4所示,本实施例提供的业务调度方法至少包括:FIG. 4 is a schematic flowchart of a service scheduling method provided by another embodiment of the present application. As shown in FIG. 4 , the service scheduling method provided by this embodiment at least includes:
步骤S401:开始业务调度流程。Step S401: Start the service scheduling process.
步骤S402:新业务等待调度。Step S402: The new service is waiting for scheduling.
步骤S403:创建三个并行的业务处理线程。Step S403: Create three parallel service processing threads.
在一些实施例中,业务调度器会创建三个并行的业务处理线程,三个线程具有不同窗口大小,如果具有第一窗口的线程作为主线程,那么第二线程作为辅线程则具有第二窗口,第三线程作为辅线程具有第三窗口,且第一窗口的大小处于第二和第三窗口之间,具体原因为由于后续步骤中会根据实际的计算效率对主线程的窗口的大小不断做调整,因此至少需考察大于和小于主线程窗口的两种情况。In some embodiments, the service scheduler will create three parallel service processing threads, and the three threads have different window sizes. If the thread with the first window serves as the main thread, the second thread serves as the auxiliary thread and has the second window. , the third thread has a third window as an auxiliary thread, and the size of the first window is between the second and third windows. The specific reason is that the size of the window of the main thread will be continuously adjusted according to the actual computing efficiency in the subsequent steps. adjustment, so at least two cases larger than and smaller than the main thread window should be considered.
步骤S404:微调参数组件根据时间窗内中最大业务处理时间与最小业务处理时间的比值,及并行处理的最大业务数量进行阈值调整。Step S404: The fine-tuning parameter component adjusts the threshold value according to the ratio of the maximum service processing time to the minimum service processing time in the time window and the maximum number of services processed in parallel.
步骤S404a-S404c表示在对应具有不同时间窗的三个线程内执行上述步骤。Steps S404a-S404c represent executing the above steps in three threads corresponding to different time windows.
步骤S405:获得不与新业务互斥的所有机器。Step S405: Obtain all machines that are not mutually exclusive with the new service.
步骤S405a-S405c表示在对应具有不同时间窗的三个线程内执行上述步骤。Steps S405a-S405c represent executing the above steps in three threads corresponding to different time windows.
在一些实施例中,由于时间窗大小不同,因此选取的最大最小业务就不同,因此计算获得的参数也不同,因此最后选取的机器也不尽相同。In some embodiments, due to the different sizes of the time windows, the selected maximum and minimum services are different, so the parameters obtained by calculation are also different, and therefore the final selected machines are also different.
步骤S406:使用任何装箱算法将新业务调度至分类对应的机器上处理。Step S406: Use any packing algorithm to schedule the new service to the machine corresponding to the classification for processing.
步骤S406a-S406c表示在对应具有不同时间窗的三个线程内执行上述步骤。Steps S406a-S406c represent executing the above steps in three threads corresponding to different time windows.
上述装箱算法为本领域技术人员的公知常识,本实施例不做赘述。The above-mentioned bin packing algorithm is the common knowledge of those skilled in the art, and is not repeated in this embodiment.
步骤S407:线程同步。Step S407: thread synchronization.
步骤S408:完成主线程的业务调度。Step S408: Complete the service scheduling of the main thread.
步骤S409:选择计算效率最高的线程对应的时间窗。Step S409: Select the time window corresponding to the thread with the highest computational efficiency.
步骤S410:根据高性能线程的时间窗更新主线程时间窗。Step S410: Update the time window of the main thread according to the time window of the high-performance thread.
步骤S411:更新时间窗组件。Step S411: Update the time window component.
时间窗组件将一个时间范围内输入的全部时间窗参数计算返回参数μ,并以此作为阈值的计算前提。The time window component calculates all the input time window parameters in a time range and returns the parameter μ, and uses this as the premise for calculating the threshold.
在一实施例中,假设业务ji在第20个时间单位到达系统,并且业务jx、jy和jz已经分别在时间单位5、10和15完成调度。然后,在第一时间窗τ=10时刻,只有业务jy和jz被系统从200抓取到210。当新业务到达系统时,业务调度器会创建三个线程。主线程用实线表示。辅助线程用虚线表示。每个线程的处理流程相同,不同之处在于它们时间窗组件的时间范围不同(即τ1、τ2、τ3)。每个线程向时间窗组件发送不同的τ值。具体来说,τ2表示主线程的时间窗时间范围,τ1=Aτ2(A>1),这意味着对于不同的时间范围,最大业务时间和最小业务时间之间的比率可能不同,从而导致三个不同的(μ1、μ2和μ3)比值。这表明,业务处理时间模式可能会在未来发生变化,因此用于描述这种模式的精确比值μ对于改善多机业务分配效率具有重要意义。在步骤S407过后,系统在数据库上完成主线程业务的调度,即步骤S408。同时根据高性能线程的τ更新τ2,即步骤S410。In one embodiment, assume that traffic ji arrives at the system at the 20th time unit, and that traffic j x , j y and j z have completed scheduling at time units 5, 10 and 15, respectively. Then, at the moment of the first time window τ=10, only the services j y and j z are captured by the system from 200 to 210 . When a new service arrives in the system, the service scheduler creates three threads. The main thread is represented by a solid line. Auxiliary threads are indicated by dashed lines. The processing flow of each thread is the same, except that the time ranges of their time window components are different (ie, τ 1 , τ 2 , τ 3 ). Each thread sends a different value of τ to the time window component. Specifically, τ 2 represents the time window time range of the main thread, τ 1 =Aτ 2 (A>1), This means that for different time horizons, the ratio between the maximum and minimum traffic times may be different, resulting in three different (μ 1 , μ 2 and μ 3 ) ratios. This shows that the business processing time pattern may change in the future, so the precise ratio μ used to describe this pattern is of great significance for improving the efficiency of multi-machine business allocation. After step S407, the system completes the scheduling of the main thread service on the database, that is, step S408. At the same time, τ 2 is updated according to the τ of the high-performance thread, that is, step S410.
更新时间窗可以为实时更新最高计算效率对应的时间窗作为第一时间窗,或者,定期更新最高计算效率对应的时间窗作为第一时间窗。在本实施例中,采取定期更新时间窗,因此实时更新会使每一次调度后都要执行参数的微调,当资源不充足时,会导致系统性能的下降,同时若当前业务处理时间处于预设处理时间范围,说明业务的处理效率和速度能够满足要求,则可保持第一时间窗的时间长度不变。The update time window may be to update the time window corresponding to the highest computing efficiency in real time as the first time window, or periodically update the time window corresponding to the highest computing efficiency as the first time window. In this embodiment, the time window is periodically updated, so the real-time update will cause fine-tuning of parameters to be performed after each scheduling. When resources are insufficient, system performance will be degraded. At the same time, if the current business processing time is at the preset value The processing time range indicates that the processing efficiency and speed of the service can meet the requirements, and the time length of the first time window can be kept unchanged.
本领域技术人员可知,时间窗大小的调整频率、幅度可以有多种形式,其目的在于提升业务调度的合理性,减少系统资源的浪费,因此,根据具有不同时间窗的并行线程的计算效率的比较来优化时间窗的方法均在本申请实施例的保护范围之内。Those skilled in the art know that the adjustment frequency and amplitude of the time window size can be in various forms, the purpose of which is to improve the rationality of service scheduling and reduce the waste of system resources. Therefore, according to the calculation efficiency of parallel threads with different time windows The methods for optimizing the time window by comparison are all within the protection scope of the embodiments of the present application.
下面,将通过流程图,解释本申请实施例中一些具体参数的计算过程。在此之前,结合引理,阐述本申请实施例计算运用已调度业务处理时间比值参数的基于互斥阈值的算法的下界。Below, the calculation process of some specific parameters in the embodiments of the present application will be explained through flowcharts. Before that, with reference to the lemma, the lower bound of the algorithm based on the mutual exclusion threshold calculated using the scheduled service processing time ratio parameter in the embodiment of the present application is described.
假设k为一台机器可同时执行的最大业务数量,其与机器的核数、处理能力中的一个或多个机器的负载能力有关。Suppose k is the maximum number of services that a machine can execute at the same time, which is related to the number of cores of the machine and the load capacity of one or more machines in the processing capacity.
公式(1)可得出传统装箱算法ALG的下界。Formula (1) can obtain the lower bound of the traditional bin packing algorithm ALG.
f(x)=max(f1(x),f2(x)) (1)f(x)=max(f 1 (x), f 2 (x)) (1)
公式(2)可得出运用已有调度处理时间比值参数的基于互斥阈值的算法的下界。Formula (2) can obtain the lower bound of the algorithm based on the mutual exclusion threshold using the existing scheduling processing time ratio parameter.
公式(3)可得出运用实际VM时间参数的基于互斥阈值的算法的下界,其中x表示所述阈值。Equation (3) yields a lower bound for a mutually exclusive threshold-based algorithm using actual VM time parameters, where x represents the threshold.
公式(4)可得出运用剩余业务处理时间参数的基于互斥阈值的算法的下界,其中表示所述剩余阈值。Equation (4) yields a lower bound for a mutually exclusive threshold-based algorithm using the remaining traffic processing time parameter, where the remaining threshold is expressed.
公式(5)可得出运用剩余业务时间比值参数的基于互斥阈值的算法的下界。Equation (5) can derive the lower bound of the mutually exclusive threshold-based algorithm using the remaining business time ratio parameter.
图5为图4一实施例微调参数组件具体计算过程的流程示意图。FIG. 5 is a schematic flowchart of a specific calculation process of the fine-tuning parameter component according to an embodiment of FIG. 4 .
假设装箱决策是基于已有业务处理时间,在考虑已有业务处理时间时,微调参数组件的目标是找到一个使式(1)最小化的阈值x,该等式表示了将x作为互斥阈值的算法性能的下界。上述下界是基于这样一个事实,即可以决定输入值,以确保在运用互斥准则及其对应的式(2)情况下和传统装箱技术(即任何一台机器可以接收任何一个业务)及其对应的式(3)情况下,所述下限能够最大化。微调组件的输入参数包括:(a)式(1)(即f1、f2)中使用的函数以及--即不执行向下去整函数时的f1;(b)一个足够小的常数δ,使得微调组件采用的二分法的左端点a非常接近但不完全等于1;(c)一个足够大的数值,用作二分法常数和的右端点;(d)前文所述常数μ和k;(e)常数N和tol,作为微调组件采用的二分法的停止条件。首先,步骤S501:从数据库检索得到历史业务处理时间比率μold和阈值xold。如果μold等于当前μ,则该程序在设定x=xold后停止;如果二者不相等,则程序将使用N或作为停止条件执行二分法,即步骤S502,找到新的阈值如果和非常接近,即步骤S503判断为真,则返回值;否则,将使用与先前二分法相同的输入值,再次执行二分法,对应步骤S504,找到新的阈值x′,区别在于其右端点等于如果步骤504返回x′值,并且即步骤S505,则将x′设置为右端点(即β),对应步骤S506以保证在上述两种情况下,流程都将返回微调阈值x′。Assuming that the packing decision is based on the existing business processing time, when considering the existing business processing time, the goal of fine-tuning the parameter component is to find a threshold x that minimizes equation (1). Threshold is a lower bound on algorithm performance. The above lower bound is based on the fact that the input value can be determined to ensure that under the condition of using the mutual exclusion criterion and its corresponding formula (2) and the traditional boxing technique (that is, any machine can receive any business) and its In the case of the corresponding formula (3), the lower limit can be maximized. The input parameters of the fine-tuning component include: (a) the function used in equation (1) (ie f 1 , f 2 ) and --that is, f 1 when the downward rounding function is not performed; (b) a sufficiently small constant δ, so that the left endpoint a of the dichotomy adopted by the fine-tuning component is very close to but not exactly equal to 1; (c) a sufficiently large Numerical value, used as the right endpoint of the dichotomy constant sum; (d) the constants μ and k described above; (e) the constants N and tol, as stopping conditions for the dichotomy employed by the trim component. First, step S501 : retrieve the historical business processing time ratio μ old and the threshold x old from the database. If μ old is equal to the current μ, the program stops after setting x = x old ; if they are not equal, the program will use N or Perform the dichotomy as a stopping condition, i.e. step S502, find a new threshold if and Very close, that is, step S503 is determined to be true, then return to Otherwise, the same input value as the previous dichotomy will be used, and the dichotomy will be performed again, corresponding to step S504, to find a new threshold x', the difference is that its right endpoint is equal to If step 504 returns the x' value, and That is, in step S505, x' is set as the right endpoint (ie, β), corresponding to step S506 to ensure that In both cases above, the flow will return to fine-tuning the threshold x'.
图6为图4另一实施例微调参数组件具体计算过程的流程示意图。FIG. 6 is a schematic flowchart of a specific calculation process of the fine-tuning parameter component according to another embodiment of FIG. 4 .
图6显示了与图5类似的流程,区别在于其装箱决策是基于剩余业务的处理时间。在考虑剩余业务时间时,微调参数组件的目标是找到一个使式(4)最小化的阈值x,该等式表示了将x作为互斥阈值的算法性能的下界。上述下界是基于这样一个事实,即可以决定输入值,以确保在运用互斥准则及其对应的式(4)情况下和传统装箱技术(即任何一台机器可以承接任何一个业务)及其对应的式(5)情况下,所述下限最大化。Figure 6 shows a similar flow to Figure 5, except that its binning decision is based on the processing time of the remaining business. When considering the remaining business time, the goal of fine-tuning the parameter component is to find a threshold x that minimizes Eq. (4), which represents a lower bound on the performance of the algorithm taking x as a mutually exclusive threshold. The above lower bound is based on the fact that the input value can be determined to ensure that under the condition of using the mutual exclusion criterion and its corresponding formula (4) and the traditional box packing technology (that is, any machine can undertake any business) and its In the case of the corresponding formula (5), the lower limit is maximized.
图6所示微调组件的输入参数与图5的输入参数相同,区别在于f1、f2和被替换为g1、g2和其中,实际上是不执行向下取整函数的g1。图6所示流程与图5所示流程基本相同,唯一的不同在于步骤S504和步骤S506,其中,“无”输出值和单一输出值不作为最终输出值,而是作为步骤S606的输入值。如果步骤S606的输入值(即x′)不超过公差,则取x′作为最终输出值。否则,将使用N或|g1-g2|<tol作为停止条件执行二分法,找到新的阈值x″,取S607的输出值作为最终输出值。The input parameters of the fine-tuning component shown in Fig. 6 are the same as those of Fig. 5, except that f 1 , f 2 and are replaced by g 1 , g 2 and in, It is actually g 1 that does not perform the round-down function. The process shown in FIG. 6 is basically the same as the process shown in FIG. 5 , with the only difference being in steps S504 and S506 , wherein the “none” output value and the single output value are not used as the final output value, but as the input value in step S606 . If the input value (ie x') of step S606 does not exceed the tolerance, take x' as the final output value. Otherwise, the dichotomy will be performed using N or |g 1 -g 2 |<tol as the stopping condition, a new threshold x″ will be found, and the output value of S607 will be taken as the final output value.
图7为图4另一实施例选择业务处理机器的具体计算过程的流程示意图。FIG. 7 is a schematic flowchart of a specific calculation process for selecting a service processing machine according to another embodiment of FIG. 4 .
本流程的目标是为系统内到来的每个业务推荐一组活动机器。输入参数包括以下三个参数:(a)互斥阈值x;(b)di(即业务ji的处理时间);与(c)表明装箱决定是基于已有业务处理时间还是剩余业务处理时间的判断。首先,步骤S701创建一个候选机器的空列表CM。然后,步骤S702迭代扫描整个活动机器列表,获取更多可用的候选机器,候选机器必须满足以下规则:对于任意两个已接收业务,它们的处理时间比值均小于x,其中分子为所述业务中的最长处理时间,分母为所述业务的最短处理时间。不论是选用每个业务的已完成处理时间还是剩余处理时间,上述规则均适用步骤S703的判断。需要注意的是,dmax表示装到机器上的所有业务中的最长处理时间,dmin表示装到机器上的所有业务中的最短处理时间。另外,R1表示介于dmax和di之间的最大值与最小值之间的比值;R2表示介于dmin和di之间的最大值与最小值之间的比值。如果是基于已完成业务的处理时间作出装箱决策,则选择执行步骤S705,否则选择执行步骤S704。假设一台机器m当前的业务装箱操作符合x条件。如果要让机器m接收业务ji并且仍然符合x条件,则需确保该业务装箱后仍然满足上述规则。当R1和R2同时满足步骤S707的判断条件时,上述规则是同等的。为了解上述规则适用的原因,请考虑以下情况:(i)当di<dmin时,如果R1适用,则意味着对于机器m中的所有业务jz,di/dz<x也适用;(ii)当di>dmax时,如果R2适用,则意味着对于机器m中的所有业务jz,dz/di<x也适用;(iii)当di∈[dmin,dmax]时,上述规则适用;否则,在业务ji到达之前的装箱必然不符合互斥阈值条件,这就与初始假设相矛盾。The goal of this process is to recommend a set of active machines for each incoming business within the system. The input parameters include the following three parameters: (a) mutual exclusion threshold x; (b) di (that is , the processing time of business ji ); and (c) indicating whether the packing decision is based on the existing business processing time or the remaining business processing judgment of time. First, step S701 creates an empty list CM of candidate machines. Then, step S702 iteratively scans the entire active machine list to obtain more available candidate machines. The candidate machines must meet the following rules: for any two received services, their processing time ratio is less than x, where the numerator is the middle of the service. The maximum processing time of , and the denominator is the minimum processing time of the business. Regardless of whether the completed processing time or the remaining processing time of each service is selected, the above rules apply to the judgment in step S703. It should be noted that d max represents the longest processing time among all the services installed on the machine, and d min represents the shortest processing time among all the services installed on the machine. In addition, R 1 represents the ratio between the maximum value and the minimum value between d max and d i ; R 2 represents the ratio between the maximum value and the minimum value between d min and d i . If the packing decision is made based on the processing time of the completed business, step S705 is selected to be executed; otherwise, step S704 is selected to be executed. Suppose that the current business boxing operation of a machine m meets the condition x. If machine m is to receive service ji and still meet the conditions of x, it is necessary to ensure that the service still satisfies the above rules after packing. When R 1 and R 2 satisfy the judgment condition of step S707 at the same time, the above rules are equivalent. To see why the above rules apply, consider the following: (i) when d i < d min , if R 1 applies, it means that for all transactions j z in machine m, d i /d z < x also applies; (ii) when d i > d max , if R 2 applies, it means that for all services j z in machine m, d z /d i <x also applies; (iii) when d i ∈ [d min , d max ], the above rules apply; otherwise, the binning before business j i arrives must not meet the mutual exclusion threshold condition, which contradicts the initial assumption.
在上述实施例中,详细阐述了业务调度方法中参数的配置过程,通过对待调度业务的处理时间与已分配至多个机器的已调度业务的处理时间逐一进行比值计算,获得与其处理时间相近的已调度业务对应的机器,进而通过将待调度业务调度至该机器,能短并行系统中使用的多台机器的总工作时间,提高并行系统的计算效率,进而减少系统能耗与开支。In the above embodiment, the configuration process of parameters in the service scheduling method is described in detail. By calculating the ratio between the processing time of the service to be scheduled and the processing time of the scheduled services that have been allocated to multiple machines one by one, the processing time of the service close to its processing time is obtained. Scheduling the machine corresponding to the service, and then by scheduling the service to be scheduled to the machine, the total working time of multiple machines used in the parallel system can be shortened, the computing efficiency of the parallel system can be improved, and the system energy consumption and expenses can be reduced.
第三方面,本申请的实施例提供了一种业务调度装置,用于执行第一方面和/或第二方面的实施例提供的业务调度方法。In a third aspect, the embodiments of the present application provide a service scheduling apparatus for executing the service scheduling method provided by the embodiments of the first aspect and/or the second aspect.
第四方面,本申请的实施例提供了一种电子设备,包括一个或多个处理器;存储装置,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面所述的业务调度方法和/或第二方面所述的业务调度方法。In a fourth aspect, embodiments of the present application provide an electronic device, including one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors , so that one or more processors implement the service scheduling method described in the first aspect and/or the service scheduling method described in the second aspect.
第五方面,本申请的实施例还提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行如上所述第一方面和/或第二方面的方法。In a fifth aspect, embodiments of the present application further provide a computer-readable storage medium storing computer-executable instructions for executing the method of the first aspect and/or the second aspect as described above. .
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The apparatus embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。移动终端设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载终端设备、可穿戴设备、超级移动个人计算机、上网本、个人数字助理、CPE、UFI(无线热点设备)等;本发明实施方案不作具体限定。Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, functional modules/units in the systems, and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components Components execute cooperatively. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit . Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules or other data flexible, removable and non-removable media. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or may Any other medium used to store desired information and which can be accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media, as is well known to those of ordinary skill in the art . The mobile terminal device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle terminal device, a wearable device, a super mobile personal computer, a netbook, a personal digital assistant, a CPE, a UFI (wireless hotspot device), etc.; Specific restrictions.
以上是对本申请的较佳实施进行了具体说明,但本申请并不局限于上述实施方式,熟悉本领域的技术人员在不违背本申请精神的前提下还可作出种种的等同变形或替换,这些等同的变形或替换均包含在本申请权利要求所限定的范围内。The above is a specific description of the preferred implementation of the application, but the application is not limited to the above-mentioned embodiments. Those skilled in the art can also make various equivalent deformations or replacements on the premise of not violating the spirit of the application. These Equivalent modifications or substitutions are included within the scope defined by the claims of the present application.
Claims (11)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011423456.0A CN112631746A (en) | 2020-12-08 | 2020-12-08 | Service scheduling method and device, electronic equipment and storage medium |
PCT/CN2020/141676 WO2022121041A1 (en) | 2020-12-08 | 2020-12-30 | Service scheduling method and apparatus, and electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011423456.0A CN112631746A (en) | 2020-12-08 | 2020-12-08 | Service scheduling method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112631746A true CN112631746A (en) | 2021-04-09 |
Family
ID=75308744
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011423456.0A Pending CN112631746A (en) | 2020-12-08 | 2020-12-08 | Service scheduling method and device, electronic equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112631746A (en) |
WO (1) | WO2022121041A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114385336A (en) * | 2021-12-27 | 2022-04-22 | 同济大学 | Anti-interference scheduling method and device for streaming big data processing tasks |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060288346A1 (en) * | 2005-06-16 | 2006-12-21 | Santos Cipriano A | Job scheduling system and method |
CN107800648A (en) * | 2017-10-17 | 2018-03-13 | 北京邮电大学 | Data packet dispatching method and device |
CN110247979A (en) * | 2019-06-21 | 2019-09-17 | 北京邮电大学 | A kind of scheduling scheme determines method, apparatus and electronic equipment |
CN111400050A (en) * | 2020-03-30 | 2020-07-10 | 绿盟科技集团股份有限公司 | Method and device for allocating resources to execute tasks |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11166057B2 (en) * | 2016-11-10 | 2021-11-02 | University Of Louisiana At Lafayette | System for high performance on-demand video transcoding |
CN110336859B (en) * | 2019-06-06 | 2020-04-07 | 广州市玄武无线科技股份有限公司 | Task scheduling system under multi-tenant environment |
-
2020
- 2020-12-08 CN CN202011423456.0A patent/CN112631746A/en active Pending
- 2020-12-30 WO PCT/CN2020/141676 patent/WO2022121041A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060288346A1 (en) * | 2005-06-16 | 2006-12-21 | Santos Cipriano A | Job scheduling system and method |
CN107800648A (en) * | 2017-10-17 | 2018-03-13 | 北京邮电大学 | Data packet dispatching method and device |
CN110247979A (en) * | 2019-06-21 | 2019-09-17 | 北京邮电大学 | A kind of scheduling scheme determines method, apparatus and electronic equipment |
CN111400050A (en) * | 2020-03-30 | 2020-07-10 | 绿盟科技集团股份有限公司 | Method and device for allocating resources to execute tasks |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114385336A (en) * | 2021-12-27 | 2022-04-22 | 同济大学 | Anti-interference scheduling method and device for streaming big data processing tasks |
Also Published As
Publication number | Publication date |
---|---|
WO2022121041A1 (en) | 2022-06-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110297699B (en) | Scheduling method, scheduler, storage medium and system | |
US8695009B2 (en) | Allocating tasks to machines in computing clusters | |
CN111225050B (en) | Cloud computing resource allocation method and device | |
CN103699433B (en) | One kind dynamically adjusts number of tasks purpose method and system in Hadoop platform | |
US20160294722A1 (en) | Method And Apparatus For Provisioning Resources Using Clustering | |
EP3932025B1 (en) | Computing resource scheduling method, scheduler, internet of things system, and computer readable medium | |
CN113033800B (en) | Distributed deep learning methods, devices, parameter servers and main working nodes | |
CN114595049B (en) | Cloud edge cooperative task scheduling method and device | |
CN107832129B (en) | A dynamic task scheduling optimization method for distributed stream computing system | |
WO2017092377A1 (en) | Dynamic resource allocation method and device in mobile communication system | |
CN111756654B (en) | A Reliability-Based Resource Allocation Method for Large-Scale Virtual Networks | |
WO2021027783A1 (en) | Method, apparatus, device, and system for allocating radio frequency resources, and storage medium | |
CN103236989A (en) | Cache control method, devices and system in content delivery network | |
Li et al. | Digital twin-enabled service satisfaction enhancement in edge computing | |
CN110677854A (en) | Method, apparatus, device and medium for carrier frequency capacity adjustment | |
CN112631746A (en) | Service scheduling method and device, electronic equipment and storage medium | |
Jia et al. | A highly efficient data locality aware task scheduler for cloud-based systems | |
WO2016062105A1 (en) | Radio resource allocation method and radio network controller | |
CN112399596B (en) | Method, apparatus, device, system and storage medium for allocating radio frequency resources | |
CN106936492B (en) | Message Scheduling Method of Multi-Beidou Card Commander | |
CN108595251B (en) | Dynamic graph updating method, device, storage engine interface and program medium | |
CN117933490B (en) | Airport surface dragging scheduling optimization method, electronic device and storage medium | |
CN106933882B (en) | Big data increment calculation method and device | |
CN118349333A (en) | Task scheduling method, system, device and readable storage medium | |
US10649821B2 (en) | Method, system and apparatus for dynamically allocating event data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |