WO2023246330A1 - Resource adjustment method and apparatus, computing device cluster, and readable storage medium - Google Patents

Resource adjustment method and apparatus, computing device cluster, and readable storage medium Download PDF

Info

Publication number
WO2023246330A1
WO2023246330A1 PCT/CN2023/092337 CN2023092337W WO2023246330A1 WO 2023246330 A1 WO2023246330 A1 WO 2023246330A1 CN 2023092337 W CN2023092337 W CN 2023092337W WO 2023246330 A1 WO2023246330 A1 WO 2023246330A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
resource
target
target task
information
Prior art date
Application number
PCT/CN2023/092337
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 WO2023246330A1 publication Critical patent/WO2023246330A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • 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]

Definitions

  • the present application relates to the field of communication technology, and in particular, to a resource adjustment method, device, computing device cluster and readable storage medium.
  • indicators such as central processing unit (CPU) usage, memory usage, disk read and write rates, and traffic inflow/outflow rates are monitored; when a certain indicator is monitored to meet the triggering conditions, the current The resources no longer match the business needs, and the resources are increased or decreased according to a fixed value.
  • CPU central processing unit
  • each of the above indicators represents the current resource occupancy
  • a resource adjustment method includes: obtaining task information for each of multiple tasks, which includes a target task and at least one to-be-executed task; according to the multiple tasks
  • the task information of the target task is determined to determine the resource adjustment strategy of the target task; when the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition, adjust the resource adjustment strategy of the instance used to run the target task based on the resource adjustment strategy.
  • This method can comprehensively perceive the multiple tasks, and determine the resource adjustment strategy for the target task based on the task information of the multiple tasks with high accuracy.
  • the multiple tasks also include tasks to be executed. Therefore, when resource adjustment is performed based on the resource adjustment strategy of the target task, the accuracy of resource adjustment is higher.
  • the task information includes resource occupancy and resource occupancy duration. Therefore, this method can obtain more accurate resource occupancy status and improve the accuracy of determining the resource adjustment strategy for the target task.
  • determining the resource adjustment strategy of the target task based on the task information of multiple tasks includes: calculating the resource requirements of the target task based on the task information of the multiple tasks and the reference execution time of the multiple tasks; According to the resource requirements of the target task and the amount of available resources of the target task, the resource adjustment strategy of the target task is determined. The resource adjustment strategy is used to make the adjusted amount of available resources of the target task meet the resource requirements of the target task.
  • this method can sense in advance the amount of resources required to complete the target task. When resource adjustment is required, the time required from sensing the need for resource adjustment to completing the resource adjustment is shorter in this method, thereby reducing the time required for resource adjustment and improving the efficiency of resource adjustment.
  • obtaining the task information of multiple tasks includes: obtaining the task type of each task in the multiple tasks; based on the task type of each task, querying the corresponding relationship between the task type and the task information, and obtaining each Task information of the task, where the correspondence between the task type and the task information is obtained based on the configuration information of the task type and task information.
  • querying the corresponding relationship between task types and task information based on each task type the task information of each task is obtained. This method obtains task information in a simpler and more efficient manner.
  • obtaining task information of multiple tasks includes: obtaining the task type of each task in the multiple tasks; obtaining the task information of each task based on the historical execution information corresponding to each task type.
  • the task type is any one of obtaining metadata, slicing, transcoding, or merging.
  • a resource adjustment device which device includes:
  • the acquisition unit is used to acquire task information of multiple tasks.
  • the multiple tasks include a target task and at least one task to be executed.
  • the task information includes task information of each task;
  • the determination unit is used to determine the resource adjustment strategy of the target task based on the task information of multiple tasks;
  • An adjustment unit configured to adjust at least one of the number and specifications of instances used to run the target task based on the resource adjustment policy when the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition. kind.
  • the device further includes: a receiving unit configured to receive user-configured resource update limits, where the resource update limits include at least one of a maximum cost and a maximum number of instances running the target task; adjust Unit used to adjust the number and size of instances used to run target tasks based on the resource adjustment policy and the resource update limit. at least one of the grids.
  • the target task satisfies the first resource adjustment condition, including: the expected execution time of the target task is greater than the reference execution time of the target task.
  • the target task is a task to be executed or a task being executed.
  • the task information includes resource occupancy and resource occupancy duration.
  • the determination unit is used to calculate the resource requirements of the target task based on the task information of the multiple tasks and the reference execution time of the multiple tasks; based on the resource requirements of the target task and the amount of available resources of the target task , determine the resource adjustment strategy of the target task, which is used to make the adjusted available resource amount of the target task meet the resource requirements of the target task.
  • the acquisition unit is used to obtain the task type of each task in multiple tasks; based on the task type of each task, query the correspondence between the task type and task information to obtain the task information of each task, The correspondence between the task type and task information is obtained based on the configuration information of the task type and task information.
  • the task type is any one of obtaining metadata, slicing, transcoding, or merging.
  • a computing device cluster includes at least one computing device.
  • Each computing device includes a processor and a memory; the processor of the at least one computing device is used to execute a program stored in the memory of the at least one computing device. Instructions are provided to cause the computing device cluster to execute any one of the resource adjustment methods of the first aspect.
  • processors there are one or more processors and one or more memories.
  • the memory may be integrated with the processor, or the memory may be provided separately from the processor.
  • the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor, or can be set in different On the chip, this application does not limit the type of memory and the arrangement of the memory and the processor.
  • ROM read-only memory
  • a chip including a processor for calling and running instructions stored in the memory, so that at least one computing device installed with the chip executes any resource adjustment method in the first aspect. .
  • the chip also includes: an input interface, an output interface and the memory, the input interface, the output interface, a processing
  • the processor and memory are connected through internal connection paths.
  • Figure 1 is a schematic diagram of the implementation environment of a resource adjustment method provided by an embodiment of the present application
  • Figure 2 is a schematic diagram of the implementation environment of another resource adjustment method provided by an embodiment of the present application.
  • Figure 3 is a flow chart of a resource adjustment method provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of an arrangement result provided by an embodiment of the present application.
  • Figure 5 is a schematic process diagram of a resource adjustment method provided by an embodiment of the present application.
  • Figure 6 is a schematic diagram of a resource arrangement process provided by an embodiment of the present application.
  • Figure 7 is a schematic diagram of the CPU usage of a container provided by an embodiment of the present application.
  • Figure 8 is a schematic diagram of the completion time of a transcoding task provided by an embodiment of the present application.
  • Figure 9 is a schematic structural diagram of a resource adjustment device provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • Figure 11 is a schematic structural diagram of a computing device cluster provided by an embodiment of the present application.
  • Figure 12 is a schematic structural diagram of another computing device cluster provided by an embodiment of the present application.
  • Cloud is a technology that provides users with software resources and virtual hardware resources in the form of the Internet by virtualizing physical hardware resources.
  • software resources and virtual hardware resources are simply called resources.
  • the cloud can provide users with resources that are suitable for the business based on their business needs.
  • resources include computing resources, network resources, storage resources, etc.
  • computing resources include virtual machines, containers and bare metal servers. It should be noted that this application does not limit the specific types of resources.
  • the resource adjustment method can be used to adjust the provided resources according to the changed business needs. Resource adjustment is performed by increasing or decreasing resources.
  • the resource adjustment method can also be called the auto scaling (AS) method of resources.
  • unplanned and irregular business needs by configuring trigger conditions for indicators such as CPU usage, memory usage, disk read and write rates, and traffic inflow/outflow rates, the above indicators are monitored to achieve Resource adjustment. For example, when it is monitored that one of the above indicators meets the triggering condition, it is determined that the current resources are no longer suitable for the business needs, and the resources are increased or decreased according to a fixed value to realize resource adjustment.
  • unplanned and irregular business needs may refer to business needs in scenarios characterized by large amounts of concurrent tasks, sudden tasks, and unpredictable tasks.
  • the above scenarios include but are not limited to offline video transcoding scenarios or news service scenarios.
  • Each indicator monitored in the related technology indicates the current resource occupancy.
  • the related technology is in the business Only after the tasks corresponding to the requirements have been executed by the corresponding resources can the above indicators be monitored, and then when a certain indicator meets the triggering condition, resource adjustment is triggered.
  • resource adjustment is triggered when an indicator meets the triggering condition.
  • the resource adjustment is based on the current resource occupancy. Adjustments are made less accurately.
  • the time from the change in business requirements to the re-adaptation of resources and business needs in related technologies is long, and the adjustment efficiency is low.
  • the embodiment of the present application provides a resource adjustment method, which can improve the accuracy of resource adjustment.
  • the method can be applied to the implementation environment shown in Figure 1.
  • the implementation environment includes but is not limited to the first module 101, the second module 102, the third module 103, the fourth module 104, the fifth module Module 105, sixth module 106 and seventh module 107.
  • the first module 101 is communicatively connected with the second module 102 and the sixth module 106 respectively.
  • the second module 102 is also communicatively connected with the third module 103, the fourth module 104 and the fifth module 105.
  • Each module of the communication connection can exchange information, and the communication connection can be implemented based on a wired network or a wireless network, which is not limited in the embodiments of the present application.
  • the sixth module 106 is used to obtain the tasks to be executed stored in the seventh module 107, and the sixth module 106 is also used to obtain the tasks being executed in the fifth module 105 and the amount of available resources in the fifth module 105. , the resources corresponding to the amount of available resources are used to run tasks.
  • the sixth module 106 is also configured to report the acquired task and the amount of available resources of the task to the first module 101 .
  • the first module 101 is used to obtain the task information and reference execution duration of the task, determine the resource requirements of the task based on the obtained task information and reference execution duration, and determine the resource adjustment strategy of the task based on the task's resource requirements and the amount of available resources.
  • the first module 101 is also used to adjust the amount of available resources for the task based on the resource adjustment policy of the task, or to send a control instruction to the second module 102 that manages resources, so that the second module 102 adjusts the amount of resources for the task based on the control instruction.
  • the amount of available resources is adjusted.
  • the second module 102 is also used to obtain the backup resources in the third module 103 and the configuration information stored in the fourth module 104, and configure the backup resources based on the configuration information to generate new available resources, thereby realizing the optimization of available resources. Quantity adjustment.
  • FIG. 2 is a schematic diagram of the implementation environment of another resource adjustment method provided by an embodiment of the present application.
  • the first module 101 may be a task resource control module, and the task resource module is used to implement the functions of the first module 101 .
  • the second module 102 may be a control center, which is used to implement the functions of the second module 102 .
  • the third module 103 is a node pool, which includes at least one node, and one node is a spare resource.
  • the fourth module 104 is an image warehouse, which is used to store at least one image, and one image is the configuration information of an execution program.
  • the fifth module 105 is a workload (deployment). The workload includes at least one node that has been configured based on the configuration information.
  • Each configured node includes at least one instance.
  • the resources provided by this instance are the available resources corresponding to the tasks to be executed, and the available resources are used to run the tasks to be executed. Instances of different specifications provide different resources.
  • the instance includes at least one of a physical host, a virtual machine, or a container (pod).
  • the sixth module 106 is a cloud monitoring module.
  • the cloud monitoring module is used to implement the functions of the sixth module 106. That is, the cloud monitoring module is used to obtain the tasks to be executed stored in the seventh module 107 and the tasks stored in the fifth module 105. The task being executed and the amount of available resources for the task in the fifth module 105.
  • the seventh module 107 is a task queue, which is used to store tasks to be executed.
  • Each module shown in the above-mentioned FIG. 1 and FIG. 2 may be included in one device or multiple devices.
  • the task resource control module, control center, node pool, mirror warehouse, workload and cloud monitoring are all included in the cloud container engine. This task queue is included in other devices besides the cloud container engine.
  • each Each module is divided only by function and is not used to limit the implementation of each module.
  • Each module can be merged based on needs.
  • the sixth module 106 can be merged with the first module 101 so that the first module 101 has the function of the sixth module 106 . That is to say, the first module 101 can obtain the tasks to be executed stored in the seventh module 107, and can also obtain the tasks being executed in the fifth module 105 and the amount of available resources for the tasks in the fifth module 105.
  • each of the above implementation environments may include multiple modules, which is not limited in the embodiments of the present application.
  • the number of tasks, the number of instances, the number of nodes, and the number of mirrors shown in Figure 2 are only for illustration, and the embodiments of the present application are not limited thereto.
  • the resource adjustment method provided by the embodiment of the present application can be shown in Figure 3.
  • the method will be described with reference to the implementation environment shown in Figure 1 or Figure 2.
  • the method is applied to at least one computing device.
  • Each module shown in Figure 1 or Figure 2 may be included in one computing device, or may be included in multiple computing devices respectively.
  • the method includes but is not limited to S301 to S303.
  • the multiple tasks include a target task and at least one task to be executed.
  • the task information includes task information of each task.
  • S301 may be executed by the first module.
  • the method before obtaining the task information of multiple tasks, the method further includes: obtaining at least one task flow based on business requirements, and any task flow includes at least one subtask; obtaining each task included in the at least one task flow.
  • the unexecuted subtasks and/or the subtasks that are being executed are obtained, and multiple tasks are obtained based on the obtained subtasks.
  • the first module is the task resource control module shown in Figure 2.
  • the task resource control module sends a first request to obtain unexecuted tasks to the task queue through the cloud monitoring module, and receives the task queue returned in response to the first request. Subtasks that have not been executed.
  • the task resource control module also sends a second request to obtain the executing subtask to the workload through the cloud monitoring module, and receives the executing subtask returned by the workload in response to the second request.
  • the cloud monitoring module can also actively send unexecuted subtasks and/or subtasks that are being executed to the task resource control module. In this embodiment, the cloud monitoring module does not actively send unexecuted subtasks and/or subtasks to the task resource control module. Or limit the timing of the subtask being executed.
  • the first way to obtain the task type is to send a request to the module that stores the task type of the subtask, and receive the task type of the subtask sent by other modules in response to the request.
  • the first module may send a third request to the seventh module that stores at least one subtask to be executed.
  • the third request is used to request to obtain the task type of each subtask to be executed.
  • the first module may also send a fourth request to the fifth module for executing the subtask, the fourth request is used to request to obtain the task type of the subtask being executed, and receive the currently executing subtask returned by the fifth module in response to the fourth request.
  • the second method of obtaining the task type is to obtain the task types of multiple subtasks by receiving the task types of each subtask actively sent by the module that stores the task type.
  • the first module can receive the task type of each sub-task to be executed actively sent by the seventh module. For example, when the seventh module sends at least one subtask to be executed to the first module, it also sends the task type of each subtask to be executed to the first module.
  • the first module may also receive the task type of the subtask being executed actively sent by the fifth module. For example, when the fifth module sends the subtask being executed to the first module, it also sends the task type of the subtask being executed to the first module.
  • the task information and reference execution time of the multiple tasks are obtained.
  • the first module for executing S301 also obtains the amount of available resources of the target task.
  • the embodiments of this application do not limit the order in which task information, reference execution duration, and available resources are obtained. Next, the process of obtaining task information, reference execution time, and available resources is explained respectively.
  • Methods of obtaining task information for multiple tasks include but are not limited to the following method 1 of obtaining task information and method 2 of obtaining task information.
  • the first method of obtaining task information is to obtain the task type of each task in multiple tasks; based on the historical execution information corresponding to each task type, obtain the task information of each task.
  • the historical execution information corresponding to the any task type includes the resource occupancy amount and resource occupancy duration for completing at least one sub-task of the any task type.
  • obtain the resource occupancy and resource occupancy time for completing multiple subtasks of any task type and use the average value of the resource occupancy for completing the multiple subtasks as the corresponding value for any task type.
  • the average resource occupancy time for completing the multiple subtasks is used as the resource occupancy time corresponding to any task type.
  • the resource occupancy and resource occupancy duration corresponding to any task type can be used as the task information of the sub-tasks of any task type, so that the task information of each sub-task can be obtained based on the task type of each sub-task. Task information, get the task information of each task.
  • the resource occupancy of each sub-task included in the any task is added to obtain the resources of any task. Occupancy, add the resource occupancy time of each sub-task to get the resource occupancy time of any task.
  • the task information of any one of the tasks includes but is not limited to the resource occupancy amount and the resource occupancy duration.
  • the resource occupancy of any task refers to the amount of available resources required to execute the task.
  • the resource occupancy time of any task refers to the time the available resources are occupied when executing the task. long.
  • the task information of any task includes but is not limited to the resource occupancy amount and resource occupancy duration of each subtask included in the any task.
  • the user configures parent task information for the parent task.
  • Parent task information includes but is not limited to the resource usage and resource usage duration of the parent task.
  • the resource occupancy of the parent task refers to the amount of available resources required to execute the parent task, and the resource occupancy time of the parent task refers to the time the available resources are occupied when the parent task is executed.
  • Configuration information of task type and task information is generated based on the parent task information. For example, according to at least one execution stage of the parent task, the parent task is split into at least one subtask, one subtask corresponds to one execution stage, and one execution stage corresponds to one task type; based on the parent task information and the task type of each subtask , configure task information for subtasks of each task type.
  • the parent task information includes the resource occupancy amount and resource occupancy duration of the parent task
  • configure task information for the sub-tasks of each task type including: changing the parent task
  • the resource occupancy and resource occupancy time of the task are split according to the task type, and the resource occupancy and resource occupancy time of each sub-task are obtained.
  • the resource occupancy of a subtask refers to the amount of available resources required to execute the subtask
  • the resource occupancy time of the subtask refers to the time the available resources are occupied when executing the subtask.
  • each task type has a weight factor, and the resource usage and resource usage duration of the parent task are split according to the weight factor of each task type.
  • the information generated when configuring task information for subtasks of each task type is called configuration information of the task type and task information.
  • configuration information of task type and task information is the information generated when the user configures task information for subtasks of each task type.
  • the correspondence between the task type and the task information is stored in advance in the first module for performing S301. That is to say, after the first module obtains the task type of each task, it can directly query the corresponding relationship between the stored task type and task information to obtain the task information of each task.
  • the method of obtaining the correspondence between the task type and the task information is relatively flexible.
  • the task information of each task is obtained by querying the corresponding relationship between the task type and the task information, and the efficiency of obtaining the task information is high.
  • the first module also obtains the amount of available resources for the target task, and the amount of available resources is the amount of available resources used to complete the target task.
  • Obtaining the amount of resources available for the target task includes: determining the amount of unoccupied resources in the reference resource amount, and using the unoccupied resource amount as the amount of available resources for the target task.
  • the amount of reference resources is the amount of available resources used to complete the business requirements. Resources. That is, the reference resource amount is the available resource amount used to complete the parent task issued by the user.
  • the reference resource amount can be set by users according to their business needs. For example, in the case where the available resources are resources provided by the instance, the amount of available resources is the amount of resources provided by the instance.
  • available resources for completing business requirements include resources provided by Instance 1 to Instance 4 in Node 1, and resources provided by Instance 1 to Instance 4 in Node 2.
  • Reference resources The amount is the amount of resources provided by 8 instances. When none of these eight instances are occupied, the resources provided by these eight instances are all available resources for the target task, and the amount of resources available for the target task is the amount of resources provided by the eight instances.
  • the available resource is occupied. Since the subtask being executed will be completed after a period of time, the occupied available resources can become unoccupied available resources after the subtask is completed. In other words, at different points in time, the amount of available resources for the target task can be different. For example, at the point in time when the operation of obtaining the available resource amount of the target task is performed, some available resources are being occupied, then the available resource amount of the target task is the difference between the reference resource amount and the occupied available resource amount. After a period of time, the subtasks in the occupied available resources are completed and there are no occupied available resources. In this case, the amount of available resources of the target task is equal to the amount of reference resources.
  • S302 may be executed by the first module. For example, determining the resource adjustment strategy of the target task based on the task information of multiple tasks includes S3021 and S3022.
  • S3021 Calculate the resource requirements of the target task based on the task information of multiple tasks and the reference execution time of multiple tasks.
  • calculating the resource requirements of the target task based on the task information of multiple tasks and the reference execution duration of the multiple tasks includes: calculating the target task based on the initial resource amount and the task information of the multiple tasks.
  • the expected execution time of the target task based on the relationship between the expected execution time of the target task and the reference execution time of the target task, the initial The resource amount is adjusted so that the calculated expected execution time of the target task is no longer than the reference execution time of the target task; the resource requirements of the target task are obtained based on the adjusted initial resource amount.
  • the initial resource amount may be the available resource amount of the target task or a preset available resource amount. For example, if the amount of available resources of the target task at each point in time during the first execution duration is different, the initial amount of resources can be the maximum value of the amount of available resources of the target task at each point in time, that is, the initial amount of resources.
  • the resource amount can be equal to the reference resource amount.
  • the expected execution time of a target task refers to the expected time from the start of execution to the completion of the target task.
  • arranging resources for each task based on the resource occupancy and resource occupancy duration of each task means: on a two-dimensional plane with the resource amount and time as the coordinate axes, based on the resource occupancy of each task.
  • Resource occupancy and resource occupancy duration are used to arrange resources for each task; and when arranging resources for each task, the total amount of resource occupancy corresponding to each time point does not exceed the initial resource amount, and the resource occupancy corresponding to each time point is The ratio is greater than or equal to the threshold.
  • the threshold can be set based on experience or actual needs, which is not limited in the embodiments of this application. For example, the threshold is 0.5.
  • the any task includes one or more subtasks, and arranging resources for any one of the tasks means arranging resources for each of the subtasks included in any of the tasks. cloth.
  • the process of arranging resources for each sub-task is the same as the above-mentioned resource arrangement for each task, and will not be described again here.
  • the multiple subtasks included in the multiple tasks have an execution order, and arranging resources for each subtask included in the multiple tasks includes: arranging resources for each subtask according to the execution order of each subtask.
  • the execution order of each sub-task can be determined based on the order of each sub-task in the task flow, which is not limited in the embodiments of the present application.
  • the initial resource amount is adjusted based on the relationship between the expected execution time of the target task and the reference execution time of the target task, and then the resource requirements of the target task are obtained, including but Not limited to the following situations A and B.
  • the expected execution time of the target task is greater than the reference execution time of the target task.
  • the resource adjustment strategy for the target task is determined to increase the amount of available resources of the target task, so that the increased amount of available resources of the target task is not less than Resource requirements for the target task.
  • the resource adjustment strategy may also include the difference between the resource demand and the available resource amount. That is, the resource adjustment strategy of the target task is to increase the target task according to the difference between the resource demand of the target task and the available resource amount of the target task. the amount of available resources.
  • the resource requirements of the target task can also be equal to the amount of available resources for the target task.
  • the resource adjustment strategy of the target task is to keep the amount of available resources of the target task unchanged.
  • this method can sense in advance the amount of resources required to complete the target task.
  • the time required from sensing the need for resource adjustment to completing the resource adjustment is shorter in this method, thereby reducing the time required for resource adjustment and improving the efficiency of resource adjustment.
  • S303 may be executed by the first module.
  • the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition, it means that the amount of available resources of the target task cannot meet the resource requirements of the target task, and it is necessary to The amount of available resources for the target task is adjusted.
  • the amount of resources available for a target task can be the amount of resources provided by the instance used to run the target task.
  • the target task satisfies the first resource adjustment condition, including: the expected execution time of the target task is greater than the reference execution time of the target task.
  • the expected execution time of the target task please refer to S3021, which will not be described again here.
  • the instance running the target task satisfies the second resource adjustment condition, including: the CPU usage of the instance running the target task is higher than the usage threshold.
  • the occupancy threshold can be set based on demand or actual experience, which is not limited in the embodiments of the present application.
  • the first module executes a resource adjustment strategy based on the target task to adjust at least one of the instances, quantity, and specifications of the target task.
  • the first module sends a control instruction to the second module, which is a module that manages the number and specifications of instances.
  • the control instruction is used to instruct the second module to use resources based on the target task.
  • the adjustment strategy adjusts at least one of the number and specifications of instances used to run the target task.
  • the first module and the second module may belong to the same device or different devices.
  • the first module is the task resource control module
  • the second module is the control center. Then when the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition, the task resource control module sends a control instruction to the control center, and the control instruction is used to instruct the control center to adjust resources based on the target task.
  • the policy adjusts at least one of the number and specifications of instances used to run the target task.
  • the method further includes: receiving a resource update limit configured by the user, where the resource update limit includes at least one of a maximum cost and a maximum number of instances running the target task; adjusting the usage based on the resource adjustment policy.
  • Adjusting at least one of the number and specifications of instances for running the target task includes: adjusting at least one of the number and specifications of the instances for running the target task based on the resource adjustment policy and the resource update limit.
  • the resource adjustment strategy of the target task is first determined, and then the resource adjustment is performed based on the resource adjustment strategy of the target task.
  • the accuracy is higher and the resource adjustment method is more flexible.
  • increasing the number of instances used to run the target task includes: Obtain a node from the point pool and copy the image from the image warehouse to the acquired node to obtain a new instance. Reduce the number of instances used to run target tasks, including deleting instances included in the workload. Adjust the specifications of the instance used to run the target task, including: obtaining a node from the node pool, copying the image from the image warehouse to the obtained node to obtain a new instance, and the new instance is used to replace the instance in the current workload, Adjust the instance specifications.
  • the method further includes: for any subtask included in the target task, determining a target instance corresponding to any subtask in the adjusted instance used for the target task, Execute any subtask through the target instance.
  • the instance used to execute the subtask can be controlled. Rather than sending individual subtasks to the workload, the workload determines the instance used to perform each subtask, allowing precise control over the instances used to perform each subtask.
  • the operation of determining a target instance corresponding to any subtask and executing the any subtask through the target instance is performed by the first module.
  • task information of multiple tasks is obtained, and the resource adjustment strategy of the target task in the multiple tasks is determined based on the task information of the multiple tasks.
  • This method can comprehensively perceive the multiple tasks, and determine the resource adjustment strategy for the target task based on the task information of the multiple tasks with high accuracy. Therefore, when resource adjustment is performed based on the resource adjustment strategy of the target task, the accuracy of resource adjustment is high.
  • Figure 5 is a schematic process diagram of a resource adjustment method provided by an embodiment of the present application.
  • the business requirements include N offline video transcoding tasks, which are transcoding task 1, transcoding task 2, ..., and transcoding task N, where N is a positive integer.
  • N task streams are obtained based on the N offline video transcoding tasks.
  • the i-th task stream includes four subtasks, namely the metadata acquisition task i and the slicing task. i, transcoding task i and merging task i, where i is an integer greater than 0 and less than or equal to N.
  • the task types of these four subtasks are obtaining metadata, slicing, transcoding and merging respectively.
  • the N task flows are stored in the task queue in the order of each sub-task, as shown in Figure 5.
  • the sub-tasks stored in the task queue include: Get Metadata Task 1, Slice Task 1, Get Metadata Task 2, Get metadata task 3, transcoding task 1, slicing task 2, ..., merge task N.
  • each sub-task in the task queue is a sub-task to be executed.
  • the instances in the workload are containers, and each container is not occupied, that is, each container is idle.
  • the task resource control module obtains the subtasks to be executed in the task queue, and obtains multiple tasks based on the obtained subtasks to be executed. For example, based on the task type of each subtask, subtasks of the same task type are regarded as one obtained task.
  • the target task can be any one of the plurality of tasks.
  • the target task in the plurality of tasks is a transcoding task.
  • the transcoding task includes transcoding task 1 to transcoding task N.
  • the available resources of the transcoding task include container 1, container 2, container 3, ..., and container M in Figure 5, that is, the amount of available resources for the transcoding task is M, and M is a positive integer.
  • the task resource control module can obtain the task information of each task in the multiple tasks. For example, the task resource control module first obtains the task type of each task, and then obtains the task information of each task based on the task type of each task. For example, the task resource control module obtains the task information of each task based on the historical execution information corresponding to each task type, or obtains the task information of each task by querying the correspondence between the task type and the task information.
  • the task resource control module also stores task type-metadata-task information. corresponding relationship.
  • Metadata is the data of the execution object of business requirements.
  • metadata includes but is not limited to the resolution, duration, and bit rate of the video.
  • the metadata of each video may be different, so that for multiple subtasks of the same type that are respectively performed on multiple videos, the task information of the multiple subtasks may be different. For example, for two videos with different resolutions, if the resource occupancy of the transcoding subtask performed on the two videos is the same, the resource occupancy of the transcoding subtask performed on the video with a higher resolution will be the same. The duration is longer. When the resource occupancy time of the transcoding subtask performed on the two videos is the same, the resource occupancy of the transcoding subtask performed on the video with a higher resolution is higher.
  • the task information includes resource occupancy and resource occupancy duration.
  • the task resource control module arranges resources for each task based on the resource occupancy and resource occupancy duration of each task.
  • the task resource control module arranges resources for each task according to the execution order of each task. Since the task resource control module can also store the corresponding relationship between task type-metadata-task information, the task resource control module can arrange the task of obtaining metadata to be executed first, so that it can further query the task type-metadata based on the obtained metadata. —The corresponding relationship between task information, and thus more accurate task information can be obtained.
  • Figure 6 is a schematic diagram of a resource arrangement process provided by an embodiment of the present application.
  • the task resource control module obtains the resource occupancy and resource occupancy time of each sub-task; classifies each sub-task; based on the resource occupancy and resource occupancy time of each sub-task, classifies each sub-task Arrange resources.
  • the amount of available resources at each time point is used as the initial resource amount corresponding to each time point.
  • all sub-tasks for obtaining metadata are arranged first, so that each sub-task for obtaining meta-data is executed first, and the obtained meta-data can be used to obtain tasks for other sub-tasks. information.
  • arrange the subtasks of the slices If the resource occupation time of the subtasks of a certain slice is short, you can first arrange the transcoding subtasks that belong to the same task flow as the subtasks of the slice, so that the task flow can be Tasks are completed earlier.
  • the expected execution time of the target task can be calculated. Therefore, when the expected execution time of the target task and the reference execution time of the target task are different, the initial resource amount can be adjusted based on the relationship between the expected execution time of the target task and the reference execution time of the target task, so that through Resource Arrangement Plan The calculated expected execution time of the target task is not greater than the reference execution time of the target task.
  • Figure 6 only shows the arrangement results of some tasks, and is not used to limit the task types and number of tasks for performing resource arrangement.
  • the resource requirement of the target task obtained according to the arrangement result in Figure 6 is greater than the amount of available resources of the target task.
  • the resource requirement may be M+1 as shown in Figure 5.
  • the task resource control module sends a control instruction to the control center, instructing the control center to adjust the amount of available resources so that the adjusted amount of available resources is not less than M+1.
  • the control center generates container M+1 based on the received control instructions to adjust the amount of available resources.
  • the transcoding task includes 40 transcoding subtasks, and the available resources of the 40 subtasks are 1 container, that is, the available resources of the target task are 1.
  • the CPU occupancy of the container in the method of the related art and the method provided by the embodiment of the present application is shown in Figure 7.
  • Figure 7 is a schematic diagram of the CPU usage of a container provided by an embodiment of the present application.
  • (1) in Figure 7 corresponds to the CPU occupancy of the container in the method of the related art
  • (2) in Figure 7 corresponds to the CPU occupancy of the container in the method provided by the embodiment of the present application.
  • the horizontal axis represents time
  • the vertical axis represents the CPU usage of the container.
  • Figure 8 is a schematic diagram of the completion time of a transcoding task provided by an embodiment of the present application.
  • the polyline connecting the completion times of the 40 subtasks is the upper one of the two polylines shown in Figure 8, and the completion time of the last 25 subtasks among the 40 subtasks is Both are around 500 seconds (second, s).
  • the polyline connecting the completion times of the 40 subtasks is the lower one of the two polylines shown in Figure 8 , and the completion time of the 40 subtasks is about 300s.
  • the completion time of the transcoding task in the method provided by the embodiment of the present application is short.
  • Figure 9 is a schematic structural diagram of a resource adjustment device provided by an embodiment of the present application.
  • the device is applied to the first module shown in Figure 1 or the task resource control module shown in Figure 2 to implement the resource adjustment method provided by the embodiment of the present application.
  • the resource adjustment device shown in Figure 9 can perform all or part of the operations performed by the first module or the task resource control module. It should be understood that the device may include more additional units than those shown or omit some of the units shown, and this is not limited by the embodiments of the present application.
  • the device includes:
  • the acquisition unit 901 is used to acquire task information of multiple tasks.
  • the multiple tasks include a target task and at least one task to be executed.
  • the task information includes task information of each task;
  • the determination unit 902 is used to determine the resource adjustment strategy of the target task based on the task information of multiple tasks;
  • the adjustment unit 903 is configured to adjust at least one of the number and specifications of instances used to run the target task based on the resource adjustment policy when the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition. A sort of.
  • the target task satisfies the first resource adjustment condition, including: the expected execution time of the target task is greater than the reference execution time of the target task.
  • the instance running the target task satisfies the second resource adjustment condition, including: the CPU usage of the instance running the target task is higher than the usage threshold.
  • the target task is a task to be executed or a task being executed.
  • the task information includes resource occupancy and resource occupancy duration.
  • the determining unit 902 is configured to calculate the resource requirements of the target task based on the task information of the multiple tasks and the reference execution duration of the multiple tasks; based on the resource requirements of the target task and the available resources of the target task The resource adjustment strategy of the target task is determined, and the resource adjustment strategy is used to make the adjusted available resource amount of the target task meet the resource requirements of the target task.
  • the device further includes: a calculation unit configured to calculate the expected execution time of the target task based on the initial resource amount and task information of the multiple tasks.
  • the obtaining unit 901 is used to obtain the task type of each task in multiple tasks; based on the task type of each task, query the corresponding relationship between the task type and the task information, and obtain the task information of each task.
  • the correspondence between the task type and task information is obtained based on the configuration information of the task type and task information.
  • the obtaining unit 901 is configured to obtain the task type of each task in multiple tasks; and obtain the task information of each task based on the historical execution information corresponding to each task type.
  • the task type is any one of obtaining metadata, slicing, transcoding, or merging.
  • task information of multiple tasks is obtained, and the resource adjustment strategy of the target task in the multiple tasks is determined based on the task information of the multiple tasks.
  • the device can comprehensively perceive the multiple tasks, and determine the resource adjustment strategy for the target task based on the task information of the multiple tasks with high accuracy. Therefore, when resource adjustment is performed based on the resource adjustment strategy of the target task, the accuracy of resource adjustment is high.
  • the above-mentioned obtaining unit 901, determining unit 902 and adjusting unit 903 can all be implemented by software or hardware.
  • the acquisition unit 901 as an example, the implementation of the acquisition unit 901 will be described.
  • the implementation of the determination unit 902 and the adjustment unit 903 may refer to the implementation of the acquisition unit.
  • the acquisition unit 901 is implemented by software. That is, the acquisition unit 901 is a software functional unit, and the acquisition unit 901 may include code running on the computing instance.
  • the computing instance includes but is not limited to at least one of a physical host, a virtual machine, and a container.
  • a physical host can be called a computing device.
  • the computing instance can be one or more.
  • the acquisition unit 901 may include code running on multiple hosts/virtual machines/containers. Multiple hosts/VMs/containers used to run the code can be distributed in the same region or in different regions.
  • multiple hosts/virtual machines/containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs.
  • Each AZ includes one data center or multiple AZs. geographically close data centers. Among them, a region can include multiple AZs.
  • multiple hosts/virtual machines/containers used to run the code can be distributed in the same virtual private cloud (virtual private cloud, VPC), or can be distributed in multiple VPCs.
  • VPC virtual private cloud
  • a VPC is set up in a region Inside. Cross-region communication between two VPCs in the same region and between VPCs in different regions is achieved by setting up a communication gateway in each VPC, and the interconnection between VPCs is realized through the communication gateway.
  • the acquisition unit 901 is implemented by hardware. That is, the acquisition unit 901 is a hardware functional unit, and the acquisition unit 901 may include at least one computing device, such as a server.
  • the acquisition unit 901 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL), or any combination thereof.
  • CPLD complex programmable logical device
  • FPGA field-programmable gate array
  • GAL general array logic
  • Multiple computing devices included in the acquisition unit 901 may be distributed in the same region or in different regions. Multiple computing devices included in the acquisition unit 901 may be distributed in the same AZ or in different AZs. For example, multiple computing devices included in the acquisition unit 901 may be distributed in the same VPC or in multiple VPCs. The multiple computing devices may be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
  • the obtaining unit 901 can be used to perform any step in the resource adjustment method
  • the determining unit 902 can be used to perform any step in the resource adjustment method
  • the adjusting unit 903 can be used to perform the resource adjustment method.
  • the steps that the acquisition unit 901, the determination unit 902, and the adjustment unit 903 are responsible for implementing can be specified as needed and implemented by the acquisition unit 901, the determination unit 902, and the adjustment unit 903 respectively implementing different steps in the resource adjustment method.
  • computing device 1000 includes: bus 1002, processor 1004, memory 1006, and communication interface 1008.
  • the processor 1004, the memory 1006 and the communication interface 1008 communicate through the bus 1002.
  • Computing device 1000 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 1000.
  • the bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one line is used in Figure 10, but it does not mean that there is only one bus or one type of bus.
  • Bus 1002 may include a path that carries information between various components of computing device 1000 (eg, memory 1006, processor 1004, communications interface 1008).
  • the processor 1004 may include any one or more of a CPU, a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP). .
  • Memory 1006 may include volatile memory, such as random access memory (RAM).
  • RAM random access memory
  • the memory 1006 may also include non-volatile memory (non-volatile memory), such as read-only memory (ROM), flash memory, mechanical hard disk (hard disk drive, HDD) or solid state drive (solid state drive). ,SSD).
  • ROM read-only memory
  • HDD hard disk drive
  • SSD solid state drive
  • the memory 1006 stores executable program code, and the processor 1004 executes the executable program code to implement the functions of the aforementioned acquisition unit 901, determination unit 902, and adjustment unit 903 respectively, thereby implementing the resource adjustment method. That is, the memory 1006 stores instructions for executing the resource adjustment method.
  • executable code is stored in the memory 1006, and the processor 1004 executes the executable code to implement the foregoing.
  • the resource adjustment device functions to implement the resource adjustment method. That is, the memory 1006 stores instructions for executing the resource adjustment method.
  • the communication interface 1008 uses transceiver modules such as, but not limited to, network interface cards and transceivers to implement communication between the computing device 1000 and other devices or communication networks.
  • the computing device cluster includes at least one computing device 1000.
  • the same instructions for performing the resource adjustment method may be stored in the memory 1006 of one or more computing devices 1000 in the computing device cluster.
  • the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store part of the instructions for executing the resource adjustment method.
  • a combination of one or more computing devices 1000 may collectively execute instructions for performing a resource adjustment method.
  • the memories 1006 in different computing devices 1000 in the computing device cluster can store different instructions, respectively used to execute part of the functions of the resource adjustment device. That is, instructions stored in the memory 1006 in different computing devices 1000 may implement the functions of one or more units among the obtaining unit 901 , the determining unit 902 and the adjusting unit 903 .
  • one or more computing devices in a cluster of computing devices may be connected through a network.
  • the network can be a wide area network or a local area network, etc.
  • Figure 12 is a schematic structural diagram of another computing device cluster provided by an embodiment of the present application. As shown in Figure 12, two computing devices 1000A and 1000B are connected through a network. Specifically, the connection to the network is made through a communication interface in each computing device.
  • instructions for performing the functions of the acquisition unit 901 are stored in the memory 1006 of the computing device 1000A.
  • instructions for performing the functions of the determining unit 902 and the adjusting unit 903 are stored in the memory 1006 of the computing device 1000B.
  • connection method between the computing device clusters shown in Figure 12 can be that considering that the resource adjustment method provided by this application needs to obtain task information of multiple tasks, the functions implemented by the determination unit 902 and the adjustment unit 903 are handed over to the computing device 1000B for execution. .
  • computing device 1000A shown in FIG. 12 may also be performed by multiple computing devices 1000.
  • computing device 1000B may also be performed by multiple computing devices 1000 .
  • the embodiment of the present application also provides another computing device cluster.
  • the connection relationship between the computing devices in the computing device cluster can be similar to the connection method of the computing device cluster in FIG. 11 and FIG. 12 .
  • the difference is that the same instructions for executing the resource adjustment method may be stored in the memory 1006 of one or more computing devices 1000 in the computing device cluster.
  • the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store part of the instructions for executing the resource adjustment method.
  • a combination of one or more computing devices 1000 may collectively execute instructions for performing a resource adjustment method.
  • Embodiments of the present application provide a computer program product containing instructions.
  • the instructions When the instructions are executed by a computing device cluster, the computing device cluster can perform corresponding steps and/or processes in the above method embodiments.
  • Embodiments of the present application provide a chip, including a processor, which is configured to call and run instructions stored in the memory, so that at least one computing device installed with the chip executes the methods in the above aspects.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., computer instructions may be transmitted from a website, computer, server or data center via a wired link (e.g.
  • each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or software function modules.
  • the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
  • first, second and other words are used to distinguish the same or similar items with basically the same function and function. It should be understood that the terms “first”, “second” and “nth” There is no logical or sequential dependency between them, and there is no limit on the number or execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, but these elements should not be limited by the term. These terms are only used to distinguish one element from another. For example, a first module may be termed a second module, and similarly, a second module may be termed a first module, without departing from the scope of various described examples. Both the first module and the second module may be any type of computing device, and, in some cases, may be separate and distinct computing devices.
  • the size of the sequence number of each process does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not be determined by the execution order of the embodiments of the present application.
  • the implementation process constitutes no limitation.
  • references throughout this specification to "one embodiment,””anembodiment,” and “a possible implementation” mean that specific features, structures, or characteristics related to the embodiment or implementation are included herein. In at least one embodiment of the application. Therefore, “in one embodiment” or “in an embodiment” or “a possible implementation” appearing in various places throughout this specification do not necessarily refer to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present application relates to the technical field of communications, and discloses a resource adjustment method and apparatus, a computing device cluster, and a readable storage medium. The method comprises: obtaining task information of each task in a plurality of tasks, the plurality of tasks comprising a target task and at least one task to be executed; determining a resource adjustment strategy of the target task according to the task information of the plurality of tasks; and when the target task meets a first resource adjustment condition or an instance running the target task meets a second resource adjustment condition, adjusting, on the basis of the resource adjustment strategy of the target task, at least one of the quantity and the specification of the instance for running the target task. According to the method, a plurality of tasks can be comprehensively perceived, and the accuracy of a resource adjustment strategy of a target task determined on the basis of task information of the plurality of tasks is high. The plurality of tasks further comprise a task to be executed. Therefore, when resource adjustment is carried out on the basis of the resource adjustment strategy of the target task, the accuracy of resource adjustment is high.

Description

资源调整方法、装置、计算设备集群及可读存储介质Resource adjustment method, device, computing device cluster and readable storage medium
本申请要求于2022年6月20日提交的申请号为202210695652.6、发明名称为“一种负载弹性伸缩方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请实施例中;本申请还要求于2022年8月23日提交的申请号为202211013518.X、发明名称为“资源调整方法、装置、计算设备集群及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application with application number 202210695652.6 and the invention title "A load elastic expansion method, device and equipment" submitted on June 20, 2022, the entire content of which is incorporated into this application by reference. For example; this application also claims priority for the Chinese patent application with application number 202211013518. The entire contents of which are incorporated herein by reference.
技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种资源调整方法、装置、计算设备集群及可读存储介质。The present application relates to the field of communication technology, and in particular, to a resource adjustment method, device, computing device cluster and readable storage medium.
背景技术Background technique
云是一种以互联网的形式为用户提供软硬件资源的技术。例如,云根据用户的业务需求,为用户提供与该业务需求相适配的资源。由于用户的业务需求可能发生变化,因此,需要一种资源调整方法,使得在业务需求发生变化的情况下,为该业务需求提供的资源能够相应的增加或者减少,实现资源与业务需求重新适配。Cloud is a technology that provides users with software and hardware resources in the form of the Internet. For example, the cloud provides users with resources that match the business needs based on the user's business needs. Since the user's business needs may change, a resource adjustment method is needed so that when the business needs change, the resources provided for the business needs can be increased or decreased accordingly to achieve re-adaptation of resources and business needs. .
在相关技术中,监测中央处理器(central processing unit,CPU)使用率、内存使用率、磁盘读写速率和流量流入/流出速率等指标;当监测到某一项指标满足触发条件时,确定当前的资源与业务需求不再适配,按照固定值对资源进行增加或者减少。In related technologies, indicators such as central processing unit (CPU) usage, memory usage, disk read and write rates, and traffic inflow/outflow rates are monitored; when a certain indicator is monitored to meet the triggering conditions, the current The resources no longer match the business needs, and the resources are increased or decreased according to a fixed value.
然而,由于上述各项指标均表示当前的资源占用情况,当某一项指标满足触发条件时,意味着业务需求已经发生变化,基于当前的资源占用情况对资源进行调整的准确性较低。However, since each of the above indicators represents the current resource occupancy, when an indicator meets the trigger condition, it means that business needs have changed, and the accuracy of adjusting resources based on the current resource occupancy is low.
发明内容Contents of the invention
本申请提出一种资源调整方法、装置、计算设备集群及可读存储介质,用于提高资源调整的准确性。This application proposes a resource adjustment method, device, computing device cluster and readable storage medium to improve the accuracy of resource adjustment.
第一方面,提供了一种资源调整方法,该方法包括:获取多个任务中的每一个任务的任务信息,该多个任务中包括目标任务和至少一个待执行的任务;根据该多个任务的任务信息,确定目标任务的资源调整策略;当目标任务满足第一资源调整条件,或者运行目标任务的实例满足第二资源调整条件时,基于该资源调整策略调整用于运行目标任务的实例的数量和规格中的至少一种。该方法能够全面感知该多个任务,基于该多个任务的任务信息确定出的目标任务的资源调整策略的准确性较高。其中,该多个任务中还包括待执行的任务。从而,在基于该目标任务的资源调整策略进行资源调整的情况下,资源调整的准确性较高。In a first aspect, a resource adjustment method is provided, which method includes: obtaining task information for each of multiple tasks, which includes a target task and at least one to-be-executed task; according to the multiple tasks The task information of the target task is determined to determine the resource adjustment strategy of the target task; when the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition, adjust the resource adjustment strategy of the instance used to run the target task based on the resource adjustment strategy. At least one of quantity and specification. This method can comprehensively perceive the multiple tasks, and determine the resource adjustment strategy for the target task based on the task information of the multiple tasks with high accuracy. The multiple tasks also include tasks to be executed. Therefore, when resource adjustment is performed based on the resource adjustment strategy of the target task, the accuracy of resource adjustment is higher.
在一种可能的实现方式中,该方法还包括:接收用户配置的资源更新限制,该资源更新限制包括最大费用和运行该目标任务的实例的最大数量中的至少一种;基于该资源调整策略调整用于运行该目标任务的实例的数量和规格中的至少一种,包括:基于该资源调整策略和该资源更新限制,调整用于运行该目标任务的实例的数量和规格中的至少一种。通过基于用 户配置的资源更新限制进行资源调整,能够保证调整后的资源符合用户需求。In a possible implementation, the method further includes: receiving a user-configured resource update limit, where the resource update limit includes at least one of a maximum cost and a maximum number of instances running the target task; adjusting the strategy based on the resource Adjusting at least one of the number and specifications of the instances used to run the target task includes: adjusting at least one of the number and specifications of the instances used to run the target task based on the resource adjustment policy and the resource update limit. . By using based on Adjust resources according to user-configured resource update restrictions to ensure that the adjusted resources meet user needs.
在一种可能的实现方式中,目标任务满足第一资源调整条件,包括:目标任务的预期执行时长大于目标任务的参考执行时长。示例性地,运行目标任务的实例满足第二资源调整条件,包括:运行目标任务的实例的CPU占用率高于占用率阈值。触发执行基于资源调整策略调整用于目标任务的实例的数量和规格中的至少一种的情况较为多样,该方法能够适用于多种情况。In a possible implementation manner, the target task satisfies the first resource adjustment condition, including: the expected execution time of the target task is greater than the reference execution time of the target task. For example, the instance running the target task satisfies the second resource adjustment condition, including: the CPU usage of the instance running the target task is higher than the usage threshold. Situations that trigger execution of at least one of adjusting the number and specifications of instances used for a target task based on a resource adjustment policy are diverse, and this method can be applicable to a variety of situations.
在一种可能的实现方式中,目标任务为待执行的任务或者正在执行的任务。该方法使用的任务的执行情况较为多样。In a possible implementation, the target task is a task to be executed or a task being executed. The execution of tasks used by this method is relatively diverse.
在一种可能的实现方式中,任务信息包括资源占用量和资源占用时长。从而该方法能够获取到较为准确的资源占用情况,提高确定目标任务的资源调整策略的准确性。In a possible implementation, the task information includes resource occupancy and resource occupancy duration. Therefore, this method can obtain more accurate resource occupancy status and improve the accuracy of determining the resource adjustment strategy for the target task.
在一种可能的实现方式中,根据多个任务的任务信息,确定目标任务的资源调整策略,包括:根据多个任务的任务信息和多个任务的参考执行时长,计算目标任务的资源需求;根据目标任务的资源需求和目标任务的可用资源量,确定目标任务的资源调整策略,资源调整策略用于使得调整后的目标任务的可用资源量满足目标任务的资源需求。通过计算目标资源的资源需求,该方法能够对完成该目标任务所需的资源量进行提前感知。在需要进行资源调整的情况下,该方法中由感知到需要进行资源调整到完成对资源调整所需的时间较短,从而能够降低资源调整所需的时长,提高资源调整的效率。In a possible implementation, determining the resource adjustment strategy of the target task based on the task information of multiple tasks includes: calculating the resource requirements of the target task based on the task information of the multiple tasks and the reference execution time of the multiple tasks; According to the resource requirements of the target task and the amount of available resources of the target task, the resource adjustment strategy of the target task is determined. The resource adjustment strategy is used to make the adjusted amount of available resources of the target task meet the resource requirements of the target task. By calculating the resource requirements of the target resources, this method can sense in advance the amount of resources required to complete the target task. When resource adjustment is required, the time required from sensing the need for resource adjustment to completing the resource adjustment is shorter in this method, thereby reducing the time required for resource adjustment and improving the efficiency of resource adjustment.
在一种可能的实现方式中,该方法还包括:根据初始资源量和多个任务的任务信息,计算目标任务的预期执行时长。从而在该目标任务的预期执行时长大于该目标任务的参考执行时长的情况下,能够触发基于目标任务的资源调整策略执行资源调整,使得目标任务的预期执行时长不超过该目标任务的参考执行时长。In a possible implementation, the method further includes: calculating the expected execution time of the target task based on the initial resource amount and task information of the multiple tasks. Therefore, when the expected execution time of the target task is greater than the reference execution time of the target task, the resource adjustment strategy based on the target task can be triggered to perform resource adjustment so that the expected execution time of the target task does not exceed the reference execution time of the target task. .
在一种可能的实现方式中,获取多个任务的任务信息,包括:获取多个任务中的各个任务的任务类型;基于各个任务的任务类型,查询任务类型与任务信息的对应关系,得到各个任务的任务信息,其中,任务类型与任务信息的对应关系基于任务类型和任务信息的配置信息得到。通过基于各个任务类型,查询任务类型与任务信息的对应关系,得到各个任务的任务信息,该方法获取任务信息的方式较为简便,获取效率较高。In a possible implementation, obtaining the task information of multiple tasks includes: obtaining the task type of each task in the multiple tasks; based on the task type of each task, querying the corresponding relationship between the task type and the task information, and obtaining each Task information of the task, where the correspondence between the task type and the task information is obtained based on the configuration information of the task type and task information. By querying the corresponding relationship between task types and task information based on each task type, the task information of each task is obtained. This method obtains task information in a simpler and more efficient manner.
在一种可能的实现方式中,获取多个任务的任务信息,包括:获取多个任务中的各个任务的任务类型;基于各个任务类型对应的历史执行信息,获取各个任务的任务信息。In a possible implementation manner, obtaining task information of multiple tasks includes: obtaining the task type of each task in the multiple tasks; obtaining the task information of each task based on the historical execution information corresponding to each task type.
在一种可能的实现方式中,任务类型为获取元数据、切片、转码或合并中的任一种。In a possible implementation, the task type is any one of obtaining metadata, slicing, transcoding, or merging.
第二方面,提供了一种资源调整装置,该装置包括:In a second aspect, a resource adjustment device is provided, which device includes:
获取单元,用于获取多个任务的任务信息,多个任务中包括目标任务和至少一个待执行的任务,该任务信息包括每一任务的任务信息;The acquisition unit is used to acquire task information of multiple tasks. The multiple tasks include a target task and at least one task to be executed. The task information includes task information of each task;
确定单元,用于根据多个任务的任务信息,确定目标任务的资源调整策略;The determination unit is used to determine the resource adjustment strategy of the target task based on the task information of multiple tasks;
调整单元,用于当目标任务满足第一资源调整条件,或者运行目标任务的实例满足第二资源调整条件时,基于该资源调整策略调整用于运行目标任务的实例的数量和规格中的至少一种。An adjustment unit configured to adjust at least one of the number and specifications of instances used to run the target task based on the resource adjustment policy when the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition. kind.
在一种可能的实现方式中,该装置还包括:接收单元,用于接收用户配置的资源更新限制,该资源更新限制包括最大费用和运行目标任务的实例的最大数量中的至少一种;调整单元,用于基于该资源调整策略和该资源更新限制,调整用于运行目标任务的实例的数量和规 格中的至少一种。In a possible implementation, the device further includes: a receiving unit configured to receive user-configured resource update limits, where the resource update limits include at least one of a maximum cost and a maximum number of instances running the target task; adjust Unit used to adjust the number and size of instances used to run target tasks based on the resource adjustment policy and the resource update limit. at least one of the grids.
在一种可能的实现方式中,目标任务满足第一资源调整条件,包括:目标任务的预期执行时长大于目标任务的参考执行时长。In a possible implementation manner, the target task satisfies the first resource adjustment condition, including: the expected execution time of the target task is greater than the reference execution time of the target task.
在一种可能的实现方式中,运行目标任务的实例满足第二资源调整条件,包括:运行目标任务的实例的CPU占用率高于占用率阈值。In a possible implementation manner, the instance running the target task satisfies the second resource adjustment condition, including: the CPU usage of the instance running the target task is higher than the usage threshold.
在一种可能的实现方式中,目标任务为待执行的任务或者正在执行的任务。In a possible implementation, the target task is a task to be executed or a task being executed.
在一种可能的实现方式中,任务信息包括资源占用量和资源占用时长。In a possible implementation, the task information includes resource occupancy and resource occupancy duration.
在一种可能的实现方式中,确定单元,用于根据多个任务的任务信息和多个任务的参考执行时长,计算目标任务的资源需求;根据目标任务的资源需求和目标任务的可用资源量,确定目标任务的资源调整策略,该资源调整策略用于使得调整后的目标任务的可用资源量满足目标任务的资源需求。In a possible implementation, the determination unit is used to calculate the resource requirements of the target task based on the task information of the multiple tasks and the reference execution time of the multiple tasks; based on the resource requirements of the target task and the amount of available resources of the target task , determine the resource adjustment strategy of the target task, which is used to make the adjusted available resource amount of the target task meet the resource requirements of the target task.
在一种可能的实现方式中,该装置还包括:计算单元,用于根据初始资源量和多个任务的任务信息,计算目标任务的预期执行时长。In a possible implementation, the device further includes: a calculation unit configured to calculate the expected execution time of the target task based on the initial resource amount and task information of the multiple tasks.
在一种可能的实现方式中,获取单元,用于获取多个任务中的各个任务的任务类型;基于各个任务的任务类型,查询任务类型与任务信息的对应关系,得到各个任务的任务信息,其中,任务类型与任务信息的对应关系基于任务类型和任务信息的配置信息得到。In a possible implementation, the acquisition unit is used to obtain the task type of each task in multiple tasks; based on the task type of each task, query the correspondence between the task type and task information to obtain the task information of each task, The correspondence between the task type and task information is obtained based on the configuration information of the task type and task information.
在一种可能的实现方式中,获取单元,用于获取多个任务中的各个任务的任务类型;基于各个任务类型对应的历史执行信息,获取各个任务的任务信息。In a possible implementation manner, the acquisition unit is used to obtain the task type of each task in multiple tasks; and obtain the task information of each task based on the historical execution information corresponding to each task type.
在一种可能的实现方式中,任务类型为获取元数据、切片、转码或合并中的任一种。In a possible implementation, the task type is any one of obtaining metadata, slicing, transcoding, or merging.
第三方面,提供了一种计算设备集群,该计算设备集群包括至少一个计算设备,各个计算设备包括处理器和存储器;至少一个计算设备的处理器用于执行该至少一个计算设备的存储器中存储的指令,以使得该计算设备集群执行第一方面中任一的资源调整方法。In a third aspect, a computing device cluster is provided. The computing device cluster includes at least one computing device. Each computing device includes a processor and a memory; the processor of the at least one computing device is used to execute a program stored in the memory of the at least one computing device. Instructions are provided to cause the computing device cluster to execute any one of the resource adjustment methods of the first aspect.
第四方面,提供了一种计算机可读存储介质,该计算机可读存储介质包括计算机程序指令,当该计算机程序指令由计算设备集群执行时,该计算设备集群执行第一方面中任一的资源调整方法。In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes any of the resources of the first aspect. Adjustment method.
第五方面,提供了一种通信装置,该装置包括:收发器、存储器和处理器。其中,该收发器、该存储器和该处理器通过内部连接通路互相通信,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,以控制收发器接收信号,并控制收发器发送信号,并且当该处理器执行该存储器存储的指令时,使得该处理器执行第一方面中任一的资源调整方法。In a fifth aspect, a communication device is provided, which includes: a transceiver, a memory, and a processor. Wherein, the transceiver, the memory and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. , and when the processor executes the instruction stored in the memory, the processor is caused to execute any resource adjustment method in the first aspect.
示例性地,处理器为一个或多个,存储器为一个或多个。For example, there are one or more processors and one or more memories.
示例性地,存储器可以与处理器集成在一起,或者存储器与处理器分离设置。For example, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
在具体实现过程中,存储器可以为非瞬时性(non-transitory)存储器,例如只读存储器(read only memory,ROM),其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请对存储器的类型以及存储器与处理器的设置方式不做限定。In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor, or can be set in different On the chip, this application does not limit the type of memory and the arrangement of the memory and the processor.
第六方面,提供了一种包含指令的计算机程序产品,当该指令被计算设备集群运行时,使得计算设备集群执行第一方面中任一的资源调整方法。A sixth aspect provides a computer program product containing instructions, which when executed by a computing device cluster, causes the computing device cluster to execute any of the resource adjustment methods of the first aspect.
第七方面,提供了一种芯片,包括处理器,用于从存储器中调用并运行该存储器中存储的指令,使得安装有该芯片的至少一个计算设备执行第一方面中任一的资源调整方法。In a seventh aspect, a chip is provided, including a processor for calling and running instructions stored in the memory, so that at least one computing device installed with the chip executes any resource adjustment method in the first aspect. .
示例性地,该芯片还包括:输入接口、输出接口和该存储器,输入接口、输出接口、处 理器以及存储器之间通过内部连接通路相连。Exemplarily, the chip also includes: an input interface, an output interface and the memory, the input interface, the output interface, a processing The processor and memory are connected through internal connection paths.
应当理解的是,本申请的第二方面至第七方面的技术方案及其对应的可能的实现方式所取得的有益效果可以参见上述对第一方面及其对应的可能的实现方式的技术效果,此处不再赘述。It should be understood that the beneficial effects achieved by the technical solutions of the second to seventh aspects of the present application and their corresponding possible implementations can be referred to the above-mentioned technical effects of the first aspect and their corresponding possible implementations, No further details will be given here.
附图说明Description of the drawings
图1是本申请实施例提供的一种资源调整方法的实施环境示意图;Figure 1 is a schematic diagram of the implementation environment of a resource adjustment method provided by an embodiment of the present application;
图2是本申请实施例提供的另一种资源调整方法的实施环境示意图;Figure 2 is a schematic diagram of the implementation environment of another resource adjustment method provided by an embodiment of the present application;
图3是本申请实施例提供的一种资源调整方法的流程图;Figure 3 is a flow chart of a resource adjustment method provided by an embodiment of the present application;
图4是本申请实施例提供的一种排布结果的示意图;Figure 4 is a schematic diagram of an arrangement result provided by an embodiment of the present application;
图5是本申请实施例提供的一种资源调整方法的过程示意图;Figure 5 is a schematic process diagram of a resource adjustment method provided by an embodiment of the present application;
图6是本申请实施例提供的一种资源排布过程的示意图;Figure 6 is a schematic diagram of a resource arrangement process provided by an embodiment of the present application;
图7是本申请实施例提供的一种容器的CPU占用情况的示意图;Figure 7 is a schematic diagram of the CPU usage of a container provided by an embodiment of the present application;
图8是本申请实施例提供的一种转码任务的完成时间的示意图;Figure 8 is a schematic diagram of the completion time of a transcoding task provided by an embodiment of the present application;
图9是本申请实施例提供的一种资源调整装置的结构示意图;Figure 9 is a schematic structural diagram of a resource adjustment device provided by an embodiment of the present application;
图10是本申请实施例提供的一种计算设备的结构示意图;Figure 10 is a schematic structural diagram of a computing device provided by an embodiment of the present application;
图11是本申请实施例提供的一种计算设备集群的结构示意图;Figure 11 is a schematic structural diagram of a computing device cluster provided by an embodiment of the present application;
图12是本申请实施例提供的另一种计算设备集群的结构示意图。Figure 12 is a schematic structural diagram of another computing device cluster provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请的实施方式部分使用的术语仅用于对本申请的实施例进行解释,而非旨在限定本申请。为使本申请的目的、技术方案和优点更加清楚,下面结合附图,对本申请的实施例进行描述。The terms used in the embodiments of the present application are only used to explain the embodiments of the present application and are not intended to limit the present application. In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application are described below in conjunction with the accompanying drawings.
云是一种通过将实体的硬件资源虚拟化,以互联网的形式为用户提供软件资源和虚拟的硬件资源的技术。为便于说明,将软件资源和虚拟的硬件资源简称为资源。云能够根据用户的业务需求,为用户提供与该业务相适配的资源。具体地,资源包括计算资源、网络资源和存储资源等。其中,以计算资源为例,计算资源包括虚拟机、容器和裸金属服务器。需要说明的是,本申请不对资源的具体类型进行限制。由于用户的业务需求可能发生变化,云需要根据变化后的业务需求对提供的资源进行调整,以使调整后的资源能够与变化后的业务需求重新适配。其中,可采用资源调整方法根据变化后的业务需求对提供的资源进行调整。资源调整表现为对资源进行增加或者减少,资源调整方法也可称为资源的弹性伸缩(auto scaling,AS)方法。Cloud is a technology that provides users with software resources and virtual hardware resources in the form of the Internet by virtualizing physical hardware resources. For ease of explanation, software resources and virtual hardware resources are simply called resources. The cloud can provide users with resources that are suitable for the business based on their business needs. Specifically, resources include computing resources, network resources, storage resources, etc. Among them, taking computing resources as an example, computing resources include virtual machines, containers and bare metal servers. It should be noted that this application does not limit the specific types of resources. Since the user's business needs may change, the cloud needs to adjust the resources provided according to the changed business needs so that the adjusted resources can be re-adapted to the changed business needs. Among them, the resource adjustment method can be used to adjust the provided resources according to the changed business needs. Resource adjustment is performed by increasing or decreasing resources. The resource adjustment method can also be called the auto scaling (AS) method of resources.
在相关技术中,对于无计划性且无规律性的业务需求,通过配置CPU使用率、内存使用率、磁盘读写速率和流量流入/流出速率等指标的触发条件,对上述指标进行监测,实现资源调整。例如,当监测到上述指标中的某一项指标满足触发条件时,确定当前的资源与业务需求不再适配,按照固定值对资源进行增加或者减少,实现资源调整。其中,无计划性且无规律性的业务需求可以是指具有并发任务量大、任务突发且无法预测等特点的场景中的业务需求。上述场景包括但不限于离线视频转码场景或新闻服务场景。In related technologies, for unplanned and irregular business needs, by configuring trigger conditions for indicators such as CPU usage, memory usage, disk read and write rates, and traffic inflow/outflow rates, the above indicators are monitored to achieve Resource adjustment. For example, when it is monitored that one of the above indicators meets the triggering condition, it is determined that the current resources are no longer suitable for the business needs, and the resources are increased or decreased according to a fixed value to realize resource adjustment. Among them, unplanned and irregular business needs may refer to business needs in scenarios characterized by large amounts of concurrent tasks, sudden tasks, and unpredictable tasks. The above scenarios include but are not limited to offline video transcoding scenarios or news service scenarios.
相关技术中监测的各项指标均表示当前的资源占用情况,也就是说,相关技术是在业务 需求对应的任务已经通过相应的资源执行之后,才能对上述指标进行监测,进而在某一项指标满足触发条件时,触发资源调整。然而,当某一项指标满足触发条件时,意味着业务需求已经发生变化,触发资源调整的时间点相较于业务需求发生变化的时间点会存在一定的延迟,基于当前的资源占用情况对资源进行调整的准确性较低。再有,由于完成资源调整需要一定的时长,相关技术中由业务需求发生变化到实现资源与业务需求重新适配的时长较长,调整效率较低。Each indicator monitored in the related technology indicates the current resource occupancy. In other words, the related technology is in the business Only after the tasks corresponding to the requirements have been executed by the corresponding resources can the above indicators be monitored, and then when a certain indicator meets the triggering condition, resource adjustment is triggered. However, when an indicator meets the triggering condition, it means that the business demand has changed. There will be a certain delay in the time point when the resource adjustment is triggered compared with the time point when the business demand changes. The resource adjustment is based on the current resource occupancy. Adjustments are made less accurately. Furthermore, since it takes a certain amount of time to complete resource adjustment, the time from the change in business requirements to the re-adaptation of resources and business needs in related technologies is long, and the adjustment efficiency is low.
本申请实施例提供了一种资源调整方法,能够提高资源调整的准确性。示例性地,该方法可应用于图1所示的实施环境,参见图1,该实施环境包括但不限于第一模块101、第二模块102、第三模块103、第四模块104、第五模块105、第六模块106和第七模块107。第一模块101分别与第二模块102和第六模块106通信连接,第二模块102还与第三模块103、第四模块104以及第五模块105通信连接,第三模块103与第五模块105通信连接,第四模块104与第五模块105通信连接,第六模块106还与第五模块105和第七模块107通信连接。通信连接的各个模块之间能够进行信息交互,通信连接可以基于有线网络或者无线网络实现,本申请实施例对此不加以限定。The embodiment of the present application provides a resource adjustment method, which can improve the accuracy of resource adjustment. Illustratively, the method can be applied to the implementation environment shown in Figure 1. Referring to Figure 1, the implementation environment includes but is not limited to the first module 101, the second module 102, the third module 103, the fourth module 104, the fifth module Module 105, sixth module 106 and seventh module 107. The first module 101 is communicatively connected with the second module 102 and the sixth module 106 respectively. The second module 102 is also communicatively connected with the third module 103, the fourth module 104 and the fifth module 105. The third module 103 and the fifth module 105 Communication connection: the fourth module 104 is communicatively connected with the fifth module 105, and the sixth module 106 is also communicatively connected with the fifth module 105 and the seventh module 107. Each module of the communication connection can exchange information, and the communication connection can be implemented based on a wired network or a wireless network, which is not limited in the embodiments of the present application.
示例性地,第六模块106用于获取第七模块107中存储的待执行的任务,第六模块106还用于获取第五模块105中正在执行的任务和第五模块105中的可用资源量,该可用资源量对应的资源用于运行任务。第六模块106还用于向第一模块101上报获取到的任务和该任务的可用资源量。第一模块101用于获取任务的任务信息和参考执行时长,基于获取到的任务信息和参考执行时长确定任务的资源需求;基于任务的资源需求和可用资源量,确定任务的资源调整策略。该第一模块101还用于基于任务的资源调整策略对该任务的可用资源量进行调整,或者向管理资源的第二模块102发送控制指令,以使第二模块102基于该控制指令对任务的可用资源量进行调整。第二模块102还用于获取第三模块103中的备用资源和第四模块104中存储的配置信息,基于该配置信息对该备用资源进行配置,以生成新的可用资源,从而实现对可用资源量的调整。For example, the sixth module 106 is used to obtain the tasks to be executed stored in the seventh module 107, and the sixth module 106 is also used to obtain the tasks being executed in the fifth module 105 and the amount of available resources in the fifth module 105. , the resources corresponding to the amount of available resources are used to run tasks. The sixth module 106 is also configured to report the acquired task and the amount of available resources of the task to the first module 101 . The first module 101 is used to obtain the task information and reference execution duration of the task, determine the resource requirements of the task based on the obtained task information and reference execution duration, and determine the resource adjustment strategy of the task based on the task's resource requirements and the amount of available resources. The first module 101 is also used to adjust the amount of available resources for the task based on the resource adjustment policy of the task, or to send a control instruction to the second module 102 that manages resources, so that the second module 102 adjusts the amount of resources for the task based on the control instruction. The amount of available resources is adjusted. The second module 102 is also used to obtain the backup resources in the third module 103 and the configuration information stored in the fourth module 104, and configure the backup resources based on the configuration information to generate new available resources, thereby realizing the optimization of available resources. Quantity adjustment.
图2是本申请实施例提供的另一种资源调整方法的实施环境示意图。如图2所示,第一模块101可以为任务资源控制模块,该任务资源模块用于实现第一模块101所具有的功能。第二模块102可以为控制中心,该控制中心用于实现第二模块102所具有的功能。第三模块103为节点池,该节点池包括至少一个节点,一个节点为一个备用资源。第四模块104为镜像仓库,该镜像仓库用于存储至少一个镜像,一个镜像为一个执行程序的配置信息。第五模块105为工作负载(deployment),该工作负载包括基于配置信息配置完毕的至少一个节点,任一个配置完毕的节点包括至少一个实例。该实例提供的资源为待执行的任务对应的可用资源,该可用资源用于运行待执行的任务。不同规格的实例提供的资源不同。示例性地,实例包括物理主机、虚拟机或容器(pod)中的至少一种。第六模块106为云监控模块,该云监控模块用于实现第六模块106所具有的功能,也即云监控模块用于获取第七模块107中存储的待执行的任务、第五模块105中正在执行的任务和第五模块105中任务的可用资源量。第七模块107为任务队列,该任务队列用于存储待执行的任务。Figure 2 is a schematic diagram of the implementation environment of another resource adjustment method provided by an embodiment of the present application. As shown in FIG. 2 , the first module 101 may be a task resource control module, and the task resource module is used to implement the functions of the first module 101 . The second module 102 may be a control center, which is used to implement the functions of the second module 102 . The third module 103 is a node pool, which includes at least one node, and one node is a spare resource. The fourth module 104 is an image warehouse, which is used to store at least one image, and one image is the configuration information of an execution program. The fifth module 105 is a workload (deployment). The workload includes at least one node that has been configured based on the configuration information. Each configured node includes at least one instance. The resources provided by this instance are the available resources corresponding to the tasks to be executed, and the available resources are used to run the tasks to be executed. Instances of different specifications provide different resources. Exemplarily, the instance includes at least one of a physical host, a virtual machine, or a container (pod). The sixth module 106 is a cloud monitoring module. The cloud monitoring module is used to implement the functions of the sixth module 106. That is, the cloud monitoring module is used to obtain the tasks to be executed stored in the seventh module 107 and the tasks stored in the fifth module 105. The task being executed and the amount of available resources for the task in the fifth module 105. The seventh module 107 is a task queue, which is used to store tasks to be executed.
上述图1和图2示出的各个模块可以包括在一个设备或者多个设备中。例如,参见图2,任务资源控制模块、控制中心、节点池、镜像仓库、工作负载和云监控均包括在云容器引擎中。该任务队列包括在云容器引擎之外的其他设备中。再有,在图1和图2示出的实施环境中,各 个模块仅以功能进行划分,并不用于对各个模块的实现方式进行限定,各个模块可以基于需要进行合并。例如,在图1示出的实施环境中,第六模块106可以与第一模块101进行合并,使得第一模块101具有第六模块106的功能。也即第一模块101能够获取第七模块107中存储的待执行的任务,也能够获取第五模块105中正在执行的任务和第五模块105中任务的可用资源量。Each module shown in the above-mentioned FIG. 1 and FIG. 2 may be included in one device or multiple devices. For example, see Figure 2, the task resource control module, control center, node pool, mirror warehouse, workload and cloud monitoring are all included in the cloud container engine. This task queue is included in other devices besides the cloud container engine. Furthermore, in the implementation environment shown in Figures 1 and 2, each Each module is divided only by function and is not used to limit the implementation of each module. Each module can be merged based on needs. For example, in the implementation environment shown in FIG. 1 , the sixth module 106 can be merged with the first module 101 so that the first module 101 has the function of the sixth module 106 . That is to say, the first module 101 can obtain the tasks to be executed stored in the seventh module 107, and can also obtain the tasks being executed in the fifth module 105 and the amount of available resources for the tasks in the fifth module 105.
可以理解的是,上述各个实施环境均可以包括多个模块,本申请实施例对此不加以限定。并且,图2示出的任务的数量、实例的数量、节点的数量和镜像的数量仅用于举例说明,本申请实施例对此也不加以限定。It can be understood that each of the above implementation environments may include multiple modules, which is not limited in the embodiments of the present application. Moreover, the number of tasks, the number of instances, the number of nodes, and the number of mirrors shown in Figure 2 are only for illustration, and the embodiments of the present application are not limited thereto.
本申请实施例提供的资源调整方法可如图3所示,接下来,结合图1或图2示出的实施环境,对该方法进行说明。示例性地,该方法应用于至少一个计算设备。图1或图2示出的各个模块可以包括在一个计算设备中,也可以分别包括在多个计算设备中。如图3所示,该方法包括但不限于S301至S303。The resource adjustment method provided by the embodiment of the present application can be shown in Figure 3. Next, the method will be described with reference to the implementation environment shown in Figure 1 or Figure 2. Exemplarily, the method is applied to at least one computing device. Each module shown in Figure 1 or Figure 2 may be included in one computing device, or may be included in multiple computing devices respectively. As shown in Figure 3, the method includes but is not limited to S301 to S303.
S301,获取多个任务的任务信息,该多个任务包括目标任务和至少一个待执行的任务,该任务信息包括每一任务的任务信息。S301. Obtain task information of multiple tasks. The multiple tasks include a target task and at least one task to be executed. The task information includes task information of each task.
S301可以由第一模块执行。在一种可能的实现方式中,获取多个任务的任务信息之前,该方法还包括:基于业务需求获取至少一个任务流,任一个任务流包括至少一个子任务;获取至少一个任务流包括的各个子任务中未被执行的子任务和/或正在执行的子任务,基于获取到的子任务得到多个任务。S301 may be executed by the first module. In a possible implementation, before obtaining the task information of multiple tasks, the method further includes: obtaining at least one task flow based on business requirements, and any task flow includes at least one subtask; obtaining each task included in the at least one task flow. Among the subtasks, the unexecuted subtasks and/or the subtasks that are being executed are obtained, and multiple tasks are obtained based on the obtained subtasks.
业务需求可以是用户下发的父任务,第一模块可以将用户下发的父任务拆分为至少一个子任务,将该至少一个子任务作为获取的一个任务流。示例性地,拆分用户下发的父任务是指将用户下发的父任务按照父任务的至少一个执行阶段进行拆分,得到至少一个子任务,一个子任务对应一个执行阶段。在用户下发多个父任务的情况下,第一模块可以将用户下发的多个父任务分别拆分,获取多个任务流,任一个任务流包括至少一个任务。再有,由于任务流是按照父任务的至少一个执行阶段对父任务进行拆分得到的,属于同一个任务流的至少一个子任务可以具有逻辑上的执行顺序。The business requirement may be a parent task issued by the user, and the first module may split the parent task issued by the user into at least one sub-task, and use the at least one sub-task as an acquired task stream. For example, splitting the parent task delivered by the user means splitting the parent task delivered by the user according to at least one execution stage of the parent task to obtain at least one subtask, and one subtask corresponds to one execution stage. When the user delivers multiple parent tasks, the first module can separate the multiple parent tasks delivered by the user to obtain multiple task streams, and any task stream includes at least one task. Furthermore, since the task flow is obtained by splitting the parent task according to at least one execution stage of the parent task, at least one sub-task belonging to the same task flow can have a logical execution sequence.
关于获取至少一个任务流包括的各个子任务中未被执行的子任务和/或正在执行的子任务的方式,本申请实施例不加以限定。例如,第一模块为图2所示的任务资源控制模块,任务资源控制模块通过云监控模块向任务队列发送获取未被执行的任务的第一请求,接收任务队列响应于该第一请求返回的未被执行的子任务。任务资源控制模块还通过云监控模块向工作负载发送获取正在执行的子任务的第二请求,接收工作负载响应于该第二请求返回的正在执行的子任务。云监控模块也可以主动向任务资源控制模块发送未被执行的子任务和/或正在执行的子任务,本申请实施例不对云监控模块主动向任务资源控制模块发送未被执行的子任务和/或正在执行的子任务的时机进行限定。The embodiments of the present application do not limit the method of obtaining the unexecuted subtasks and/or the currently executing subtasks among the subtasks included in at least one task flow. For example, the first module is the task resource control module shown in Figure 2. The task resource control module sends a first request to obtain unexecuted tasks to the task queue through the cloud monitoring module, and receives the task queue returned in response to the first request. Subtasks that have not been executed. The task resource control module also sends a second request to obtain the executing subtask to the workload through the cloud monitoring module, and receives the executing subtask returned by the workload in response to the second request. The cloud monitoring module can also actively send unexecuted subtasks and/or subtasks that are being executed to the task resource control module. In this embodiment, the cloud monitoring module does not actively send unexecuted subtasks and/or subtasks to the task resource control module. Or limit the timing of the subtask being executed.
在一种可能的实现方式中,基于获取到的子任务得到多个任务,包括:基于各个子任务的任务类型,将同一任务类型的子任务作为一个任务,得到多个任务;其中,对于该多个任务中的任一个任务,如果该任一个任务仅包括待执行的子任务,该任一个任务为待执行的任务,如果该任一个任务包括正在执行的子任务,该任一个任务为正在执行的任务。示例性地,在某一种任务类型的子任务的数量为一的情况下,该子任务即为得到的该任务类型的任务。获取到的多个任务中的目标任务可以为该多个任务中待执行的任务或者正在执行的任务。任 务类型包括但不限于获取元数据、切片、转码或合并中的任一种。In one possible implementation, obtaining multiple tasks based on the obtained subtasks includes: based on the task type of each subtask, subtasks of the same task type are treated as one task to obtain multiple tasks; where, for the Any task among multiple tasks, if any task only includes subtasks to be executed, this any task is a task to be executed; if any task includes subtasks that are being executed, any task is being executed. tasks to perform. For example, when the number of subtasks of a certain task type is one, the subtask is the obtained task of the task type. The obtained target task among the multiple tasks may be a task to be executed or a task being executed among the multiple tasks. appoint Service types include but are not limited to any of obtaining metadata, slicing, transcoding, or merging.
本申请实施例不对获取子任务的任务类型进行限定,例如,可以通过如下获取任务类型方式一和获取任务类型方式二获取子任务的任务类型。The embodiment of the present application does not limit the task type of obtaining a subtask. For example, the task type of a subtask can be obtained through the following obtaining task type method 1 and obtaining task type method 2.
获取任务类型方式一,向存储子任务的任务类型的模块发送请求,接收其他模块响应于该请求发送的子任务的任务类型。The first way to obtain the task type is to send a request to the module that stores the task type of the subtask, and receive the task type of the subtask sent by other modules in response to the request.
以图1所示的实施环境为例,第一模块可以向存储至少一个待执行的子任务的第七模块发送第三请求,该第三请求用于请求获取各个待执行的子任务的任务类型,接收第七模块响应于该第三请求返回的各个待执行的子任务的任务类型。第一模块还可以向用于执行子任务的第五模块发送第四请求,该第四请求用于请求获取正在执行的子任务的任务类型,接收第五模块响应于该第四请求返回的正在执行的子任务的任务类型。Taking the implementation environment shown in Figure 1 as an example, the first module may send a third request to the seventh module that stores at least one subtask to be executed. The third request is used to request to obtain the task type of each subtask to be executed. , receiving the task type of each sub-task to be executed returned by the seventh module in response to the third request. The first module may also send a fourth request to the fifth module for executing the subtask, the fourth request is used to request to obtain the task type of the subtask being executed, and receive the currently executing subtask returned by the fifth module in response to the fourth request. The task type of the subtask being executed.
获取任务类型方式二,通过接收存储任务类型的模块主动发送的各个子任务的任务类型,实现获取多个子任务的任务类型。The second method of obtaining the task type is to obtain the task types of multiple subtasks by receiving the task types of each subtask actively sent by the module that stores the task type.
仍以图1示出的实施环境为例,第一模块可以接收第七模块主动发送的各个待执行的子任务的任务类型。例如,第七模块向第一模块发送至少一个待执行的子任务时,还向第一模块发送各个待执行的子任务的任务类型。第一模块还可以接收第五模块主动发送的正在执行的子任务的任务类型。例如,第五模块向第一模块发送正在执行的子任务时,还向第一模块发送正在执行的子任务的任务类型。Still taking the implementation environment shown in Figure 1 as an example, the first module can receive the task type of each sub-task to be executed actively sent by the seventh module. For example, when the seventh module sends at least one subtask to be executed to the first module, it also sends the task type of each subtask to be executed to the first module. The first module may also receive the task type of the subtask being executed actively sent by the fifth module. For example, when the fifth module sends the subtask being executed to the first module, it also sends the task type of the subtask being executed to the first module.
在一种可能的实现方式中,基于获取到的多个任务,获取该多个任务的任务信息和参考执行时长。用于执行S301的第一模块还获取目标任务的可用资源量。本申请实施例不对获取任务信息、参考执行时长和可用资源量的顺序进行限定。接下来,分别对获取任务信息、参考执行时长和可用资源量的过程进行说明。In a possible implementation, based on the obtained multiple tasks, the task information and reference execution time of the multiple tasks are obtained. The first module for executing S301 also obtains the amount of available resources of the target task. The embodiments of this application do not limit the order in which task information, reference execution duration, and available resources are obtained. Next, the process of obtaining task information, reference execution time, and available resources is explained respectively.
获取多个任务的任务信息的方式包括但不限于如下获取任务信息方式一和获取任务信息方式二。Methods of obtaining task information for multiple tasks include but are not limited to the following method 1 of obtaining task information and method 2 of obtaining task information.
获取任务信息方式一,获取多个任务中的各个任务的任务类型;基于各个任务类型对应的历史执行信息,获取各个任务的任务信息。The first method of obtaining task information is to obtain the task type of each task in multiple tasks; based on the historical execution information corresponding to each task type, obtain the task information of each task.
例如,对于任一个任务类型,该任一个任务类型对应的历史执行信息包括完成该任一个任务类型的至少一个子任务的资源占用量和资源占用时长。示例性地,对于任一个任务类型,获取完成该任一个任务类型的多个子任务的资源占用量和资源占用时长,将完成该多个子任务的资源占用量的平均值作为该任一个任务类型对应的资源占用量,将完成该多个子任务的资源占用时长的平均值作为该任一个任务类型对应的资源占用时长。该任一个任务类型对应的资源占用量和资源占用时长可以作为该任一个任务类型的子任务的任务信息,从而能够基于各个子任务的任务类型获取各个子任务的任务信息,基于各个子任务的任务信息,得到各个任务的任务信息。For example, for any task type, the historical execution information corresponding to the any task type includes the resource occupancy amount and resource occupancy duration for completing at least one sub-task of the any task type. For example, for any task type, obtain the resource occupancy and resource occupancy time for completing multiple subtasks of any task type, and use the average value of the resource occupancy for completing the multiple subtasks as the corresponding value for any task type. The average resource occupancy time for completing the multiple subtasks is used as the resource occupancy time corresponding to any task type. The resource occupancy and resource occupancy duration corresponding to any task type can be used as the task information of the sub-tasks of any task type, so that the task information of each sub-task can be obtained based on the task type of each sub-task. Task information, get the task information of each task.
示例性地,在子任务的任务信息包括资源占用量和资源占用时长的情况下,对于任一个任务,将该任一个任务包括的各个子任务的资源占用量相加得到该任一个任务的资源占用量,将各个子任务的资源占用时长相加得到该任一个任务的资源占用时长。For example, when the task information of a sub-task includes resource occupancy and resource occupancy duration, for any task, the resource occupancy of each sub-task included in the any task is added to obtain the resources of any task. Occupancy, add the resource occupancy time of each sub-task to get the resource occupancy time of any task.
也就是说,对于该多个任务中的任一个任务,该任一个任务的任务信息包括但不限于资源占用量和资源占用时长。该任一个任务的资源占用量是指执行该任一个任务所需占用的可用资源量,该任一个任务的资源占用时长是指执行该任一个任务时,占用该可用资源量的时 长。示例性地,在该任一个任务包括多个子任务的情况下,该任一个任务的任务信息包括但不限于该任一个任务包括的各个子任务的资源占用量和资源占用时长。从而,能够获取到较为准确的资源占用情况,进而实现较为准确的资源调整。That is to say, for any one of the multiple tasks, the task information of any one of the tasks includes but is not limited to the resource occupancy amount and the resource occupancy duration. The resource occupancy of any task refers to the amount of available resources required to execute the task. The resource occupancy time of any task refers to the time the available resources are occupied when executing the task. long. For example, when any task includes multiple subtasks, the task information of any task includes but is not limited to the resource occupancy amount and resource occupancy duration of each subtask included in the any task. As a result, a more accurate resource occupancy situation can be obtained, thereby achieving more accurate resource adjustment.
获取任务信息方式二,获取多个任务中的各个任务的任务类型;基于各个任务的任务类型,查询任务类型与任务信息的对应关系,得到各个任务的任务信息,其中,任务类型与任务信息的对应关系基于任务类型和任务信息的配置信息得到。由于各个任务包括的子任务的类型相同,各个任务的任务类型可以为得到各个任务的子任务的任务类型。获取各个任务的任务类型之后,可以基于各个任务的任务类型,查询任务类型与任务信息的对应关系,得到各个任务的任务信息。The second method of obtaining task information is to obtain the task type of each task in multiple tasks; based on the task type of each task, query the corresponding relationship between the task type and the task information, and obtain the task information of each task, where the relationship between the task type and the task information is The corresponding relationship is obtained based on the configuration information of task type and task information. Since each task includes subtasks of the same type, the task type of each task can be obtained by obtaining the task type of the subtask of each task. After obtaining the task type of each task, the corresponding relationship between the task type and task information can be queried based on the task type of each task, and the task information of each task can be obtained.
该任务类型与任务信息的对应关系可以是基于获取到的配置信息生成的。例如,在获取多个任务的任务信息之前,该方法还包括:获取任务类型和任务信息的配置信息;基于该任务类型和任务信息的配置信息,生成任务类型与任务信息的对应关系。The corresponding relationship between the task type and the task information may be generated based on the obtained configuration information. For example, before obtaining the task information of multiple tasks, the method further includes: obtaining the task type and configuration information of the task information; and generating a correspondence between the task type and the task information based on the task type and the configuration information of the task information.
在一种可能的实现方式中,用户为父任务配置父任务信息。父任务信息包括但不限于父任务的资源占用量和资源占用时长。父任务的资源占用量是指执行该父任务所需占用的可用资源量,父任务的资源占用时长是指执行该父任务时,占用该可用资源量的时长。基于该父任务信息生成任务类型和任务信息的配置信息。例如,按照父任务的至少一个执行阶段,将该父任务拆分为至少一个子任务,一个子任务对应一个执行阶段,一个执行阶段对应一个任务类型;基于父任务信息和各个子任务的任务类型,为各个任务类型的子任务配置任务信息。In one possible implementation, the user configures parent task information for the parent task. Parent task information includes but is not limited to the resource usage and resource usage duration of the parent task. The resource occupancy of the parent task refers to the amount of available resources required to execute the parent task, and the resource occupancy time of the parent task refers to the time the available resources are occupied when the parent task is executed. Configuration information of task type and task information is generated based on the parent task information. For example, according to at least one execution stage of the parent task, the parent task is split into at least one subtask, one subtask corresponds to one execution stage, and one execution stage corresponds to one task type; based on the parent task information and the task type of each subtask , configure task information for subtasks of each task type.
示例性地,在父任务信息包括父任务的资源占用量和资源占用时长的情况下,基于父任务信息和各个子任务的任务类型,为各个任务类型的子任务配置任务信息,包括:将父任务的资源占用量和资源占用时长按照任务类型进行拆分,得到各个子任务的资源占用量和资源占用时长。子任务的资源占用量是指执行该子任务所需占用的可用资源量,子任务的资源占用时长是指执行该子任务时,占用该可用资源量的时长。For example, when the parent task information includes the resource occupancy amount and resource occupancy duration of the parent task, based on the parent task information and the task type of each sub-task, configure task information for the sub-tasks of each task type, including: changing the parent task The resource occupancy and resource occupancy time of the task are split according to the task type, and the resource occupancy and resource occupancy time of each sub-task are obtained. The resource occupancy of a subtask refers to the amount of available resources required to execute the subtask, and the resource occupancy time of the subtask refers to the time the available resources are occupied when executing the subtask.
本申请实施例不对按照任务类型对父任务的资源占用量和资源占用时长进行拆分的方式进行限定。例如,各个任务类型具有权重因子,按照各个任务类型的权重因子,对父任务的资源占用量和资源占用时长进行拆分。为各个任务类型的子任务配置任务信息时生成的信息称为任务类型和任务信息的配置信息。当然,用户也可以直接为各个任务类型的子任务配置任务信息。这种情况下,任务类型和任务信息的配置信息为用户为各个任务类型的子任务配置任务信息时生成的信息。通过获取任务类型和任务信息的配置信息,能够生成任务类型与任务信息的对应关系。The embodiments of this application do not limit the method of splitting the resource occupancy and resource occupancy duration of the parent task according to the task type. For example, each task type has a weight factor, and the resource usage and resource usage duration of the parent task are split according to the weight factor of each task type. The information generated when configuring task information for subtasks of each task type is called configuration information of the task type and task information. Of course, users can also directly configure task information for subtasks of each task type. In this case, the configuration information of task type and task information is the information generated when the user configures task information for subtasks of each task type. By obtaining the configuration information of the task type and task information, the corresponding relationship between the task type and the task information can be generated.
示例性地,任务类型与任务信息的对应关系预先存储在用于执行S301的第一模块中。也就是说,第一模块获取各个任务的任务类型之后,可以直接查询存储的任务类型与任务信息的对应关系,得到各个任务的任务信息。本申请实施例提供的方法中,获取任务类型与任务信息的对应关系的方式较为灵活。通过查询任务类型与任务信息的对应关系获取各个任务的任务信息,获取任务信息的效率较高。Exemplarily, the correspondence between the task type and the task information is stored in advance in the first module for performing S301. That is to say, after the first module obtains the task type of each task, it can directly query the corresponding relationship between the stored task type and task information to obtain the task information of each task. In the method provided by the embodiment of the present application, the method of obtaining the correspondence between the task type and the task information is relatively flexible. The task information of each task is obtained by querying the corresponding relationship between the task type and the task information, and the efficiency of obtaining the task information is high.
在获取各个任务的任务类型以及任务类型与任务信息的对应关系之后,可以执行基于各个任务的任务类型,查询任务类型与任务信息的对应关系,得到各个任务的任务信息。该过程可以包括:对于任一个任务包括的任一个子任务,基于该任一个子任务的任务类型,查询任务类型与任务信息的对应关系,得到该任一个子任务的任务信息;基于该任一个任务包括 的各个子任务的任务信息,得到该任一个任务的任务信息。其中,得到该任一个任务的任务信息的方式与获取任务信息方式一中的相关内容原理相同,此处不再赘述。After obtaining the task type of each task and the corresponding relationship between the task type and task information, the task type based on each task can be executed, the corresponding relationship between the task type and task information can be queried, and the task information of each task can be obtained. The process may include: for any subtask included in any task, query the correspondence between the task type and task information based on the task type of any subtask, and obtain the task information of any subtask; based on the task type of any subtask Tasks include The task information of each sub-task is obtained to obtain the task information of any task. The method of obtaining the task information of any task is the same as the related content in method 1 of obtaining the task information, and will not be described again here.
在一种可能的实现方式中,用于执行S301的第一模块存储有各个任务类型的子任务的参考执行时长,子任务的参考执行时长是指由开始执行该子任务到完成该子任务的参考时长。对于任一个任务类型,该任一个任务类型的子任务的参考执行时长可以根据经验或实际需求进行设置,也可以基于该任一个任务类型的子任务的历史执行时长得到。该任一个任务类型的子任务的历史执行时长是指在历史情况中,第一模块完成该任一个任务类型的子任务的执行时长。示例性地,第一模块获取该任一个任务类型的多个子任务的历史执行时长,将该多个历史执行时长的平均值作为该任一个任务类型的子任务的参考执行时长。In a possible implementation, the first module for executing S301 stores the reference execution time of subtasks of each task type. The reference execution time of a subtask refers to the time from starting to execute the subtask to completing the subtask. Reference duration. For any task type, the reference execution time of subtasks of any task type can be set based on experience or actual needs, or can be obtained based on the historical execution time of subtasks of any task type. The historical execution time of the sub-task of any task type refers to the execution time of the first module to complete the sub-task of any task type under historical circumstances. For example, the first module obtains the historical execution duration of multiple subtasks of any task type, and uses the average of the multiple historical execution durations as the reference execution duration of the subtasks of any task type.
第一模块可以基于各个任务类型的子任务的参考执行时长得到各个任务的参考执行时长。例如,对于获取到的任一个任务,第一模块基于该任一个任务包括的子任务的数量和该子任务的参考执行时长,得到该任一个任务的参考执行时长。该任一个任务的参考执行时长是指由开始执行该任一个任务到完成该任一个任务的参考时长。The first module may obtain the reference execution time of each task based on the reference execution time of subtasks of each task type. For example, for any acquired task, the first module obtains the reference execution time of any task based on the number of subtasks included in the any task and the reference execution time of the subtask. The reference execution time of any task refers to the reference time from the start of execution to the completion of any task.
在一种可能的实现方式中,第一模块还获取目标任务的可用资源量,该可用资源量为用于完成该目标任务的可用资源量。获取目标任务的可用资源量,包括:确定参考资源量中未被占用的资源量,将未被占用的资源量作为该目标任务的可用资源量,该参考资源量为用于完成业务需求的可用资源量。也即,该参考资源量为用于完成用户下发的父任务的可用资源量。参考资源量可以由用户根据其业务需求进行设置。示例性地,在可用资源为实例提供的资源的情况下,可用资源量为实例提供的资源量。例如,在图2示出的实施环境中,用于完成业务需求的可用资源包括节点1中的实例1至实例4提供的资源、以及节点2中的实例1至实例4提供的资源,参考资源量为8个实例提供的资源量。在这8个实例均未被占用的情况下,该8个实例提供的资源均为目标任务的可用资源,目标任务的可用资源量为8个实例提供的资源量。In a possible implementation manner, the first module also obtains the amount of available resources for the target task, and the amount of available resources is the amount of available resources used to complete the target task. Obtaining the amount of resources available for the target task includes: determining the amount of unoccupied resources in the reference resource amount, and using the unoccupied resource amount as the amount of available resources for the target task. The amount of reference resources is the amount of available resources used to complete the business requirements. Resources. That is, the reference resource amount is the available resource amount used to complete the parent task issued by the user. The reference resource amount can be set by users according to their business needs. For example, in the case where the available resources are resources provided by the instance, the amount of available resources is the amount of resources provided by the instance. For example, in the implementation environment shown in Figure 2, available resources for completing business requirements include resources provided by Instance 1 to Instance 4 in Node 1, and resources provided by Instance 1 to Instance 4 in Node 2. Reference resources The amount is the amount of resources provided by 8 instances. When none of these eight instances are occupied, the resources provided by these eight instances are all available resources for the target task, and the amount of resources available for the target task is the amount of resources provided by the eight instances.
示例性地,如果可用资源正在执行子任务,该可用资源被占用。由于正在执行的子任务将在一段时间后执行完成,被占用的可用资源可以在子任务执行完成之后变为未被占用的可用资源。也就是说,在不同的时间点上,目标任务的可用资源量可以不同。例如,在执行获取目标任务的可用资源量的操作的时间点上,某些可用资源正在被占用,则目标任务的可用资源量为参考资源量与被占用的可用资源量的差值。在一段时间后,被占用的可用资源中的子任务执行完成且没有被占用的可用资源,则在此情况下,目标任务的可用资源量等于参考资源量。在一种可能的实现方式中,在获取目标任务的可用资源量时,可以获取从执行获取目标任务的可用资源量的操作的时间点起,第一执行时长内的各个时间点对应的未被占用的可用资源量,将各个时间点对应的未被占用的可用资源量作为该目标任务在各个时间点的可用资源量。第一执行时长大于等于该目标任务的参考执行时长。For example, if an available resource is executing a subtask, the available resource is occupied. Since the subtask being executed will be completed after a period of time, the occupied available resources can become unoccupied available resources after the subtask is completed. In other words, at different points in time, the amount of available resources for the target task can be different. For example, at the point in time when the operation of obtaining the available resource amount of the target task is performed, some available resources are being occupied, then the available resource amount of the target task is the difference between the reference resource amount and the occupied available resource amount. After a period of time, the subtasks in the occupied available resources are completed and there are no occupied available resources. In this case, the amount of available resources of the target task is equal to the amount of reference resources. In a possible implementation, when obtaining the amount of available resources of the target task, you can obtain the unused resources corresponding to each time point within the first execution duration from the time point when the operation of obtaining the amount of available resources of the target task is performed. The amount of available resources occupied is the amount of unoccupied available resources corresponding to each time point as the amount of available resources for the target task at each time point. The first execution time is greater than or equal to the reference execution time of the target task.
S302,根据多个任务的任务信息,确定目标任务的资源调整策略。S302: Determine the resource adjustment strategy for the target task based on the task information of multiple tasks.
S302可以由第一模块执行。示例性地,根据多个任务的任务信息,确定目标任务的资源调整策略,包括S3021和S3022。S302 may be executed by the first module. For example, determining the resource adjustment strategy of the target task based on the task information of multiple tasks includes S3021 and S3022.
S3021,根据多个任务的任务信息和多个任务的参考执行时长,计算目标任务的资源需求。S3021: Calculate the resource requirements of the target task based on the task information of multiple tasks and the reference execution time of multiple tasks.
在一种可能的实现方式中,根据多个任务的任务信息和该多个任务的参考执行时长,计算目标任务的资源需求,包括:根据初始资源量和多个任务的任务信息,计算目标任务的预期执行时长;基于该目标任务的预期执行时长和该目标任务的参考执行时长的关系,对初始 资源量进行调整,使得计算的目标任务的预期执行时长不大于该目标任务的参考执行时长;基于该调整后的初始资源量得到该目标任务的资源需求。In one possible implementation, calculating the resource requirements of the target task based on the task information of multiple tasks and the reference execution duration of the multiple tasks includes: calculating the target task based on the initial resource amount and the task information of the multiple tasks. The expected execution time of the target task; based on the relationship between the expected execution time of the target task and the reference execution time of the target task, the initial The resource amount is adjusted so that the calculated expected execution time of the target task is no longer than the reference execution time of the target task; the resource requirements of the target task are obtained based on the adjusted initial resource amount.
其中,该初始资源量可以为该目标任务的可用资源量或者预设的可用资源量。示例性地,如果目标任务在第一执行时长内的各个时间点上的可用资源量不同,该初始资源量可以为目标任务在各个时间点上的可用资源量中的最大值,也即该初始资源量可以等于参考资源量。目标任务的预期执行时长是指由开始执行该目标任务到完成该目标任务的预期时长。The initial resource amount may be the available resource amount of the target task or a preset available resource amount. For example, if the amount of available resources of the target task at each point in time during the first execution duration is different, the initial amount of resources can be the maximum value of the amount of available resources of the target task at each point in time, that is, the initial amount of resources. The resource amount can be equal to the reference resource amount. The expected execution time of a target task refers to the expected time from the start of execution to the completion of the target task.
结合上述S301的内容可知,任务信息可以包括资源占用量和资源占用时长。则在一种可能的实现方式中,基于初始资源量和多个任务的任务信息,计算目标任务的预期执行时长,包括:基于各个任务的资源占用量和资源占用时长,对各个任务进行资源排布,根据排布结果计算目标任务的预期执行时长;其中,该预期执行时长内的各个时间点对应的资源占用量的总量不超过该初始资源量,各个时间点对应的资源占用比例大于等于阈值,该资源占用比例是指该资源占用量的总量与该初始资源量的比值。Based on the content of S301 mentioned above, it can be seen that the task information may include resource occupancy and resource occupancy duration. In one possible implementation, the expected execution time of the target task is calculated based on the initial resource amount and the task information of multiple tasks, including: arranging resources for each task based on the resource occupancy and resource occupancy time of each task. Distribution, calculate the expected execution time of the target task based on the arrangement results; wherein the total amount of resource occupancy corresponding to each time point within the expected execution time does not exceed the initial resource amount, and the proportion of resource occupancy corresponding to each time point is greater than or equal to Threshold, the resource occupancy ratio refers to the ratio of the total amount of resource occupancy to the initial resource amount.
在一种可能的实现方式中,基于各个任务的资源占用量和资源占用时长,对各个任务进行资源排布是指:在以资源量和时间为坐标轴的二维平面上,基于各个任务的资源占用量和资源占用时长,对各个任务进行资源排布;并且对各个任务进行资源排布时,各个时间点对应的资源占用量的总量不超过初始资源量,各个时间点对应的资源占用比例大于等于阈值。阈值可以根据经验或实际需求进行设置,本申请实施例对此不加以限定。例如,阈值为0.5。In one possible implementation, arranging resources for each task based on the resource occupancy and resource occupancy duration of each task means: on a two-dimensional plane with the resource amount and time as the coordinate axes, based on the resource occupancy of each task. Resource occupancy and resource occupancy duration are used to arrange resources for each task; and when arranging resources for each task, the total amount of resource occupancy corresponding to each time point does not exceed the initial resource amount, and the resource occupancy corresponding to each time point is The ratio is greater than or equal to the threshold. The threshold can be set based on experience or actual needs, which is not limited in the embodiments of this application. For example, the threshold is 0.5.
由于对各个任务进行资源排布时,各个时间点对应的资源占用量的总量不超过初始资源量,且资源占用比例大于等于阈值,该资源排布的方式能够使得在不超过初始资源量的情况下,资源利用率较高。再有,通过在以资源量和时间为坐标轴的二维平面上,基于各个任务的资源占用量和资源占用时长进行资源排布,能够实现在时域上对资源进行较为准确的规划,得到的目标任务的资源需求的准确性较高。Since when arranging resources for each task, the total amount of resource occupancy corresponding to each time point does not exceed the initial resource amount, and the resource occupancy ratio is greater than or equal to the threshold. This resource arrangement method can make the resource occupancy not exceed the initial resource amount. In this case, the resource utilization rate is higher. Furthermore, by arranging resources based on the resource occupancy and resource occupancy duration of each task on a two-dimensional plane with the resource amount and time as the coordinate axes, more accurate planning of resources in the time domain can be achieved, and we get The resource requirements of the target tasks are more accurate.
示例性地,对于该多个任务中的任一个任务,该任一个任务包括一个或者多个子任务,对该任一个任务进行资源排布即为对该任一个任务包括的各个子任务进行资源排布。对各个子任务进行资源排布的过程与上述对各个任务进行资源排布的原理相同,此处不再赘述。示例性地,该多个任务包括的多个子任务具有执行顺序,对多个任务包括的各个子任务进行资源排布,包括:按照各个子任务的执行顺序,对各个子任务进行资源排布。各个子任务的执行顺序可以基于各个子任务在任务流中的顺序确定,本申请实施例对此不加以限定。For example, for any one of the multiple tasks, the any task includes one or more subtasks, and arranging resources for any one of the tasks means arranging resources for each of the subtasks included in any of the tasks. cloth. The process of arranging resources for each sub-task is the same as the above-mentioned resource arrangement for each task, and will not be described again here. For example, the multiple subtasks included in the multiple tasks have an execution order, and arranging resources for each subtask included in the multiple tasks includes: arranging resources for each subtask according to the execution order of each subtask. The execution order of each sub-task can be determined based on the order of each sub-task in the task flow, which is not limited in the embodiments of the present application.
在得到目标任务的预期执行时长之后,根据该目标任务的预期执行时长和该目标任务的参考执行时长的关系的不同情况,对初始资源量进行调整,进而得到该目标任务的资源需求,包括但不限于如下情况A和情况B。After obtaining the expected execution time of the target task, the initial resource amount is adjusted based on the relationship between the expected execution time of the target task and the reference execution time of the target task, and then the resource requirements of the target task are obtained, including but Not limited to the following situations A and B.
情况A,目标任务的预期执行时长大于目标任务的参考执行时长。In case A, the expected execution time of the target task is greater than the reference execution time of the target task.
在一种可能的实现方式中,如果确定的目标任务的预期执行时长大于该目标任务的参考执行时长,则意味着该初始资源量不足,需要增大初始资源量。也就是说,在目标任务的预期执行时长大于该目标任务的参考执行时长的情况下,通过增加资源量的方式对初始资源量进行调整。In a possible implementation manner, if the expected execution time of the determined target task is greater than the reference execution time of the target task, it means that the initial resource amount is insufficient and the initial resource amount needs to be increased. That is to say, when the expected execution time of the target task is greater than the reference execution time of the target task, the initial resource amount is adjusted by increasing the resource amount.
之后,基于增大后的初始资源量以及多个任务的任务信息,计算该目标任务的预期执行时长。如果计算的目标任务的预期执行时长仍大于该目标任务的参考执行时长,对该增大后的初始资源量再次增大,直到基于增大后的初始资源量和多个任务的任务信息计算的该目标 任务的预期执行时长不大于该目标任务的参考执行时长为止,将此时的增大后的初始资源量作为该目标任务的资源需求。Afterwards, based on the increased initial resource amount and the task information of multiple tasks, the expected execution time of the target task is calculated. If the calculated expected execution time of the target task is still greater than the reference execution time of the target task, the increased initial resource amount is increased again until the calculated based on the increased initial resource amount and task information of multiple tasks. The target Until the expected execution time of the task is no longer than the reference execution time of the target task, the increased initial resource amount at this time will be regarded as the resource requirement of the target task.
情况B,目标任务的预期执行时长不大于该目标任务的参考执行时长。In case B, the expected execution time of the target task is not greater than the reference execution time of the target task.
示例性地,如果目标任务的预期执行时长不大于该目标任务的参考执行时长,可以不对初始资源量进行调整,将该初始资源量作为该目标任务的资源需求。当然,在此情况下,也可以对该初始资源量进行调整。例如,响应于目标任务的预期执行时长不大于目标任务的参考执行时长,减小初始资源量。基于减小后的初始资源量和多个任务的任务信息,计算该目标任务的预期执行时长。如果基于减小后的初始资源量和多个任务的任务信息计算的该目标任务的预期执行时长仍不大于该目标任务的参考执行时长,可以对该减小后的初始资源量再次减小,直到计算出的该目标任务的预期执行时长大于该目标任务的参考执行时长。获取最后一次满足目标任务的预期执行时长不大于目标任务的参考执行时长的资源量,将获取到的资源量作为该目标任务的资源需求。也就是说,该资源需求所对应的资源量是能够满足计算出的目标任务的预期执行时长不大于该目标任务的参考执行时长的最小资源量。从而,在将该资源量作为资源需求的情况下,能够使得用于执行该目标任务的资源量较小,节约资源。For example, if the expected execution time of the target task is not greater than the reference execution time of the target task, the initial resource amount may not be adjusted, and the initial resource amount may be used as the resource requirement of the target task. Of course, in this case, the initial resource amount can also be adjusted. For example, in response to the expected execution time of the target task being no greater than the reference execution time of the target task, the initial resource amount is reduced. Based on the reduced initial resource amount and task information of multiple tasks, the expected execution time of the target task is calculated. If the expected execution time of the target task calculated based on the reduced initial resource amount and task information of multiple tasks is still not greater than the reference execution time of the target task, the reduced initial resource amount can be reduced again, Until the calculated expected execution time of the target task is greater than the reference execution time of the target task. Obtain the last resource amount that satisfies the expected execution time of the target task and is not greater than the reference execution time of the target task, and use the obtained resource amount as the resource requirement of the target task. That is to say, the amount of resources corresponding to the resource requirement is the minimum amount of resources that can satisfy the calculated expected execution time of the target task, which is not greater than the reference execution time of the target task. Therefore, when the resource amount is used as the resource requirement, the resource amount used to execute the target task can be made smaller, thereby saving resources.
在一种可能的实现方式中,完成资源调整会需要一定的时长,则在需要对初始资源量进行调整的情况下,对该时长以后的时间点对应的初始资源量进行调整。在完成对初始资源量的调整之后,再执行资源排布的操作。完成资源调整的过程将在后文中进行说明,此处暂不展开介绍。示例性地,确定需要对初始资源量进行调整的时间点称为第一时间点,完成资源调整所需的时长称为伸缩时长,对初始资源量进行调整后,对多个任务进行资源排布得到的排布结果可如图4所示。图4示出的排布结果中,对初始资源量进行调整的方式为增加资源量。In one possible implementation, it will take a certain amount of time to complete the resource adjustment. If the initial resource amount needs to be adjusted, the initial resource amount corresponding to the time point after the time period is adjusted. After completing the adjustment of the initial resource amount, perform the resource arrangement operation. The process of completing resource adjustment will be explained later and will not be introduced here. For example, the time point when it is determined that the initial resource amount needs to be adjusted is called the first time point, and the time required to complete the resource adjustment is called the scaling duration. After the initial resource amount is adjusted, resources are arranged for multiple tasks. The obtained arrangement results can be shown in Figure 4. In the arrangement result shown in Figure 4, the initial resource amount is adjusted by increasing the resource amount.
S3022,根据目标任务的资源需求和目标任务的可用资源量,确定目标任务的资源调整策略,该资源调整策略用于使得调整后的目标任务的可用资源量满足目标任务的资源需求。S3022: Determine a resource adjustment strategy for the target task based on the resource requirements of the target task and the amount of available resources of the target task. The resource adjustment strategy is used to make the adjusted amount of available resources of the target task meet the resource requirements of the target task.
示例性地,在目标任务的资源需求大于目标任务的可用资源量的情况下,确定该目标任务的资源调整策略为增加目标任务的可用资源量,使得增加后的目标任务的可用资源量不小于目标任务的资源需求。该资源调整策略还可以包括该资源需求与可用资源量的差值,也即,目标任务的资源调整策略为按照该目标任务的资源需求与该目标任务的可用资源量的差值,增加目标任务的可用资源量。For example, when the resource requirements of the target task are greater than the amount of available resources of the target task, the resource adjustment strategy for the target task is determined to increase the amount of available resources of the target task, so that the increased amount of available resources of the target task is not less than Resource requirements for the target task. The resource adjustment strategy may also include the difference between the resource demand and the available resource amount. That is, the resource adjustment strategy of the target task is to increase the target task according to the difference between the resource demand of the target task and the available resource amount of the target task. the amount of available resources.
示例性地,在目标任务的资源需求小于目标任务的可用资源量的情况下,确定该目标任务的资源调整策略为减少目标任务的可用资源量,减少后的目标任务的可用资源量不小于目标任务的资源需求。该资源调整策略还可以包括可用资源量与该资源需求的差值,也即,目标任务的资源调整策略为按照该目标任务的可用资源量与该目标任务的资源需求的差值,减少目标任务的可用资源量。在目标任务的资源需求小于目标任务的可用资源量的情况下,也可以保持该目标任务的可用资源量不变,目标任务的可用资源量不小于该目标任务的可用资源量即可。For example, when the resource requirement of the target task is less than the amount of available resources of the target task, the resource adjustment strategy of the target task is determined to reduce the amount of available resources of the target task, and the reduced amount of available resources of the target task is not less than the target The resource requirements of the task. The resource adjustment strategy may also include the difference between the amount of available resources and the resource demand. That is, the resource adjustment strategy for the target task is to reduce the target task according to the difference between the amount of available resources for the target task and the resource demand for the target task. the amount of available resources. When the resource requirement of the target task is less than the available resource amount of the target task, the available resource amount of the target task can also be kept unchanged, as long as the available resource amount of the target task is not less than the available resource amount of the target task.
当然,目标任务的资源需求也可以等于该目标任务的可用资源量。在此情况下,目标任务的资源调整策略为保持目标任务的可用资源量不变。Of course, the resource requirements of the target task can also be equal to the amount of available resources for the target task. In this case, the resource adjustment strategy of the target task is to keep the amount of available resources of the target task unchanged.
为便于说明,将实例提供的资源量简称为实例资源量。在一种可能的实现方式中,如果可用资源为实例,该目标任务的资源需求即为完成该目标任务所需的实例资源量,该目标任务的可用资源量为用于完成该目标任务的实例资源量。在目标任务的资源需求大于该目标任 务的可用资源量的情况下,该目标任务的资源调整策略为增加用于完成该目标任务的实例资源量。在目标任务的资源需求等于该目标任务的可用资源量的情况下,该目标任务的资源调整策略为保持用于完成该目标任务的实例资源量不变。在目标任务的资源需求小于该目标任务的可用资源量的情况下,该目标任务的资源调整策略为减少用于完成该目标任务的实例资源量、或者保持用于完成该目标任务的实例资源量。For ease of explanation, the amount of resources provided by an instance is referred to as the amount of instance resources. In one possible implementation, if the available resources are instances, the resource requirements of the target task are the amount of instance resources required to complete the target task, and the amount of available resources for the target task is the instance used to complete the target task. Resources. When the resource requirements of the target task are greater than the target task If the amount of available resources for the task is determined, the resource adjustment strategy for the target task is to increase the amount of instance resources used to complete the target task. When the resource requirement of the target task is equal to the amount of available resources of the target task, the resource adjustment strategy of the target task is to keep the amount of instance resources used to complete the target task unchanged. When the resource requirements of the target task are less than the amount of available resources for the target task, the resource adjustment strategy for the target task is to reduce the amount of instance resources used to complete the target task, or to maintain the amount of instance resources used to complete the target task. .
通过计算目标资源的资源需求,该方法能够对完成该目标任务所需的资源量进行提前感知。在需要进行资源调整的情况下,该方法中由感知到需要进行资源调整到完成对资源调整所需的时间较短,从而能够降低资源调整所需的时长,提高资源调整的效率。By calculating the resource requirements of the target resources, this method can sense in advance the amount of resources required to complete the target task. When resource adjustment is required, the time required from sensing the need for resource adjustment to completing the resource adjustment is shorter in this method, thereby reducing the time required for resource adjustment and improving the efficiency of resource adjustment.
S303,当目标任务满足第一资源调整条件,或者运行该目标任务的实例满足第二资源调整条件时,基于该目标任务的资源调整策略调整用于运行该目标任务的实例的数量和规格中的至少一种。S303. When the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition, adjust the number and specifications of the instances used to run the target task based on the resource adjustment policy of the target task. At least one.
S303可以由第一模块执行。在本申请实施例中,如果目标任务满足第一资源调整调节,或者运行该目标任务的实例满足第二资源调整条件,意味着目标任务的可用资源量不能满足该目标任务的资源需求,需要对目标任务的可用资源量进行调整。目标任务的可用资源量可以为用于运行该目标任务的实例提供的资源量。示例性地,目标任务满足第一资源调整条件,包括:目标任务的预期执行时长大于该目标任务的参考执行时长。该目标任务的预期执行时长的相关内容可参见S3021,此处不再赘述。示例性地,运行目标任务的实例满足第二资源调整条件,包括:运行目标任务的实例的CPU占用率高于占用率阈值。占用率阈值可以基于需求或实际经验进行设置,本申请实施例对此不加以限定。S303 may be executed by the first module. In the embodiment of this application, if the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition, it means that the amount of available resources of the target task cannot meet the resource requirements of the target task, and it is necessary to The amount of available resources for the target task is adjusted. The amount of resources available for a target task can be the amount of resources provided by the instance used to run the target task. For example, the target task satisfies the first resource adjustment condition, including: the expected execution time of the target task is greater than the reference execution time of the target task. For information about the expected execution time of the target task, please refer to S3021, which will not be described again here. For example, the instance running the target task satisfies the second resource adjustment condition, including: the CPU usage of the instance running the target task is higher than the usage threshold. The occupancy threshold can be set based on demand or actual experience, which is not limited in the embodiments of the present application.
在本申请实施例中,不同规格的实例提供的资源量不同,则基于该目标任务的资源调整策略调整该目标任务的可用资源量是指:基于该目标任务的资源调整策略调整用于运行该目标任务的实例的数量和规格中的至少一种。在一种可能的实现方式中,第一模块执行基于目标任务的资源调整策略调整目标任务的实例和数量和规格中的至少一种。在另一种可能的实现方式中,第一模块向第二模块发送控制指令,该第二模块为管理实例的数量和规格的模块,该控制指令用于指示第二模块基于该目标任务的资源调整策略调整用于运行该目标任务的实例的数量和规格中的至少一种。第一模块和第二模块可以属于同一个设备或者不同的设备。In the embodiment of the present application, instances of different specifications provide different amounts of resources, so adjusting the amount of available resources for the target task based on the resource adjustment policy of the target task means: adjusting the amount of resources used to run the target task based on the resource adjustment policy of the target task. At least one of the number and specifications of instances of the target task. In a possible implementation, the first module executes a resource adjustment strategy based on the target task to adjust at least one of the instances, quantity, and specifications of the target task. In another possible implementation, the first module sends a control instruction to the second module, which is a module that manages the number and specifications of instances. The control instruction is used to instruct the second module to use resources based on the target task. The adjustment strategy adjusts at least one of the number and specifications of instances used to run the target task. The first module and the second module may belong to the same device or different devices.
示例性地,在图2示出的实施环境中,第一模块为任务资源控制模块,第二模块为控制中心。则当目标任务满足第一资源调整条件,或者运行目标任务的实例满足第二资源调整条件时,任务资源控制模块向控制中心发送控制指令,该控制指令用于指示控制中心基于目标任务的资源调整策略调整用于运行该目标任务的实例的数量和规格中的至少一种。For example, in the implementation environment shown in Figure 2, the first module is the task resource control module, and the second module is the control center. Then when the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition, the task resource control module sends a control instruction to the control center, and the control instruction is used to instruct the control center to adjust resources based on the target task. The policy adjusts at least one of the number and specifications of instances used to run the target task.
在一种可能的实现方式中,该方法还包括:接收用户配置的资源更新限制,该资源更新限制包括最大费用和运行目标任务的实例的最大数量中的至少一种;基于资源调整策略调整用于运行目标任务的实例的数量和规格中的至少一种,包括:基于资源调整策略和该资源更新限制,调整用于运行目标任务的实例的数量和规格中的至少一种。通过基于用户配置的资源更新限制进行资源调整,能够保证调整后的资源符合用户需求。In a possible implementation, the method further includes: receiving a resource update limit configured by the user, where the resource update limit includes at least one of a maximum cost and a maximum number of instances running the target task; adjusting the usage based on the resource adjustment policy. Adjusting at least one of the number and specifications of instances for running the target task includes: adjusting at least one of the number and specifications of the instances for running the target task based on the resource adjustment policy and the resource update limit. Resource adjustment based on user-configured resource update restrictions can ensure that the adjusted resources meet user needs.
相较于相关技术中按照固定值对资源进行增加或减少,本申请实施例提供的方法中,通过先确定目标任务的资源调整策略,再基于目标任务的资源调整策略进行资源调整,资源调整的准确性较高且资源调整的方式较为灵活。Compared with increasing or decreasing resources according to fixed values in related technologies, in the method provided by the embodiment of the present application, the resource adjustment strategy of the target task is first determined, and then the resource adjustment is performed based on the resource adjustment strategy of the target task. The accuracy is higher and the resource adjustment method is more flexible.
示例性地,在图2示出的实施环境中,增加用于运行目标任务的实例的数量,包括:从节 点池中获取节点,从镜像仓库复制镜像到获取的节点中以得到新的实例。减少用于运行目标任务的实例的数量,包括:删除工作负载包括的实例。调整用于运行目标任务的实例的规格,包括:从节点池中获取节点,从镜像仓库复制镜像到获取的节点中以得到新的实例,该新的实例用于替换当前工作负载中的实例,实现对实例的规格的调整。Exemplarily, in the implementation environment shown in Figure 2, increasing the number of instances used to run the target task includes: Obtain a node from the point pool and copy the image from the image warehouse to the acquired node to obtain a new instance. Reduce the number of instances used to run target tasks, including deleting instances included in the workload. Adjust the specifications of the instance used to run the target task, including: obtaining a node from the node pool, copying the image from the image warehouse to the obtained node to obtain a new instance, and the new instance is used to replace the instance in the current workload, Adjust the instance specifications.
在一种可能的实现方式中,该方法还包括:对于该目标任务包括的任一个子任务,在调整后的用于该目标任务的实例中,确定与该任一个子任务对应的目标实例,通过该目标实例执行该任一个子任务。通过确定子任务对应的目标实例,再通过目标实例执行该子任务,能够实现对用于执行该子任务的实例的控制。相较于将各个子任务向工作负载发送,由工作负载确定用于执行各个子任务的实例的方式,能够对用于执行各个子任务的实例进行精确控制。示例性地,该确定任一个子任务对应的目标实例,通过该目标实例执行该任一个子任务的操作由第一模块执行。In a possible implementation, the method further includes: for any subtask included in the target task, determining a target instance corresponding to any subtask in the adjusted instance used for the target task, Execute any subtask through the target instance. By determining the target instance corresponding to the subtask, and then executing the subtask through the target instance, the instance used to execute the subtask can be controlled. Rather than sending individual subtasks to the workload, the workload determines the instance used to perform each subtask, allowing precise control over the instances used to perform each subtask. Illustratively, the operation of determining a target instance corresponding to any subtask and executing the any subtask through the target instance is performed by the first module.
在本申请实施例提供的方法中,获取多个任务的任务信息,基于多个任务的任务信息确定该多个任务中的目标任务的资源调整策略。该方法能够全面感知该多个任务,基于该多个任务的任务信息确定出的目标任务的资源调整策略的准确性较高。从而,在基于该目标任务的资源调整策略进行资源调整的情况下,资源调整的准确性较高。In the method provided by the embodiment of the present application, task information of multiple tasks is obtained, and the resource adjustment strategy of the target task in the multiple tasks is determined based on the task information of the multiple tasks. This method can comprehensively perceive the multiple tasks, and determine the resource adjustment strategy for the target task based on the task information of the multiple tasks with high accuracy. Therefore, when resource adjustment is performed based on the resource adjustment strategy of the target task, the accuracy of resource adjustment is high.
接下来,以本申请实施例提供的方法应用于图2示出的实施环境以及离线视频转码场景为例进行说明,以更清楚地说明本申请实施例提供的资源调整方法。图5是本申请实施例提供的一种资源调整方法的过程示意图。Next, the method provided by the embodiment of the present application is applied to the implementation environment and the offline video transcoding scenario shown in Figure 2 as an example to illustrate more clearly the resource adjustment method provided by the embodiment of the present application. Figure 5 is a schematic process diagram of a resource adjustment method provided by an embodiment of the present application.
参见图5,业务需求包括N个离线视频转码任务,分别为转码任务1、转码任务2、…、转码任务N,N为正整数。基于该N个离线视频转码任务获取N个任务流,对于该N个任务流中的第i个任务流,该第i个任务流包括四个子任务,分别为获取元数据任务i、切片任务i、转码任务i和合并任务i,i为大于0且小于等于N的整数。这四个子任务的任务类型分别为获取元数据、切片、转码和合并。按照各个子任务的顺序将该N个任务流存储在任务队列中,如图5所示,该任务队列中存储的子任务包括:获取元数据任务1、切片任务1、获取元数据任务2、获取元数据任务3、转码任务1、切片任务2、…、合并任务N。Referring to Figure 5, the business requirements include N offline video transcoding tasks, which are transcoding task 1, transcoding task 2, ..., and transcoding task N, where N is a positive integer. N task streams are obtained based on the N offline video transcoding tasks. For the i-th task stream among the N task streams, the i-th task stream includes four subtasks, namely the metadata acquisition task i and the slicing task. i, transcoding task i and merging task i, where i is an integer greater than 0 and less than or equal to N. The task types of these four subtasks are obtaining metadata, slicing, transcoding and merging respectively. The N task flows are stored in the task queue in the order of each sub-task, as shown in Figure 5. The sub-tasks stored in the task queue include: Get Metadata Task 1, Slice Task 1, Get Metadata Task 2, Get metadata task 3, transcoding task 1, slicing task 2, ..., merge task N.
示例性地,该任务队列中的各个子任务均为待执行的子任务。工作负载中的实例为容器,各个容器均未被占用,也即各个容器均空闲。任务资源控制模块获取任务队列中的待执行的子任务,基于获取到的待执行的子任务获取多个任务。例如,基于各个子任务的任务类型,将同一个任务类型的子任务作为得到的一个任务。For example, each sub-task in the task queue is a sub-task to be executed. The instances in the workload are containers, and each container is not occupied, that is, each container is idle. The task resource control module obtains the subtasks to be executed in the task queue, and obtains multiple tasks based on the obtained subtasks to be executed. For example, based on the task type of each subtask, subtasks of the same task type are regarded as one obtained task.
目标任务可以为该多个任务中的任一个任务,以该多个任务中的目标任务为转码任务为例,该转码任务包括转码任务1至转码任务N。该转码任务的可用资源包括图5中的容器1、容器2、容器3、…、容器M,也即该转码任务的可用资源量为M,M为正整数。The target task can be any one of the plurality of tasks. For example, the target task in the plurality of tasks is a transcoding task. The transcoding task includes transcoding task 1 to transcoding task N. The available resources of the transcoding task include container 1, container 2, container 3, ..., and container M in Figure 5, that is, the amount of available resources for the transcoding task is M, and M is a positive integer.
获取多个任务之后,任务资源控制模块可以获取该多个任务中的各个任务的任务信息。示例性地,任务资源控制模块先获取各个任务的任务类型,再基于各个任务的任务类型,获取各个任务的任务信息。例如,任务资源控制模块基于各个任务类型对应的历史执行信息获取各个任务的任务信息,或者通过查询任务类型与任务信息的对应关系,得到各个任务的任务信息。After obtaining multiple tasks, the task resource control module can obtain the task information of each task in the multiple tasks. For example, the task resource control module first obtains the task type of each task, and then obtains the task information of each task based on the task type of each task. For example, the task resource control module obtains the task information of each task based on the historical execution information corresponding to each task type, or obtains the task information of each task by querying the correspondence between the task type and the task information.
在一种可能的实现方式中,任务资源控制模块中还存储有任务类型—元数据—任务信息 的对应关系。元数据为业务需求的执行对象的数据,例如,对于离线视频转码任务,元数据包括但不限于视频的分辨率、时长和码率。各个视频的元数据可以不同,从而对于分别对多个视频执行且类型相同的多个子任务,该多个子任务的任务信息可以不同。例如,对于分辨率不同的两个视频,在对这两个视频执行的转码的子任务的资源占用量相同的情况下,对分辨率较高的视频执行的转码的子任务的资源占用时长较长。在对这两个视频执行的转码的子任务的资源占用时长相同的情况下,对分辨率较高的视频执行的转码的子任务的资源占用量较高。In a possible implementation, the task resource control module also stores task type-metadata-task information. corresponding relationship. Metadata is the data of the execution object of business requirements. For example, for offline video transcoding tasks, metadata includes but is not limited to the resolution, duration, and bit rate of the video. The metadata of each video may be different, so that for multiple subtasks of the same type that are respectively performed on multiple videos, the task information of the multiple subtasks may be different. For example, for two videos with different resolutions, if the resource occupancy of the transcoding subtask performed on the two videos is the same, the resource occupancy of the transcoding subtask performed on the video with a higher resolution will be the same. The duration is longer. When the resource occupancy time of the transcoding subtask performed on the two videos is the same, the resource occupancy of the transcoding subtask performed on the video with a higher resolution is higher.
该任务类型—元数据—任务信息的对应关系也可以用于获取子任务的任务信息。例如,对于某一个任务流,通过先执行其中的获取元数据的子任务,能够获取到元数据,进而对于该任务流中的其他子任务,可以基于任务类型和获取到的元数据,查询任务类型—元数据—任务信息的对应关系,得到该子任务的任务信息。该任务类型—元数据—任务信息的对应关系可以是通过对多个测试视频分别执行各个任务类型的子任务,统计各个任务类型的子任务的资源占用量和资源占用时长得到的,该多个测试视频的元数据不同。The correspondence between task type-metadata-task information can also be used to obtain task information of subtasks. For example, for a certain task flow, metadata can be obtained by first executing the subtask of obtaining metadata, and then for other subtasks in the task flow, the task can be queried based on the task type and the obtained metadata. Correspondence between type-metadata-task information to obtain the task information of the subtask. The correspondence between task type-metadata-task information can be obtained by executing subtasks of each task type on multiple test videos, and counting the resource occupancy and resource occupancy time of the subtasks of each task type. The multiple The test videos have different metadata.
为便于说明,将任务类型与任务信息的对应关系称为第一查询关系,将任务类型—元数据—任务信息的对应关系称为第二查询关系。对于相同任务类型的两个子任务,由于第二查询关系中不同的元数据可以对应不同的任务信息,相较于基于第一查询关系得到的子任务的任务信息,基于第二查询关系得到的子任务的任务信息可以更加准确。从而,在基于第一查询关系得到的子任务的任务信息与基于第二查询关系得到的子任务的任务信息不同的情况下,任务资源控制模块可以将基于第二查询关系得到的子任务的任务信息作为资源排布时使用的任务信息。For ease of explanation, the corresponding relationship between task type and task information is called the first query relationship, and the corresponding relationship between task type-metadata-task information is called the second query relationship. For two subtasks of the same task type, since different metadata in the second query relationship can correspond to different task information, compared with the task information of the subtask obtained based on the first query relationship, the subtasks obtained based on the second query relationship Mission information for tasks can be more accurate. Therefore, when the task information of the subtask obtained based on the first query relationship is different from the task information of the subtask obtained based on the second query relationship, the task resource control module can change the task information of the subtask obtained based on the second query relationship. Information is used as task information when arranging resources.
示例性地,任务信息包括资源占用量和资源占用时长,任务资源控制模块基于各个任务的资源占用量和资源占用时长,对各个任务进行资源排布。在一种可能的实现方式中,任务资源控制模块对各个任务进行资源排布时,按照各个任务的执行顺序,对各个任务进行资源排布。由于任务资源控制模块还可以存储有任务类型—元数据—任务信息的对应关系,任务资源控制模块可以排布获取元数据任务先执行,从而能够进一步基于获取到的元数据查询任务类型—元数据—任务信息的对应关系,进而能够获取到较为准确的任务信息。For example, the task information includes resource occupancy and resource occupancy duration. The task resource control module arranges resources for each task based on the resource occupancy and resource occupancy duration of each task. In a possible implementation manner, when the task resource control module arranges resources for each task, it arranges resources for each task according to the execution order of each task. Since the task resource control module can also store the corresponding relationship between task type-metadata-task information, the task resource control module can arrange the task of obtaining metadata to be executed first, so that it can further query the task type-metadata based on the obtained metadata. —The corresponding relationship between task information, and thus more accurate task information can be obtained.
图6是本申请实施例提供的一种资源排布过程的示意图。如图6所示,任务资源控制模块获取各个子任务的资源占用量和资源占用时长;对各个子任务进行分类;基于各个子任务的资源占用量和资源占用时长,对分类后的各个子任务进行资源排布。Figure 6 is a schematic diagram of a resource arrangement process provided by an embodiment of the present application. As shown in Figure 6, the task resource control module obtains the resource occupancy and resource occupancy time of each sub-task; classifies each sub-task; based on the resource occupancy and resource occupancy time of each sub-task, classifies each sub-task Arrange resources.
参见图6,各个时间点的可用资源量分别作为各个时间点对应的初始资源量。对分类后的各个子任务进行资源排布时,先排布所有的获取元数据的子任务,使得各个获取元数据的子任务先执行,获取到的元数据能够用于获取其他子任务的任务信息。然后排布切片的子任务,若某一个切片的子任务的资源占用时长较短,可以先排布与该切片的子任务属于同一个任务流的转码的子任务,以使该任务流的任务较早完成。排布切片的子任务时,也可以先排布所有的切片的子任务再排布转码的子任务,仅需满足预期执行时长内的各个时间点对应的资源占用量的总量不超过初始资源量,且各个时间点对应的资源占用比例大于等于阈值即可。Referring to Figure 6, the amount of available resources at each time point is used as the initial resource amount corresponding to each time point. When arranging resources for each classified sub-task, all sub-tasks for obtaining metadata are arranged first, so that each sub-task for obtaining meta-data is executed first, and the obtained meta-data can be used to obtain tasks for other sub-tasks. information. Then arrange the subtasks of the slices. If the resource occupation time of the subtasks of a certain slice is short, you can first arrange the transcoding subtasks that belong to the same task flow as the subtasks of the slice, so that the task flow can be Tasks are completed earlier. When arranging slice subtasks, you can also arrange all slice subtasks first and then arrange the transcoding subtasks, as long as the total resource usage corresponding to each time point within the expected execution time does not exceed the initial The amount of resources, and the proportion of resource occupation corresponding to each time point is greater than or equal to the threshold.
通过对多个任务进行资源排布,能够计算该目标任务的预期执行时长。从而在该目标任务的预期执行时长和目标任务的参考执行时长不同的情况下,可以基于该目标任务的预期执行时长和该目标任务的参考执行时长的关系,对初始资源量进行调整,使得通过资源排布计 算的目标任务的预期执行时长不大于该目标任务的参考执行时长。By arranging resources for multiple tasks, the expected execution time of the target task can be calculated. Therefore, when the expected execution time of the target task and the reference execution time of the target task are different, the initial resource amount can be adjusted based on the relationship between the expected execution time of the target task and the reference execution time of the target task, so that through Resource Arrangement Plan The calculated expected execution time of the target task is not greater than the reference execution time of the target task.
图6中仅示出了部分任务的排布结果,并不用于对执行资源排布的任务的任务类型和任务数量进行限定。示例性地,根据图6中的排布结果得到的目标任务的资源需求大于目标任务的可用资源量。该资源需求可以为图5所示的M+1。在此情况下,任务资源控制模块向控制中心发送控制指令,指示控制中心对可用资源量进行调整,使得调整后的可用资源量不小于M+1。例如,参见图5,控制中心基于接收到的控制指令生成容器M+1,实现对可用资源量的调整。Figure 6 only shows the arrangement results of some tasks, and is not used to limit the task types and number of tasks for performing resource arrangement. For example, the resource requirement of the target task obtained according to the arrangement result in Figure 6 is greater than the amount of available resources of the target task. The resource requirement may be M+1 as shown in Figure 5. In this case, the task resource control module sends a control instruction to the control center, instructing the control center to adjust the amount of available resources so that the adjusted amount of available resources is not less than M+1. For example, referring to Figure 5, the control center generates container M+1 based on the received control instructions to adjust the amount of available resources.
在一种可能的实现方式中,该任务资源控制模块还可以确定目标任务包括的各个子任务对应的目标实例,以通过各个子任务对应的目标实例执行该各个子任务。例如,如图5所示,任务资源控制模块确定该目标任务包括的各个子任务对应的目标容器,向工作负载发送该各个子任务,通过工作负载中该各个子任务对应的目标容器执行该各个子任务。In a possible implementation manner, the task resource control module can also determine the target instance corresponding to each sub-task included in the target task, so as to execute each sub-task through the target instance corresponding to each sub-task. For example, as shown in Figure 5, the task resource control module determines the target container corresponding to each sub-task included in the target task, sends each sub-task to the workload, and executes each sub-task through the target container corresponding to each sub-task in the workload. Subtasks.
示例性地,对于离线视频转码场景,在转码任务包括40个转码的子任务,该40个子任务的可用资源为1个容器,也即该目标任务的可用资源量为1的情况下,相关技术的方法以及本申请实施例提供的方法中容器的CPU占用情况如图7所示。For example, for an offline video transcoding scenario, the transcoding task includes 40 transcoding subtasks, and the available resources of the 40 subtasks are 1 container, that is, the available resources of the target task are 1. , the CPU occupancy of the container in the method of the related art and the method provided by the embodiment of the present application is shown in Figure 7.
图7是本申请实施例提供的一种容器的CPU占用情况的示意图。其中,图7的(1)对应相关技术的方法中容器的CPU占用情况,图7的(2)对应本申请实施例提供的方法中容器的CPU占用情况。无论是图7的(1)还是图7的(2),横轴均表示时间,纵轴均表示容器的CPU占用情况。可以看到,相关技术的方法中,转码任务下发的时间在15:21左右,在下发后6分钟左右,也即15:27左右,才有新的容器生成并运行转码任务。在本申请实施例提供的方法中,转码任务下发的时间在15:47左右,在下发后1分钟左右,也即15:48左右,有新的容器生成并运行转码任务。本申请实施例提供的方法由资源量需要调整到资源量调整完毕所需的时间较短。Figure 7 is a schematic diagram of the CPU usage of a container provided by an embodiment of the present application. Among them, (1) in Figure 7 corresponds to the CPU occupancy of the container in the method of the related art, and (2) in Figure 7 corresponds to the CPU occupancy of the container in the method provided by the embodiment of the present application. Whether it is (1) in Figure 7 or (2) in Figure 7, the horizontal axis represents time, and the vertical axis represents the CPU usage of the container. It can be seen that in the method of related technologies, the time when the transcoding task is issued is around 15:21, and only about 6 minutes after it is issued, that is, around 15:27, a new container is generated and runs the transcoding task. In the method provided by the embodiment of this application, the time when the transcoding task is issued is around 15:47. About 1 minute after it is issued, that is, around 15:48, a new container generates and runs the transcoding task. The method provided by the embodiments of the present application requires a shorter time from when the resource amount needs to be adjusted to when the resource amount is adjusted.
图8是本申请实施例提供的一种转码任务的完成时间的示意图。如图8所示,相关技术的方法中,该40个子任务的完成时间连成的折线为图8示出的两条折线中位于上方的一条,该40个子任务中后25个子任务的完成时间均在500秒(second,s)左右。本申请实施例提供的方法中,该40个子任务的完成时间连成的折线为图8示出的两条折线中位于下方的一条,该40个子任务的完成时间在300s左右。如图8所示,本申请实施例提供的方法中的转码任务的完成时长较短。Figure 8 is a schematic diagram of the completion time of a transcoding task provided by an embodiment of the present application. As shown in Figure 8, in the method of the related art, the polyline connecting the completion times of the 40 subtasks is the upper one of the two polylines shown in Figure 8, and the completion time of the last 25 subtasks among the 40 subtasks is Both are around 500 seconds (second, s). In the method provided by the embodiment of the present application, the polyline connecting the completion times of the 40 subtasks is the lower one of the two polylines shown in Figure 8 , and the completion time of the 40 subtasks is about 300s. As shown in Figure 8, the completion time of the transcoding task in the method provided by the embodiment of the present application is short.
图9是本申请实施例提供的一种资源调整装置的结构示意图。示例性地,该装置应用于图1所示的第一模块或图2所示的任务资源控制模块,以实现本申请实施例提供的资源调整方法。基于图9所示的如下多个单元,该图9所示的资源调整装置能够执行该第一模块或者该任务资源控制模块所执行的全部或部分操作。应理解到,该装置可以包括比所示单元更多的附加单元或者省略其中所示的一部分单元,本申请实施例对此不进行限制。如图9所示,该装置包括:Figure 9 is a schematic structural diagram of a resource adjustment device provided by an embodiment of the present application. Illustratively, the device is applied to the first module shown in Figure 1 or the task resource control module shown in Figure 2 to implement the resource adjustment method provided by the embodiment of the present application. Based on the following multiple units shown in Figure 9, the resource adjustment device shown in Figure 9 can perform all or part of the operations performed by the first module or the task resource control module. It should be understood that the device may include more additional units than those shown or omit some of the units shown, and this is not limited by the embodiments of the present application. As shown in Figure 9, the device includes:
获取单元901,用于获取多个任务的任务信息,多个任务中包括目标任务和至少一个待执行的任务,该任务信息包括每一任务的任务信息;The acquisition unit 901 is used to acquire task information of multiple tasks. The multiple tasks include a target task and at least one task to be executed. The task information includes task information of each task;
确定单元902,用于根据多个任务的任务信息,确定目标任务的资源调整策略;The determination unit 902 is used to determine the resource adjustment strategy of the target task based on the task information of multiple tasks;
调整单元903,用于当目标任务满足第一资源调整条件,或者运行目标任务的实例满足第二资源调整条件时,基于该资源调整策略调整用于运行目标任务的实例的数量和规格中的至少一种。 The adjustment unit 903 is configured to adjust at least one of the number and specifications of instances used to run the target task based on the resource adjustment policy when the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition. A sort of.
在一种可能的实现方式中,该装置还包括:接收单元,用于接收用户配置的资源更新限制,该资源更新限制包括最大费用和运行目标任务的实例的最大数量中的至少一种;调整单元903,用于基于该资源调整策略和该资源更新限制,调整用于运行目标任务的实例的数量和规格中的至少一种。In a possible implementation, the device further includes: a receiving unit configured to receive user-configured resource update limits, where the resource update limits include at least one of a maximum cost and a maximum number of instances running the target task; adjust Unit 903 is configured to adjust at least one of the number and specifications of instances used to run the target task based on the resource adjustment policy and the resource update limit.
在一种可能的实现方式中,目标任务满足第一资源调整条件,包括:目标任务的预期执行时长大于目标任务的参考执行时长。In a possible implementation manner, the target task satisfies the first resource adjustment condition, including: the expected execution time of the target task is greater than the reference execution time of the target task.
在一种可能的实现方式中,运行目标任务的实例满足第二资源调整条件,包括:运行目标任务的实例的CPU占用率高于占用率阈值。In a possible implementation manner, the instance running the target task satisfies the second resource adjustment condition, including: the CPU usage of the instance running the target task is higher than the usage threshold.
在一种可能的实现方式中,目标任务为待执行的任务或者正在执行的任务。In a possible implementation, the target task is a task to be executed or a task being executed.
在一种可能的实现方式中,任务信息包括资源占用量和资源占用时长。In a possible implementation, the task information includes resource occupancy and resource occupancy duration.
在一种可能的实现方式中,确定单元902,用于根据多个任务的任务信息和多个任务的参考执行时长,计算目标任务的资源需求;根据目标任务的资源需求和目标任务的可用资源量,确定目标任务的资源调整策略,该资源调整策略用于使得调整后的目标任务的可用资源量满足目标任务的资源需求。In a possible implementation, the determining unit 902 is configured to calculate the resource requirements of the target task based on the task information of the multiple tasks and the reference execution duration of the multiple tasks; based on the resource requirements of the target task and the available resources of the target task The resource adjustment strategy of the target task is determined, and the resource adjustment strategy is used to make the adjusted available resource amount of the target task meet the resource requirements of the target task.
在一种可能的实现方式中,该装置还包括:计算单元,用于根据初始资源量和多个任务的任务信息,计算目标任务的预期执行时长。In a possible implementation, the device further includes: a calculation unit configured to calculate the expected execution time of the target task based on the initial resource amount and task information of the multiple tasks.
在一种可能的实现方式中,获取单元901,用于获取多个任务中的各个任务的任务类型;基于各个任务的任务类型,查询任务类型与任务信息的对应关系,得到各个任务的任务信息其中,任务类型与任务信息的对应关系基于任务类型和任务信息的配置信息得到。In a possible implementation, the obtaining unit 901 is used to obtain the task type of each task in multiple tasks; based on the task type of each task, query the corresponding relationship between the task type and the task information, and obtain the task information of each task. The correspondence between the task type and task information is obtained based on the configuration information of the task type and task information.
在一种可能的实现方式中,获取单元901,用于获取多个任务中的各个任务的任务类型;基于各个任务类型对应的历史执行信息,获取各个任务的任务信息。In a possible implementation, the obtaining unit 901 is configured to obtain the task type of each task in multiple tasks; and obtain the task information of each task based on the historical execution information corresponding to each task type.
在一种可能的实现方式中,任务类型为获取元数据、切片、转码或合并中的任一种。In a possible implementation, the task type is any one of obtaining metadata, slicing, transcoding, or merging.
在本申请实施例提供的装置中,获取多个任务的任务信息,基于多个任务的任务信息确定该多个任务中的目标任务的资源调整策略。该装置能够全面感知该多个任务,基于该多个任务的任务信息确定出的目标任务的资源调整策略的准确性较高。从而,在基于该目标任务的资源调整策略进行资源调整的情况下,资源调整的准确性较高。In the device provided by the embodiment of the present application, task information of multiple tasks is obtained, and the resource adjustment strategy of the target task in the multiple tasks is determined based on the task information of the multiple tasks. The device can comprehensively perceive the multiple tasks, and determine the resource adjustment strategy for the target task based on the task information of the multiple tasks with high accuracy. Therefore, when resource adjustment is performed based on the resource adjustment strategy of the target task, the accuracy of resource adjustment is high.
上述获取单元901、确定单元902和调整单元903均可以通过软件实现或者通过硬件实现。接下来以获取单元901为例,对获取单元901的实现方式进行说明。类似的,确定单元902和调整单元903的实现方式可以参考获取单元的实现方式。The above-mentioned obtaining unit 901, determining unit 902 and adjusting unit 903 can all be implemented by software or hardware. Next, taking the acquisition unit 901 as an example, the implementation of the acquisition unit 901 will be described. Similarly, the implementation of the determination unit 902 and the adjustment unit 903 may refer to the implementation of the acquisition unit.
在一种可能的实现方式中,获取单元901通过软件实现。也即获取单元901为软件功能单元,该获取单元901可以包括运行在计算实例上的代码。其中,计算实例包括但不限于物理主机、虚拟机、容器中的至少一种。物理主机可以称为计算设备。示例性地,该计算实例可以是一台或者多台。例如,获取单元901可以包括运行在多个主机/虚拟机/容器上的代码。用于运行该代码的多个主机/虚拟机/容器可以分布在相同的区域(region)中,也可以分布在不同的region中。进一步地,用于运行该代码的多个主机/虚拟机/容器可以分布在相同的可用区(availability zone,AZ)中,也可以分布在不同的AZ中,每个AZ包括一个数据中心或多个地理位置相近的数据中心。其中,一个region可以包括多个AZ。In a possible implementation manner, the acquisition unit 901 is implemented by software. That is, the acquisition unit 901 is a software functional unit, and the acquisition unit 901 may include code running on the computing instance. The computing instance includes but is not limited to at least one of a physical host, a virtual machine, and a container. A physical host can be called a computing device. For example, the computing instance can be one or more. For example, the acquisition unit 901 may include code running on multiple hosts/virtual machines/containers. Multiple hosts/VMs/containers used to run the code can be distributed in the same region or in different regions. Furthermore, multiple hosts/virtual machines/containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs. Each AZ includes one data center or multiple AZs. geographically close data centers. Among them, a region can include multiple AZs.
示例性地,用于运行该代码的多个主机/虚拟机/容器可以分布在同一个虚拟私有云(virtual private cloud,VPC)中,也可以分布在多个VPC中。其中,一个VPC设置在一个region 内。同一region内的两个VPC之间、以及不同region的VPC之间的跨区通信通过在每个VPC内设置通信网关实现,通过通信网关实现VPC之间的互连。For example, multiple hosts/virtual machines/containers used to run the code can be distributed in the same virtual private cloud (virtual private cloud, VPC), or can be distributed in multiple VPCs. Among them, a VPC is set up in a region Inside. Cross-region communication between two VPCs in the same region and between VPCs in different regions is achieved by setting up a communication gateway in each VPC, and the interconnection between VPCs is realized through the communication gateway.
在另一种可能的实现方式中,获取单元901通过硬件实现。也即获取单元901为硬件功能单元,获取单元901可以包括至少一个计算设备,如服务器等。示例性地,获取单元901也可以是利用专用集成电路(application-specific integrated circuit,ASIC)、或可编程逻辑器件(programmable logic device,PLD)实现的设备等。其中,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD)、现场可编程门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合实现。In another possible implementation, the acquisition unit 901 is implemented by hardware. That is, the acquisition unit 901 is a hardware functional unit, and the acquisition unit 901 may include at least one computing device, such as a server. For example, the acquisition unit 901 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). Among them, the above-mentioned PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL), or any combination thereof.
获取单元901包括的多个计算设备可以分布在相同的region中,也可以分布在不同的region中。获取单元901包括的多个计算设备可以分布在相同的AZ中,也可以分布在不同的AZ中。示例性地,获取单元901包括的多个计算设备可以分布在同一个VPC中,也可以分布在多个VPC中。其中,该多个计算设备可以是服务器、ASIC、PLD、CPLD、FPGA和GAL等计算设备的任意组合。Multiple computing devices included in the acquisition unit 901 may be distributed in the same region or in different regions. Multiple computing devices included in the acquisition unit 901 may be distributed in the same AZ or in different AZs. For example, multiple computing devices included in the acquisition unit 901 may be distributed in the same VPC or in multiple VPCs. The multiple computing devices may be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
示例性地,在其他实施例中,获取单元901可以用于执行资源调整方法中的任意步骤,确定单元902可以用于执行资源调整方法中的任意步骤,调整单元903可以用于执行资源调整方法中的任意步骤,获取单元901、确定单元902、以及调整单元903负责实现的步骤可根据需要指定,通过获取单元901、确定单元902、以及调整单元903分别实现资源调整方法中不同的步骤来实现资源调整装置的全部功能。Exemplarily, in other embodiments, the obtaining unit 901 can be used to perform any step in the resource adjustment method, the determining unit 902 can be used to perform any step in the resource adjustment method, and the adjusting unit 903 can be used to perform the resource adjustment method. For any steps in the resource adjustment method, the steps that the acquisition unit 901, the determination unit 902, and the adjustment unit 903 are responsible for implementing can be specified as needed and implemented by the acquisition unit 901, the determination unit 902, and the adjustment unit 903 respectively implementing different steps in the resource adjustment method. Full functionality of the resource adjustment device.
示例性地,本申请还提供一种计算设备1000。如图10所示,计算设备1000包括:总线1002、处理器1004、存储器1006和通信接口1008。处理器1004、存储器1006和通信接口1008之间通过总线1002通信。计算设备1000可以是服务器或终端设备。应理解,本申请不限定计算设备1000中的处理器、存储器的个数。By way of example, this application also provides a computing device 1000. As shown in Figure 10, computing device 1000 includes: bus 1002, processor 1004, memory 1006, and communication interface 1008. The processor 1004, the memory 1006 and the communication interface 1008 communicate through the bus 1002. Computing device 1000 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 1000.
总线1002可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。总线1002可包括在计算设备1000各个部件(例如,存储器1006、处理器1004、通信接口1008)之间传送信息的通路。The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one line is used in Figure 10, but it does not mean that there is only one bus or one type of bus. Bus 1002 may include a path that carries information between various components of computing device 1000 (eg, memory 1006, processor 1004, communications interface 1008).
处理器1004可以包括CPU、图形处理器(graphics processing unit,GPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。The processor 1004 may include any one or more of a CPU, a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP). .
存储器1006可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。存储器1006还可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器,机械硬盘(hard disk drive,HDD)或固态硬盘(solid state drive,SSD)。Memory 1006 may include volatile memory, such as random access memory (RAM). The memory 1006 may also include non-volatile memory (non-volatile memory), such as read-only memory (ROM), flash memory, mechanical hard disk (hard disk drive, HDD) or solid state drive (solid state drive). ,SSD).
存储器1006中存储有可执行的程序代码,处理器1004执行该可执行的程序代码以分别实现前述获取单元901、确定单元902和调整单元903的功能,从而实现资源调整方法。也即,存储器1006上存有用于执行资源调整方法的指令。The memory 1006 stores executable program code, and the processor 1004 executes the executable program code to implement the functions of the aforementioned acquisition unit 901, determination unit 902, and adjustment unit 903 respectively, thereby implementing the resource adjustment method. That is, the memory 1006 stores instructions for executing the resource adjustment method.
或者,存储器1006中存储有可执行的代码,处理器1004执行该可执行的代码以实现前述 资源调整装置的功能,从而实现资源调整方法。也即,存储器1006上存有用于执行资源调整方法的指令。Alternatively, executable code is stored in the memory 1006, and the processor 1004 executes the executable code to implement the foregoing. The resource adjustment device functions to implement the resource adjustment method. That is, the memory 1006 stores instructions for executing the resource adjustment method.
通信接口1008使用例如但不限于网络接口卡、收发器一类的收发模块,来实现计算设备1000与其他设备或通信网络之间的通信。The communication interface 1008 uses transceiver modules such as, but not limited to, network interface cards and transceivers to implement communication between the computing device 1000 and other devices or communication networks.
在一种可能的实现方式中,本申请实施例还提供了一种计算设备集群。该计算设备集群包括至少一台计算设备。该计算设备可以是服务器,例如是中心服务器、边缘服务器,或者是本地数据中心中的本地服务器。在一些实施例中,计算设备也可以是台式机、笔记本电脑或者智能手机等终端设备。In a possible implementation manner, embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
如图11所示,该计算设备集群包括至少一个计算设备1000。计算设备集群中的一个或多个计算设备1000中的存储器1006中可以存有相同的用于执行资源调整方法的指令。As shown in Figure 11, the computing device cluster includes at least one computing device 1000. The same instructions for performing the resource adjustment method may be stored in the memory 1006 of one or more computing devices 1000 in the computing device cluster.
在一些可能的实现方式中,该计算设备集群中的一个或多个计算设备1000的存储器1006中也可以分别存有用于执行资源调整方法的部分指令。换言之,一个或多个计算设备1000的组合可以共同执行用于执行资源调整方法的指令。In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store part of the instructions for executing the resource adjustment method. In other words, a combination of one or more computing devices 1000 may collectively execute instructions for performing a resource adjustment method.
需要说明的是,计算设备集群中的不同的计算设备1000中的存储器1006可以存储不同的指令,分别用于执行资源调整装置的部分功能。也即,不同的计算设备1000中的存储器1006存储的指令可以实现获取单元901、确定单元902和调整单元903中的一个或多个单元的功能。It should be noted that the memories 1006 in different computing devices 1000 in the computing device cluster can store different instructions, respectively used to execute part of the functions of the resource adjustment device. That is, instructions stored in the memory 1006 in different computing devices 1000 may implement the functions of one or more units among the obtaining unit 901 , the determining unit 902 and the adjusting unit 903 .
在一些可能的实现方式中,计算设备集群中的一个或多个计算设备可以通过网络连接。其中,该网络可以是广域网或局域网等等。图12为本申请实施例提供的另一种计算设备集群的结构示意图,如图12所示,两个计算设备1000A和1000B之间通过网络进行连接。具体地,通过各个计算设备中的通信接口与该网络进行连接。在一种可能的实现方式中,计算设备1000A中的存储器1006中存有执行获取单元901的功能的指令。同时,计算设备1000B中的存储器1006中存有执行确定单元902和调整单元903的功能的指令。In some possible implementations, one or more computing devices in a cluster of computing devices may be connected through a network. Among them, the network can be a wide area network or a local area network, etc. Figure 12 is a schematic structural diagram of another computing device cluster provided by an embodiment of the present application. As shown in Figure 12, two computing devices 1000A and 1000B are connected through a network. Specifically, the connection to the network is made through a communication interface in each computing device. In one possible implementation, instructions for performing the functions of the acquisition unit 901 are stored in the memory 1006 of the computing device 1000A. At the same time, instructions for performing the functions of the determining unit 902 and the adjusting unit 903 are stored in the memory 1006 of the computing device 1000B.
图12所示的计算设备集群之间的连接方式可以是考虑到本申请提供的资源调整方法需要获取多个任务的任务信息,将确定单元902以及调整单元903实现的功能交由计算设备1000B执行。The connection method between the computing device clusters shown in Figure 12 can be that considering that the resource adjustment method provided by this application needs to obtain task information of multiple tasks, the functions implemented by the determination unit 902 and the adjustment unit 903 are handed over to the computing device 1000B for execution. .
应理解,图12中示出的计算设备1000A的功能也可以由多个计算设备1000完成。同样,计算设备1000B的功能也可以由多个计算设备1000完成。It should be understood that the functions of the computing device 1000A shown in FIG. 12 may also be performed by multiple computing devices 1000. Likewise, the functions of computing device 1000B may also be performed by multiple computing devices 1000 .
示例性地,本申请实施例还提供了另一种计算设备集群。该计算设备集群中各计算设备之间的连接关系可以类似的参考图11和图12的计算设备集群的连接方式。不同的是,该计算设备集群中的一个或多个计算设备1000中的存储器1006中可以存有相同的用于执行资源调整方法的指令。Exemplarily, the embodiment of the present application also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to the connection method of the computing device cluster in FIG. 11 and FIG. 12 . The difference is that the same instructions for executing the resource adjustment method may be stored in the memory 1006 of one or more computing devices 1000 in the computing device cluster.
在一些可能的实现方式中,该计算设备集群中的一个或多个计算设备1000的存储器1006中也可以分别存有用于执行资源调整方法的部分指令。换言之,一个或多个计算设备1000的组合可以共同执行用于执行资源调整方法的指令。In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store part of the instructions for executing the resource adjustment method. In other words, a combination of one or more computing devices 1000 may collectively execute instructions for performing a resource adjustment method.
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质包括计算机程序指令,当该计算机程序指令由计算设备集群执行时,该计算设备集群执行图3中的资源调整方法。Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the resource adjustment method in Figure 3 .
本申请实施例提供了一种包含指令的计算机程序产品,当该指令被计算设备集群执行时,可以使得计算设备集群执行上述方法实施例中对应的各个步骤和/或流程。 Embodiments of the present application provide a computer program product containing instructions. When the instructions are executed by a computing device cluster, the computing device cluster can perform corresponding steps and/or processes in the above method embodiments.
本申请实施例提供了一种芯片,包括处理器,该处理器用于从存储器中调用并运行存储器中存储的指令,使得安装有该芯片的至少一个计算设备执行上述各方面中的方法。Embodiments of the present application provide a chip, including a processor, which is configured to call and run instructions stored in the memory, so that at least one computing device installed with the chip executes the methods in the above aspects.
示例性地,该芯片还包括:输入接口、输出接口和该存储器,该输入接口、该输出接口、该处理器以及该存储器之间通过内部连接通路相连。Exemplarily, the chip further includes: an input interface, an output interface and the memory, and the input interface, the output interface, the processor and the memory are connected through internal connection paths.
本申请实施例还提供了一种设备,该设备包括上述芯片。可选地,该设备为计算设备。示例性地,该设备为服务器或者终端设备。An embodiment of the present application also provides a device, which includes the above chip. Optionally, the device is a computing device. For example, the device is a server or a terminal device.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital video disc,DVD))、或者半导体介质(例如,SSD)等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in this application are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., computer instructions may be transmitted from a website, computer, server or data center via a wired link (e.g. Coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means to transmit to another website, computer, server or data center. Computer-readable storage media can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or other integrated media that contains one or more available media. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital video disc (DVD)), or semiconductor media (eg, SSD), etc.
以上所述的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本申请的具体实施方式而已,并不用于限定本申请的保护范围,凡在本申请的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。The above-mentioned specific embodiments further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above-mentioned are only specific embodiments of the present application and are not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of this application shall be included in the scope of protection of this application.
本领域普通技术人员可以意识到,结合本文中所公开的实施例中描述的各方法步骤和模块,能够以软件、硬件、固件或者其任意组合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各实施例的步骤及组成。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. In order to clearly illustrate the interoperability of hardware and software, Alternatively, the steps and compositions of each embodiment have been generally described in terms of functions in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. One of ordinary skill in the art may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,该程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. As mentioned above, The storage medium can be read-only memory, magnetic disk or optical disk, etc.
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机程序指令。作为示例,本申请实施例的方法可以在机器可执行指令的上下文中被描述,机器可执行指令诸如包括在目标的真实或者虚拟处理器上的器件中执行的程序模块中。一般而言,程序模块包括例程、程序、库、对象、类、组件、数据结构等,其执行特定的任务或者实现特定的抽象数据结构。在各实施例中,程序模块的功能可以在所描述的程序模块之间合并或者分割。用于程序模块的机器可执行指令可以在本地或者分布式设备内执行。在分布式设备中,程序模块可以位于本地和远程存储介质二者中。When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. By way of example, methods of embodiments of the present application may be described in the context of machine-executable instructions, such as included in a program module executing in a device on a target's real or virtual processor. Generally speaking, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functionality of program modules may be combined or split between the described program modules. Machine-executable instructions for program modules can execute locally or on a distributed device. In a distributed device, program modules can be located in both local and remote storage media.
用于实现本申请实施例的方法的计算机程序代码可以用一种或多种编程语言编写。这些计算机程序代码可以提供给通用计算机、专用计算机或其他可编程的资源调整装置的处理器, 使得程序代码在被计算机或其他可编程的资源调整装置执行的时候,引起在流程图和/或框图中规定的功能/操作被实施。程序代码可以完全在计算机上、部分在计算机上、作为独立的软件包、部分在计算机上且部分在远程计算机上或完全在远程计算机或服务器上执行。Computer program codes for implementing the methods of embodiments of the present application may be written in one or more programming languages. These computer program codes may be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable resource adjustment device, The program code, when executed by a computer or other programmable resource adjustment device, causes the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the computer, partly on the computer, as a stand-alone software package, partly on the computer and partly on a remote computer or entirely on the remote computer or server.
在本申请实施例的上下文中,计算机程序代码或者相关数据可以由任意适当载体承载,以使得设备、装置或者处理器能够执行上文描述的各种处理和操作。载体的示例包括信号、计算机可读介质等等。In the context of the embodiments of the present application, the computer program code or related data may be carried by any appropriate carrier, so that the device, device or processor can perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like.
信号的示例可以包括电、光、无线电、声音或其它形式的传播信号,诸如载波、红外信号等。Examples of signals may include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, and the like.
机器可读介质可以是包含或存储用于或有关于指令执行系统、装置或设备的程序的任何有形介质。机器可读介质可以是机器可读信号介质或机器可读存储介质。机器可读介质可以包括但不限于电子的、磁的、光学的、电磁的、红外的或半导体系统、装置或设备,或其任意合适的组合。机器可读存储介质的更详细示例包括带有一根或多根导线的电气连接、便携式计算机磁盘、硬盘、随机存储存取器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(erasable programmable ROM,EPROM)或闪存、光存储设备、磁存储设备,或其任意合适的组合。A machine-readable medium may be any tangible medium that contains or stores a program for or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or devices, or any suitable combination thereof. More detailed examples of machine-readable storage media include an electrical connection with one or more wires, laptop computer disk, hard drive, random memory accessor (RAM), read-only memory (ROM), erasable programmable read-only memory Memory (erasable programmable ROM, EPROM) or flash memory, optical storage device, magnetic storage device, or any suitable combination thereof.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、设备和模块的具体工作过程,可以参见前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,该模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、设备或模块的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented. In addition, the coupling or direct coupling or communication connection between each other shown or discussed may be indirect coupling or communication connection through some interfaces, devices or modules, or may be electrical, mechanical or other forms of connection.
该作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请实施例方案的目的。The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以是两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software function modules.
该集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例中方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
本申请中术语“第一”、“第二”等字样用于对作用和功能基本相同的相同项或相似项进行区分,应理解,“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系,也不对数量和执行顺序进行限定。还应理解,尽管以下描述使用术语第一、第二等来描述各种 元素,但这些元素不应受术语的限制。这些术语只是用于将一元素与另一元素区别分开。例如,在不脱离各种所述示例的范围的情况下,第一模块可以被称为第二模块,并且类似地,第二模块可以被称为第一模块。第一模块和第二模块都可以是任一类型的计算设备,并且在某些情况下,可以是单独且不同的计算设备。In this application, the terms "first", "second" and other words are used to distinguish the same or similar items with basically the same function and function. It should be understood that the terms "first", "second" and "nth" There is no logical or sequential dependency between them, and there is no limit on the number or execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, but these elements should not be limited by the term. These terms are only used to distinguish one element from another. For example, a first module may be termed a second module, and similarly, a second module may be termed a first module, without departing from the scope of various described examples. Both the first module and the second module may be any type of computing device, and, in some cases, may be separate and distinct computing devices.
还应理解,在本申请的各个实施例中,各个过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should also be understood that in each embodiment of the present application, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not be determined by the execution order of the embodiments of the present application. The implementation process constitutes no limitation.
本申请中术语“至少一个”的含义是指一个或多个,本申请中术语“多个”的含义是指两个或两个以上,例如,多个任务是指两个或两个以上的任务。本文中术语“系统”和“网络”经常可互换使用。The term "at least one" in this application means one or more, and the term "plurality" in this application means two or more. For example, multiple tasks means two or more. Task. The terms "system" and "network" are often used interchangeably in this article.
应理解,在本文中对各种所述示例的描述中所使用的术语只是为了描述特定示例,而并非旨在进行限制。如在对各种所述示例的描述和所附权利要求书中所使用的那样,单数形式“一个(“a”,“an”)”和“该”旨在也包括复数形式,除非上下文另外明确地指示。It is to be understood that the terminology used in the description of the various examples herein is for the purpose of describing the particular example only and is not intended to be limiting. As used in the description of various described examples and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context dictates otherwise. Instruct clearly.
还应理解,术语“包括”(也称“includes”、“including”、“comprises”和/或“comprising”)当在本说明书中使用时指定存在所陈述的特征、整数、步骤、操作、元素、和/或部件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元素、部件、和/或其分组。It will also be understood that the term "includes" (also "includes," "including," "comprises," and/or "comprising") when used in this specification specifies the presence of stated features, integers, steps, operations, elements , and/or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groupings thereof.
还应理解,术语“若”和“如果”可被解释为意指“当...时”(“when”或“upon”)或“响应于确定”或“响应于检测到”。类似地,根据上下文,短语“若确定...”或“若检测到[所陈述的条件或事件]”可被解释为意指“在确定...时”或“响应于确定...”或“在检测到[所陈述的条件或事件]时”或“响应于检测到[所陈述的条件或事件]”。It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, depending on the context, the phrase "if it is determined..." or "if [stated condition or event] is detected" may be interpreted to mean "when it is determined..." or "in response to the determination... ” or “on detection of [stated condition or event]” or “in response to detection of [stated condition or event].”
应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。It should be understood that determining B based on A does not mean determining B only based on A, and B can also be determined based on A and/or other information.
还应理解,说明书通篇中提到的“一个实施例”、“一实施例”、“一种可能的实现方式”意味着与实施例或实现方式有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”、“一种可能的实现方式”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。 It should also be understood that references throughout this specification to "one embodiment,""anembodiment," and "a possible implementation" mean that specific features, structures, or characteristics related to the embodiment or implementation are included herein. In at least one embodiment of the application. Therefore, “in one embodiment” or “in an embodiment” or “a possible implementation” appearing in various places throughout this specification do not necessarily refer to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.

Claims (25)

  1. 一种资源调整方法,其特征在于,所述方法包括:A resource adjustment method, characterized in that the method includes:
    获取多个任务的任务信息,所述多个任务中包括目标任务和至少一个待执行的任务,所述任务信息包括每一任务的任务信息;Obtain task information of multiple tasks, the multiple tasks include a target task and at least one task to be executed, and the task information includes task information of each task;
    根据所述多个任务的任务信息,确定所述目标任务的资源调整策略;Determine a resource adjustment strategy for the target task according to the task information of the multiple tasks;
    当所述目标任务满足第一资源调整条件,或者运行所述目标任务的实例满足第二资源调整条件时,基于所述资源调整策略调整用于运行所述目标任务的实例的数量和规格中的至少一种。When the target task satisfies the first resource adjustment condition, or the instance running the target task satisfies the second resource adjustment condition, adjust the number and specifications of the instances used to run the target task based on the resource adjustment policy. At least one.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    接收用户配置的资源更新限制,所述资源更新限制包括最大费用和运行所述目标任务的实例的最大数量中的至少一种;Receive a user-configured resource update limit, the resource update limit including at least one of a maximum cost and a maximum number of instances running the target task;
    所述基于所述资源调整策略调整用于运行所述目标任务的实例的数量和规格中的至少一种,包括:The adjusting at least one of the number and specifications of instances used to run the target task based on the resource adjustment policy includes:
    基于所述资源调整策略和所述资源更新限制,调整用于运行所述目标任务的实例的数量和规格中的至少一种。Based on the resource adjustment policy and the resource update limit, at least one of the number and specifications of instances used to run the target task is adjusted.
  3. 根据权利要求1或2所述的方法,其特征在于,所述目标任务满足第一资源调整条件,包括:The method according to claim 1 or 2, characterized in that the target task satisfies the first resource adjustment condition, including:
    所述目标任务的预期执行时长大于所述目标任务的参考执行时长。The expected execution time of the target task is greater than the reference execution time of the target task.
  4. 根据权利要求1至3中任一所述的方法,其特征在于,所述运行所述目标任务的实例满足第二资源调整条件,包括:The method according to any one of claims 1 to 3, characterized in that the instance running the target task satisfies the second resource adjustment condition, including:
    所述运行所述目标任务的实例的中央处理器CPU占用率高于占用率阈值。The central processor CPU usage of the instance running the target task is higher than the usage threshold.
  5. 根据权利要求1至4中任一所述的方法,其特征在于,所述目标任务为待执行的任务或者正在执行的任务。The method according to any one of claims 1 to 4, characterized in that the target task is a task to be executed or a task being executed.
  6. 根据权利要求1至5中任一所述的方法,其特征在于,所述任务信息包括资源占用量和资源占用时长。The method according to any one of claims 1 to 5, characterized in that the task information includes resource occupancy amount and resource occupancy duration.
  7. 根据权利要求1至6中任一所述的方法,其特征在于,所述根据所述多个任务的任务信息,确定所述目标任务的资源调整策略,包括:The method according to any one of claims 1 to 6, characterized in that determining the resource adjustment strategy of the target task according to the task information of the plurality of tasks includes:
    根据所述多个任务的任务信息和所述多个任务的参考执行时长,计算所述目标任务的资源需求;Calculate the resource requirements of the target task according to the task information of the multiple tasks and the reference execution duration of the multiple tasks;
    根据所述目标任务的资源需求和所述目标任务的可用资源量,确定所述目标任务的资源调整策略,所述资源调整策略用于使得调整后的所述目标任务的可用资源量满足所述目标任务的资源需求。 According to the resource requirements of the target task and the amount of available resources of the target task, a resource adjustment strategy for the target task is determined, and the resource adjustment strategy is used to make the adjusted amount of available resources of the target task satisfy the Resource requirements for the target task.
  8. 根据权利要求3中所述的方法,其特征在于,所述方法还包括:The method according to claim 3, characterized in that the method further includes:
    根据初始资源量和所述多个任务的任务信息,计算所述目标任务的预期执行时长。According to the initial resource amount and the task information of the multiple tasks, the expected execution time of the target task is calculated.
  9. 根据权利要求1至8任一所述的方法,其特征在于,所述获取多个任务的任务信息,包括:The method according to any one of claims 1 to 8, characterized in that the obtaining task information of multiple tasks includes:
    获取所述多个任务中的各个任务的任务类型;Obtain the task type of each task in the plurality of tasks;
    基于所述各个任务的任务类型,查询任务类型与任务信息的对应关系,得到所述各个任务的任务信息,其中,所述任务类型与任务信息的对应关系基于任务类型和任务信息的配置信息得到。Based on the task type of each task, the corresponding relationship between the task type and the task information is queried to obtain the task information of each task, wherein the corresponding relationship between the task type and the task information is obtained based on the task type and the configuration information of the task information. .
  10. 根据权利要求9所述的方法,其特征在于,所述任务类型为获取元数据、切片、转码或合并中的任一种。The method according to claim 9, characterized in that the task type is any one of obtaining metadata, slicing, transcoding or merging.
  11. 一种资源调整装置,其特征在于,所述装置包括:A resource adjustment device, characterized in that the device includes:
    获取单元,用于获取多个任务的任务信息,所述多个任务中包括目标任务和至少一个待执行的任务,所述任务信息包括每一任务的任务信息;An acquisition unit, configured to acquire task information of a plurality of tasks, the plurality of tasks including a target task and at least one task to be executed, the task information including task information of each task;
    确定单元,用于根据所述多个任务的任务信息,确定所述目标任务的资源调整策略;A determining unit configured to determine a resource adjustment strategy for the target task based on the task information of the multiple tasks;
    调整单元,用于当所述目标任务满足第一资源调整条件,或者运行所述目标任务的实例满足第二资源调整条件时,基于所述资源调整策略调整用于运行所述目标任务的实例的数量和规格中的至少一种。An adjustment unit configured to adjust the resource adjustment rate for running the instance of the target task based on the resource adjustment policy when the target task satisfies the first resource adjustment condition or the instance running the target task satisfies the second resource adjustment condition. At least one of quantity and specification.
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:The device according to claim 11, characterized in that the device further includes:
    接收单元,用于接收用户配置的资源更新限制,所述资源更新限制包括最大费用和运行所述目标任务的实例的最大数量中的至少一种;A receiving unit configured to receive user-configured resource update restrictions, where the resource update restrictions include at least one of a maximum cost and a maximum number of instances running the target task;
    所述调整单元,用于基于所述资源调整策略和所述资源更新限制,调整用于运行所述目标任务的实例的数量和规格中的至少一种。The adjustment unit is configured to adjust at least one of the number and specifications of instances used to run the target task based on the resource adjustment policy and the resource update limit.
  13. 根据权利要求11或12所述的装置,其特征在于,所述目标任务满足第一资源调整条件,包括:所述目标任务的预期执行时长大于所述目标任务的参考执行时长。The apparatus according to claim 11 or 12, wherein the target task satisfies the first resource adjustment condition, including: the expected execution time of the target task is greater than the reference execution time of the target task.
  14. 根据权利要求11至13中任一所述的装置,其特征在于,所述运行所述目标任务的实例满足第二资源调整条件,包括:所述运行所述目标任务的实例的中央处理器CPU占用率高于占用率阈值。The apparatus according to any one of claims 11 to 13, wherein the instance running the target task satisfies the second resource adjustment condition, including: the central processing unit (CPU) of the instance running the target task. Occupancy is above the occupancy threshold.
  15. 根据权利要求11至14中任一所述的装置,其特征在于,所述目标任务为待执行的任务或者正在执行的任务。The device according to any one of claims 11 to 14, characterized in that the target task is a task to be executed or a task being executed.
  16. 根据权利要求11至15中任一所述的装置,其特征在于,所述任务信息包括资源占用量和资源占用时长。 The device according to any one of claims 11 to 15, wherein the task information includes resource occupancy amount and resource occupancy duration.
  17. 根据权利要求11至16中任一所述的装置,其特征在于,所述确定单元,用于根据所述多个任务的任务信息和所述多个任务的参考执行时长,计算所述目标任务的资源需求;根据所述目标任务的资源需求和所述目标任务的可用资源量,确定所述目标任务的资源调整策略,所述资源调整策略用于使得调整后的所述目标任务的可用资源量满足所述目标任务的资源需求。The device according to any one of claims 11 to 16, characterized in that the determining unit is configured to calculate the target task according to the task information of the multiple tasks and the reference execution duration of the multiple tasks. resource requirements; according to the resource requirements of the target task and the amount of available resources of the target task, determine the resource adjustment strategy of the target task, the resource adjustment strategy is used to make the adjusted available resources of the target task The amount of resources required to meet the target tasks.
  18. 根据权利要求13中所述的装置,其特征在于,所述装置还包括:The device according to claim 13, characterized in that the device further includes:
    计算单元,用于根据初始资源量和所述多个任务的任务信息,计算所述目标任务的预期执行时长。A calculation unit configured to calculate the expected execution time of the target task based on the initial resource amount and task information of the multiple tasks.
  19. 根据权利要求11至18任一所述的装置,其特征在于,所述获取单元,用于获取所述多个任务中的各个任务的任务类型;基于所述各个任务的任务类型,查询任务类型与任务信息的对应关系,得到所述各个任务的任务信息,其中,所述任务类型与任务信息的对应关系基于任务类型和任务信息的配置信息得到。The device according to any one of claims 11 to 18, characterized in that the obtaining unit is used to obtain the task type of each task in the plurality of tasks; based on the task type of each task, query the task type The corresponding relationship with the task information is to obtain the task information of each task, wherein the corresponding relationship between the task type and the task information is obtained based on the configuration information of the task type and the task information.
  20. 根据权利要求19所述的装置,其特征在于,所述任务类型为获取元数据、切片、转码或合并中的任一种。The device according to claim 19, wherein the task type is any one of obtaining metadata, slicing, transcoding or merging.
  21. 一种计算设备集群,其特征在于,所述计算设备集群包括至少一个计算设备,各个计算设备包括处理器和存储器;A computing device cluster, characterized in that the computing device cluster includes at least one computing device, and each computing device includes a processor and a memory;
    所述至少一个计算设备的处理器用于执行所述至少一个计算设备的存储器中存储的指令,以使得所述计算设备集群执行如权利要求1至10中任一所述的方法。The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the cluster of computing devices performs the method according to any one of claims 1 to 10.
  22. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序指令,当所述计算机程序指令由计算设备集群执行时,所述计算设备集群执行如权利要求1至10中任一所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium includes computer program instructions, and when the computer program instructions are executed by a computing device cluster, the computing device cluster executes claims 1 to 10 any of the methods described.
  23. 一种包含指令的计算机程序产品,其特征在于,当所述指令被计算设备集群运行时,使得所述计算设备集群执行如权利要求的1至10中任一所述的方法。A computer program product containing instructions, characterized in that, when the instructions are executed by a cluster of computing devices, they cause the cluster of computing devices to perform the method according to any one of claims 1 to 10.
  24. 一种芯片,其特征在于,所述芯片包括处理器,所述处理器用于从存储器中调用并运行所述存储器中存储的指令,使得安装有所述芯片的至少一个计算设备执行如权利要求1至10中任一所述的方法。A chip, characterized in that the chip includes a processor, the processor is used to call from the memory and run the instructions stored in the memory, so that at least one computing device installed with the chip executes claim 1 to any of the methods described in 10.
  25. 根据权利要求24所述的芯片,其特征在于,还包括:输入接口、输出接口和所述存储器,所述输入接口、所述输出接口、所述处理器以及所述存储器之间通过内部连接通路相连。 The chip according to claim 24, further comprising: an input interface, an output interface and the memory, and the input interface, the output interface, the processor and the memory are connected through an internal connection path connected.
PCT/CN2023/092337 2022-06-20 2023-05-05 Resource adjustment method and apparatus, computing device cluster, and readable storage medium WO2023246330A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202210695652.6 2022-06-20
CN202210695652 2022-06-20
CN202211013518.XA CN117290083A (en) 2022-06-20 2022-08-23 Resource adjustment method and device, computing device cluster and readable storage medium
CN202211013518.X 2022-08-23

Publications (1)

Publication Number Publication Date
WO2023246330A1 true WO2023246330A1 (en) 2023-12-28

Family

ID=89250560

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/092337 WO2023246330A1 (en) 2022-06-20 2023-05-05 Resource adjustment method and apparatus, computing device cluster, and readable storage medium

Country Status (2)

Country Link
CN (1) CN117290083A (en)
WO (1) WO2023246330A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815008A (en) * 2018-12-21 2019-05-28 航天信息股份有限公司 Hadoop cluster user resource monitoring method and system
CN110209467A (en) * 2019-05-23 2019-09-06 华中科技大学 A kind of flexible resource extended method and system based on machine learning
CN112084002A (en) * 2020-08-03 2020-12-15 同济大学 Elastic expansion method, system, medium and equipment of micro-service system in cloud environment
CN113391911A (en) * 2021-07-05 2021-09-14 中国工商银行股份有限公司 Big data resource dynamic scheduling method, device and equipment
CN114327918A (en) * 2022-03-11 2022-04-12 北京百度网讯科技有限公司 Method and device for adjusting resource amount, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815008A (en) * 2018-12-21 2019-05-28 航天信息股份有限公司 Hadoop cluster user resource monitoring method and system
CN110209467A (en) * 2019-05-23 2019-09-06 华中科技大学 A kind of flexible resource extended method and system based on machine learning
CN112084002A (en) * 2020-08-03 2020-12-15 同济大学 Elastic expansion method, system, medium and equipment of micro-service system in cloud environment
CN113391911A (en) * 2021-07-05 2021-09-14 中国工商银行股份有限公司 Big data resource dynamic scheduling method, device and equipment
CN114327918A (en) * 2022-03-11 2022-04-12 北京百度网讯科技有限公司 Method and device for adjusting resource amount, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN117290083A (en) 2023-12-26

Similar Documents

Publication Publication Date Title
US11861203B2 (en) Method, apparatus and electronic device for cloud service migration
US10572290B2 (en) Method and apparatus for allocating a physical resource to a virtual machine
US9811384B2 (en) Dynamic data partitioning for optimal resource utilization in a parallel data processing system
US10505791B2 (en) System and method to handle events using historical data in serverless systems
US10572411B2 (en) Preventing software thread blocking due to interrupts
US10447273B1 (en) Dynamic virtualized field-programmable gate array resource control for performance and reliability
CN109726005B (en) Method, server system and computer readable medium for managing resources
CN112650576A (en) Resource scheduling method, device, equipment, storage medium and computer program product
US9514072B1 (en) Management of allocation for alias devices
US11012316B2 (en) Methods and apparatus to generate and manage workload domains in virtual server racks
JP7418569B2 (en) Transmission and synchronization techniques for hardware-accelerated task scheduling and load balancing on heterogeneous platforms
CN114595043A (en) IO (input/output) scheduling method and device
US11061727B1 (en) Preventing performance degradation over time in a cache
CN111418187A (en) Scalable statistics and analysis mechanism in cloud networks
US20200264796A1 (en) Data copy amount reduction in data replication
WO2023246330A1 (en) Resource adjustment method and apparatus, computing device cluster, and readable storage medium
CN111382141B (en) Master-slave architecture configuration method, device, equipment and computer readable storage medium
US11544589B2 (en) Use machine learning to verify and modify a specification of an integration interface for a software module
CN109391663B (en) Access request processing method and device
US20150373078A1 (en) On-demand helper operator for a streaming application
US11474868B1 (en) Sharded polling system
US11003600B2 (en) Method and system for scheduling I/O operations for processing
CN113703906A (en) Data processing method, device and system
Nguyen et al. An improvement of resource allocation for migration process in cloud environment
US20200133733A1 (en) Hyper-converged infrastructure (hci) ephemeral workload/data provisioning system

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

Country of ref document: EP

Kind code of ref document: A1