Resource adjustment method and device
Through the equipment automatically detecting task processing and adjusting resources, the problem of inefficient resource allocation caused by manual monitoring and adjustment in the prior art is solved, and more efficient and real-time resource management is achieved.
Patent Information
- Application Number
- CN202311632243.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art requires manual monitoring and adjustment in equipment resource allocation and task processing, resulting in large labor consumption and poor real-time performance.
The equipment automatically detects the estimated processing status of the target task collection, and automatically adjusts the task processing resources according to the processing requirements to improve the real-time resource adjustment.
The automation of resource adjustment has been achieved, manual participation has been reduced, and the real-time and efficiency of resource adjustment has been improved.
Smart Images

Figure CN120066760A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of computer application technologies, and in particular, to a resource adjustment method and apparatus. Background Art
[0002] In the related art, a device often needs to allocate resources to process tasks. For example, tasks such as rendering a model, machine learning, and processing requests.
[0003] In order to reasonably allocate resources for task processing, it is often necessary to manually monitor the processing status of tasks and manually adjust the processing resources of tasks.
[0004] This method often requires a large amount of manpower and has poor real-time performance. Summary of the Invention
[0005] In view of this, one or more embodiments of this specification provide a resource adjustment method and apparatus, which automatically trigger the adjustment of task processing resources by the device, improving the real-time performance of resource adjustment.
[0006] To achieve the above object, one or more embodiments of this specification provide the following technical solutions:
[0007] According to a first aspect of one or more embodiments of this specification, a resource adjustment method is proposed, including:
[0008] Based on the task processing resources currently allocated to the target task set, determine the estimated processing status of the current target task set; the target task set has corresponding processing requirements;
[0009] In the case where it is determined that the estimated processing status of the target task set does not meet the corresponding processing requirements, adjust the allocated task processing resources for the target task set.
[0010] Optionally, the determining the estimated processing status of the current target task set includes: determining the estimated task completion time of the tasks in the target task set during the processing of the target task set; the processing requirements include: the preset task time range corresponding to the tasks in the target task set;
[0011] The determining that the estimated processing status of the target task set does not meet the corresponding processing requirements includes: determining that the estimated task completion time of any task in the target task set is not within the corresponding preset task time range.
[0012] Optionally, the adjusting the allocated task processing resources for the target task set includes:
[0013] When determining the estimated task completion time of any task in the target task set, if it is after the maximum time of the corresponding preset task time range, increase the allocated task processing resources for the target task set; and / or
[0014] When determining the estimated task completion time of any task in the target task set, if it is before the minimum time of the corresponding preset task time range, reduce the allocated task processing resources for the target task set.
[0015] Optionally, there is a processing sequence among the tasks in the target task set;
[0016] The method for determining the estimated task completion time of the tasks in the target task set during the processing of the target task set includes:
[0017] For the target task in the target task set and other tasks before the target task in the processing sequence, determine the estimated task calculation amount required for separately processing each of the targeted tasks;
[0018] Based on the currently allocated task processing resources and the sum of the determined estimated task calculation amounts, determine the estimated task completion duration of the target task during the processing of the target task set;
[0019] Based on the current time and the determined estimated task completion duration, determine the estimated task completion time of the target task during the processing of the target task set.
[0020] Optionally, the task processing resources include the number of task processing nodes; the estimated task calculation amount includes the estimated task processing duration required for separately processing the task;
[0021] The method for determining the estimated task completion duration of the target task during the processing of the target task set based on the currently allocated task processing resources and the sum of the determined estimated task calculation amounts includes: dividing the sum of the determined estimated task processing durations by the currently allocated number of task processing nodes to obtain the estimated task completion duration of the target task during the processing of the target task set.
[0022] Optionally, the method for determining the estimated task calculation amount of any task in the target task set includes:
[0023] For any task in the target task set, determine the estimated task calculation amount required for separately processing the targeted task according to the parameters of the targeted task.
[0024] Optionally, the method for determining the estimated task calculation amount required for separately processing the targeted task according to the parameters of the targeted task includes:
[0025] Based on the type of the task targeted, determine the mapping relationship between the task parameters obtained by fitting based on the historical processing data of the same type of tasks in advance and the estimated task computing amount;
[0026] Based on the task parameters of the task targeted, determine the corresponding estimated task computing amount in the said mapping relationship.
[0027] Optionally, the tasks in the target task set have corresponding completion time limits;
[0028] The preset task time range corresponding to the task is determined based on the completion time limit corresponding to the task.
[0029] Optionally, the determination of the estimated processing situation of the target task set includes: determining the estimated set completion duration for processing and completing the current target task set; the processing requirement includes: the preset set duration range corresponding to the target task set;
[0030] The determination that the estimated processing situation of the target task set does not meet the corresponding processing requirement includes: determining that the estimated set completion duration of the target task set is not within the corresponding preset set duration range.
[0031] Optionally, the adjustment of the task processing resources allocated for the target task set includes:
[0032] In the case where it is determined that the estimated set completion duration is less than the minimum value of the preset set duration range, reduce the task processing resources allocated for the target task set; and / or
[0033] In the case where it is determined that the estimated set completion duration is greater than or equal to the maximum value of the preset set duration range, increase the task processing resources allocated for the target task set.
[0034] Optionally, the determination method of the estimated set completion duration includes:
[0035] For any task in the target task set, determine the estimated task computing amount required for processing the task targeted alone;
[0036] Based on the sum of the estimated task computing amounts of the tasks in the target task set and the currently allocated task processing resources, determine the estimated set completion duration.
[0037] Optionally, the task processing resources include the number of task processing nodes; the estimated task computing amount includes the estimated task processing duration required for processing the task alone;
[0038] Determining the estimated completion duration of the estimated set based on the sum of the estimated task computation amounts of the tasks in the target task set and the currently allocated task processing resources includes:
[0039] Dividing the sum of the estimated task processing durations of the tasks in the target task set by the number of currently allocated task processing nodes to obtain the estimated completion duration of the estimated set.
[0040] Optionally, there is a processing sequence among the tasks in the target task set.
[0041] Optionally, the processing sequence among the tasks in the target task set is determined based on at least one of the following:
[0042] Task priority, the completion time limit corresponding to the task, and the estimated completion time of the task.
[0043] Optionally, the method further includes:
[0044] Monitoring the task addition requirement;
[0045] When it is monitored that a new task needs to be added, adding the new task to the target task set.
[0046] Optionally, the target task set includes: a skip list with tasks as nodes.
[0047] Optionally, determining the estimated processing situation of the current target task set includes: monitoring the estimated processing situation of the current target task set.
[0048] Optionally, the task processing resources include at least one of the following:
[0049] The number of task processing nodes, the number of task processing devices, computing power resources, and storage resources.
[0050] According to the second aspect of one or more embodiments of this specification, a resource adjustment device is proposed, including:
[0051] An estimation unit, configured to determine the estimated processing situation of the current target task set based on the currently allocated task processing resources for the target task set; the target task set has corresponding processing requirements;
[0052] An adjustment unit, configured to, when it is determined that the estimated processing situation of the target task set does not meet the corresponding processing requirements, adjust the allocated task processing resources for the target task set.
[0053] Optionally, the estimation unit is configured to: determine the estimated task completion time of the tasks in the target task set during the processing of the target task set; the processing requirement includes: the preset task time range corresponding to the tasks in the target task set.
[0054] The adjustment unit is configured to: when it is determined that the estimated task completion time of any task in the target task set is not within the corresponding preset task time range, adjust the allocated task processing resources for the target task set.
[0055] Optionally, the adjustment unit is configured to:
[0056] When it is determined that the estimated task completion time of any task in the target task set is after the maximum time of the corresponding preset task time range, increase the allocated task processing resources for the target task set; and / or
[0057] When it is determined that the estimated task completion time of any task in the target task set is before the minimum time of the corresponding preset task time range, reduce the allocated task processing resources for the target task set.
[0058] Optionally, there is a processing sequence among the tasks in the target task set;
[0059] The estimation unit is configured to:
[0060] For the target task in the target task set and other tasks before the target task in the processing sequence, determine the estimated task calculation amounts required for separately processing each of the targeted tasks;
[0061] Based on the currently allocated task processing resources and the sum of the determined estimated task calculation amounts, determine the estimated task completion duration of the target task during the processing of the target task set;
[0062] Based on the current time and the determined estimated task completion duration, determine the estimated task completion time of the target task during the processing of the target task set.
[0063] Optionally, the task processing resources include the number of task processing nodes; the estimated task calculation amount includes the estimated task processing duration required for separately processing a task.
[0064] The estimation unit is configured to: divide the sum of the determined estimated task processing durations by the currently allocated number of task processing nodes to obtain the estimated task completion duration of the target task during the processing of the target task set.
[0065] Optionally, the method for determining the estimated task computation amount of any task in the target task set includes:
[0066] For any task in the target task set, determine the estimated task computation amount required to process the targeted task alone according to the parameters of the targeted task.
[0067] Optionally, the determining the estimated task computation amount required to process the targeted task alone according to the parameters of the targeted task includes:
[0068] According to the type of the targeted task, determine the mapping relationship between the task parameters and the estimated task computation amount obtained by fitting based on the historical processing data of the same type of tasks in advance;
[0069] According to the task parameters of the targeted task, determine the corresponding estimated task computation amount in the mapping relationship.
[0070] Optionally, the tasks in the target task set have corresponding completion time limits;
[0071] The preset task time range corresponding to the task is determined based on the completion time limit corresponding to the task.
[0072] Optionally, the estimation unit is used to: determine the estimated set completion duration for processing the current target task set; the processing requirement includes: the preset set duration range corresponding to the target task set;
[0073] The adjustment unit is used to: when it is determined that the estimated set completion duration of the target task set is not within the corresponding preset set duration range, adjust the allocated task processing resources for the target task set.
[0074] Optionally, the adjustment unit is used to:
[0075] When it is determined that the estimated set completion duration is less than the minimum value of the preset set duration range, reduce the allocated task processing resources for the target task set; and / or
[0076] When it is determined that the estimated set completion duration is greater than or equal to the maximum value of the preset set duration range, increase the allocated task processing resources for the target task set.
[0077] Optionally, the determination method of the estimated set completion duration includes:
[0078] For any task in the target task set, determine the estimated task computation amount required to process the targeted task alone;
[0079] Determine the estimated set completion duration based on the sum of the estimated task computation amounts of each task in the target task set and the currently allocated task processing resources.
[0080] Optionally, the task processing resources include the number of task processing nodes; the estimated task computation amount includes the estimated task processing duration required to process the task alone.
[0081] The estimation unit is configured to: divide the sum of the estimated task processing durations of each task in the target task set by the number of currently allocated task processing nodes to obtain the estimated set completion duration.
[0082] Optionally, there is a processing sequence order among the tasks in the target task set.
[0083] Optionally, the processing sequence order among the tasks in the target task set is determined based on at least one of the following:
[0084] Task priority, the completion deadline corresponding to the task, and the estimated completion time of the task.
[0085] Optionally, the device further includes an adding unit configured to monitor the task adding requirement; and add the new task to the target task set when it is monitored that a new task needs to be added.
[0086] Optionally, the target task set includes: a skip list with tasks as nodes.
[0087] Optionally, the estimation unit is configured to: monitor the estimated processing situation of the current target task set.
[0088] Optionally, the task processing resources include at least one of the following:
[0089] The number of task processing nodes, the number of task processing devices, computing power resources, and storage resources.
[0090] According to the above embodiments, by determining whether the estimated processing situation of the target task set meets the processing requirements, automatically adjusting the allocated task processing resources, realizing the automation of resource adjustment, reducing manual participation, and improving the real-time performance and efficiency of resource adjustment.
[0091] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present invention. Brief Description of the Drawings
[0092] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.
[0093] Figure 1 It is a schematic flowchart of a resource adjustment method provided by an exemplary embodiment;
[0094] Figure 2 It is a schematic flowchart of another resource adjustment method provided by an exemplary embodiment;
[0095] Figure 3 It is a schematic flowchart of another resource adjustment method provided by an exemplary embodiment;
[0096] Figure 4 It is a schematic structural diagram of a resource adjustment device provided by an exemplary embodiment;
[0097] Figure 5 It is a schematic structural diagram of a device provided by an exemplary embodiment. Detailed implementation manners
[0098] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with one or more embodiments of this specification. On the contrary, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0099] It should be noted that: In other embodiments, the steps of the corresponding methods are not necessarily executed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step for description in other embodiments.
[0100] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of the relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for the user to select authorization or rejection.
[0101] In the related art, devices often need to allocate resources to process tasks. For example, tasks such as rendering models, machine learning, and processing requests.
[0102] In order to reasonably allocate resources for task processing, it is often necessary to manually monitor the task processing situation and manually adjust the task processing resources.
[0103] This method often requires a large amount of manpower and has poor real-time performance.
[0104] To solve the above problems, an embodiment of this specification provides a resource adjustment method.
[0105] This method can automatically determine the task processing situation by the device, trigger the adjustment of task processing resources, so as to realize the automatic adjustment of task processing resources, reduce manual participation, and improve the efficiency of task processing and the real-time performance of resource adjustment.
[0106] Specifically, this method can automatically estimate the processing situation of any task set by the device based on the currently allocated task processing resources, and further judge whether it is necessary to adjust the allocated task processing resources for this task set according to the processing requirements of this task set. For example, each task needs to be processed before a specified time, or all tasks in the task set need to be processed within a specified duration.
[0107] For the convenience of understanding, an embodiment of this specification provides a specific example.
[0108] A task processing queue can be deployed in the device, tasks are obtained from the queue for processing, and new tasks can be inserted into the queue at any time according to requirements.
[0109] The device can allocate one or more task processing nodes for the task processing queue, and these nodes can process tasks in parallel.
[0110] Furthermore, the device can estimate the processing situation for the current task processing queue. Specifically, it can estimate the total duration required to process all tasks in the current task processing queue based on the number and processing capabilities of the currently allocated task processing nodes.
[0111] Then compare the estimated total duration with the specified duration. If the total duration is greater than or equal to the specified duration, the number of task processing nodes can be automatically increased. Of course, if it is less than the specified duration, and the difference between the specified duration and the total duration is greater than the preset difference, that is, the total duration is much less than the specified duration, it can be determined that the allocated task processing nodes are relatively idle, and the number of task processing nodes can be automatically reduced.
[0112] It should be noted that since new tasks may be inserted into the task processing queue at any time, the total duration of processing completion of the current task processing queue can be continuously monitored and estimated for resource adjustment. Specifically, it can be monitored periodically.
[0113] For ease of understanding, a resource adjustment method will be explained below with reference to the accompanying drawings.
[0114] As Figure 1 shown, Figure 1 is a flowchart of a resource adjustment method provided by an exemplary embodiment.
[0115] The embodiments of this specification do not limit the execution subject of this method.
[0116] Optionally, this method can be applied to a computing device or a module in a device. For example, this method can be applied to a server, a terminal, or other devices, and this method can also be applied to a task processing module, a task processing center, or a resource scheduling center.
[0117] This method may include the following steps.
[0118] S101: Based on the task processing resources currently allocated to the target task set, determine the estimated processing situation of the current target task set; the target task set has corresponding processing requirements.
[0119] S102: In the case where it is determined that the estimated processing situation of the target task set does not meet the corresponding processing requirements, adjust the allocated task processing resources for the target task set.
[0120] The above method flow can automatically adjust the allocated task processing resources by determining whether the estimated processing situation of the target task set meets the processing requirements, realizing the automation of resource adjustment, reducing manual participation, and improving the real-time performance and efficiency of resource adjustment.
[0121] I. Explanation of S101.
[0122] 1. Task.
[0123] Regarding the tasks in the above method flow, the present method flow does not limit the specific form of the tasks.
[0124] Optionally, the tasks may specifically include at least one of the following: model rendering tasks, machine learning tasks, request processing tasks, and big data processing tasks, etc.
[0125] For ease of understanding, in a specific scenario example, for users with insufficient computing power, they can rent the devices deployed by the service provider to process tasks, specifically such as three-dimensional model rendering, machine learning, and big data processing tasks, and these tasks can be added to the target task set for processing and allocate task processing resources. The service provider can specifically deploy servers to obtain and process the tasks sent by users.
[0126] 2. Task set.
[0127] Regarding the task set in the above method process, the form of the task set and the number of tasks it contains are not limited by this method process.
[0128] Optionally, the target task set in the above method process can be any task set. For the convenience of description, any task set targeted will be called the target task set.
[0129] The form of the target task set is not limited by this method process. Optionally, it can be a data structure such as a linked list, a queue, a stack, etc.
[0130] Optionally, there can be multiple task sets, and each task set can adjust resources according to the above process. The explanations of other task sets can refer to the explanations of the target task set.
[0131] Optionally, regarding the tasks in the target task set, there can be a processing order, and the tasks are processed in that order.
[0132] The method of determining the processing order of tasks is not limited by this method process.
[0133] Optionally, the processing order between tasks in the target task set can be determined based on at least one of the following: task priority, the completion time limit corresponding to the task, and the estimated completion time of the task.
[0134] Optionally, the processing order between tasks can be determined according to the task priority, and the tasks are processed from high to low priority. The tasks with higher priority are processed first, and the tasks with lower priority are processed later.
[0135] Optionally, the processing order between tasks can be determined according to the completion time limit corresponding to the task, and the tasks are processed in the order of the corresponding completion time limit from front to back. The tasks with earlier completion time limits are processed first, and the tasks with later completion time limits are processed later.
[0136] Optionally, the processing order between tasks can be determined according to the estimated completion time of the task. If the estimated completion time exceeds the completion time limit, the task can be processed in advance.
[0137] Optionally, a corresponding key can be determined for the task, and the processing order is determined according to the value of the key. Optionally, the value of the key can be determined based on at least one of the following: task priority, the completion time limit corresponding to the task, and the estimated completion time of the task.
[0138] In a specific example, the processing order between tasks can be determined based on the task priority and the completion time limit corresponding to the task.
[0139] Specifically, the priority value can be determined according to the task priority level, and the time limit value can be determined according to the order of completion time limits. The priority value and the time limit value are concatenated into a value (that is, the value of the key) to determine the processing order between tasks.
[0140] Optionally, the tasks in the target task set may not have a preset fixed processing order, and tasks can be randomly selected for processing. For example, one or more tasks can be randomly selected from the target task set for processing.
[0141] Optionally, the target task set can dynamically increase or decrease the tasks therein.
[0142] The process of this method does not limit the conditions for specifically increasing or decreasing the tasks in the target task set.
[0143] Optionally, the target task set can increase tasks according to requirements and can also decrease the tasks therein according to requirements.
[0144] Optionally, in the case of receiving a new task to be processed, the task to be processed can be added to the target task set.
[0145] Optionally, in the case of obtaining a task in the target task set for processing, the obtained task can be deleted from the target task set.
[0146] Optionally, in the case of obtaining a task in the target task set for processing and completing the processing, the obtained task can be deleted from the target task set.
[0147] Optionally, the specified task in the target task set can be deleted according to requirements.
[0148] Correspondingly, the tasks in the target task set can have a processing order, and as the target task set increases or decreases, the processing order can also be adjusted accordingly.
[0149] The process of this method does not limit the way of adjusting the processing order.
[0150] Optionally, in the case of the target task set decreasing tasks, the decreased tasks can be directly deleted from the original processing order.
[0151] Optionally, in the case of the target task set increasing tasks, for the added tasks, the position where the added tasks should be inserted can be determined according to the method for determining the processing order, so as to achieve the adjustment of the order.
[0152] For example, in the case of determining the order of task processing according to task priorities, the position lower than the priority of the previous task and higher than the priority of the next task can be determined according to the priority of the added task.
[0153] For another example, in the case of determining the order of task processing according to the value of the key corresponding to the task, the position higher than the value of the key of the previous task and lower than the value of the key of the next task can be determined according to the value of the key of the added task.
[0154] Optionally, the target task set can be used to add or delete tasks therein.
[0155] Optionally, in the above method flow, the task addition requirement can also be monitored; in the case of detecting the need to add a new task, the new task is added to the target task set.
[0156] Optionally, the task addition requirement can be for the target task set.
[0157] Optionally, for the new task to be added, it can be determined whether it needs to be added to the target task set, or among multiple task sets, the task set to which the task to be added belongs can be determined.
[0158] Correspondingly, optionally, for the convenience of adding tasks to the target task set in real time, the target task set can adopt a data structure convenient for adding tasks, such as a skip list. Optionally, the target task set can specifically be: a skip list with tasks as nodes.
[0159] The full name of the skip list is the jump list, which allows fast query, insertion, and deletion of an ordered continuous element data linked list. The average search and insertion time complexity of the skip list are both O(logn). Fast query is achieved by maintaining a multi-level linked list, and the elements in each level linked list are a subset of the elements in the previous level linked list. At the beginning, the algorithm searches in the sparest level until the element to be searched is between two adjacent elements in that level. At this time, the algorithm jumps to the next level and repeats the previous search until the element to be searched is found.
[0160] Optionally, for the skip list with tasks as nodes, the tasks can be sorted according to the processing order.
[0161] Correspondingly, in the case of needing to insert a new task into the skip list, query and node insertion can be performed according to the value of the key of the new task. Specifically, according to the value of the key of the new task, the position higher than the value of the key of the previous task and lower than the value of the key of the next task can be determined, and the node of the new task is inserted.
[0162] For ease of understanding, in a specific example, the business side can deploy 3 task processing queues. Each task processing queue can perform task writing and reading, obtain tasks from the task processing queue for processing, or add new tasks to the task processing queue.
[0163] Different task processing queues can be distinguished according to task types or according to processing time limits.
[0164] For example, the 3 task processing queues can be a 3D model rendering task queue, a machine learning task queue, and a big data processing task queue respectively. Or, the 3 task processing queues can be a task queue to be processed within 2 hours, a task queue to be processed within 4 hours, and a task queue to be processed within 10 hours respectively. Different time limits can correspond to different charging standards.
[0165] 3. Regarding task processing resources.
[0166] Regarding the task processing resources in the above method process, this method process does not limit the form of task processing resources.
[0167] Optionally, the task processing resources can include at least one of the following: the number of task processing nodes, the number of task processing devices, computing power resources, and storage resources.
[0168] Optionally, in the above method process, tasks in the target task set can also be obtained for processing based on the currently allocated task processing resources. Specifically, tasks can be obtained for processing based on a preset processing order.
[0169] 4. Regarding the estimated processing situation.
[0170] This method process does not limit the way of determining the estimated processing situation.
[0171] Optionally, the estimated processing situation can be monitored to improve the real-time performance of resource adjustment and facilitate task processing when meeting processing requirements.
[0172] Optionally, it can also be to determine the estimated processing situation multiple times or periodically. The size of the period is not limited in this embodiment.
[0173] Optionally, to determine the estimated processing situation of the current target task set, specifically, it can be: monitoring the estimated processing situation of the current target task set; or, determining the estimated processing situation of the current target task set according to a preset time plan; or, periodically determining the estimated processing situation of the current target task set.
[0174] In this embodiment, the real-time nature of resource adjustment can be improved by increasing the number of times of estimating the processing situation of the target task set, which facilitates the processing of tasks when the processing requirements are met.
[0175] The process flow of this method does not limit the form of the estimated processing situation.
[0176] Optionally, for the target task set, the duration of estimating the completion of all tasks currently included in the target task set can be predicted as the estimated processing situation; alternatively, for the target task set, the time when each task in the target task set is estimated to be completed can be predicted as the estimated processing situation; alternatively, for the target task set, the speed of task processing can be predicted as the estimated processing situation.
[0177] 5. Regarding processing requirements.
[0178] The process flow of this method does not limit the form of the processing requirements.
[0179] Optionally, the processing requirement can be that, for the target task set, the duration of estimating the completion of all tasks currently included in the target task set is less than the preset duration; alternatively, it can be that, for the target task set, the time when each task in the target task set is estimated to be completed is before the time limit of each task; alternatively, it can be that, for the target task set, the task processing speed is greater than the preset speed.
[0180] Optionally, the form of the processing requirement can correspond to the estimated processing situation.
[0181] II. Explanation of S102.
[0182] The process flow of this method does not limit the way of comparing the estimated processing situation and the processing requirements.
[0183] Optionally, in the above method flow, it can also be determined whether the estimated processing situation of the target task set meets the corresponding processing requirements.
[0184] The process flow of this method does not limit the resource adjustment method.
[0185] Optionally, the task processing resources allocated for the target task set can be adjusted until the corresponding processing requirements can be met based on the adjusted task processing resources.
[0186] Optionally, the amount of resources to be adjusted can be comprehensively determined based on the processing requirements and the currently determined estimated processing situation to meet the processing requirements.
[0187] III. Embodiment of adjusting resources based on the estimated processing situation of tasks.
[0188] In an alternative embodiment, resource adjustment can be performed according to whether the task can be completed within the time limit.
[0189] Optionally, determining the estimated processing situation of the current target task set may be: determining the estimated task completion time of the tasks in the target task set during the processing of the target task set.
[0190] Optionally, the processing requirements may include: the preset task time range corresponding to the tasks in the target task set.
[0191] Optionally, determining that the estimated processing situation of the target task set does not meet the corresponding processing requirements may specifically be: determining that the estimated task completion time of any task in the target task set is not within the corresponding preset task time range.
[0192] For ease of understanding, as Figure 2 shown, Figure 2 is a schematic flowchart of another resource adjustment method provided by an exemplary embodiment.
[0193] This method may include the following steps.
[0194] S201: Based on the task processing resources currently allocated to the target task set, determine the estimated task completion time of the tasks in the current target task set during the processing of the target task set; the tasks in the target task set correspond to a preset task time range.
[0195] S202: In the case where it is determined that the estimated task completion time of any task in the target task set is not within the corresponding preset task time range, adjust the allocated task processing resources for the target task set.
[0196] The above method flow can automatically adjust the allocated task processing resources by determining whether the estimated task completion time of the tasks in the target task set is within the corresponding preset task time range, realizing the automation of resource adjustment, reducing manual participation, improving the real-time performance and efficiency of resource adjustment, and increasing the probability of tasks being completed within the corresponding time range.
[0197] The explanation of this embodiment can be referred to other embodiments, specifically, the explanation of the above method flows S101 - S102 can be referred to.
[0198] 1. Regarding S201.
[0199] Optionally, the estimated task completion time of the task may specifically be the estimated time to complete the task during the processing of the tasks in the target task set.
[0200] This embodiment does not limit the number of tasks for which the estimated task completion time needs to be determined.
[0201] Optionally, there may be tasks in the target task set that have no time limit requirements, or tasks that do not have a corresponding preset task time range, so it is not necessary to determine the estimated task completion time for these tasks.
[0202] Optionally, the estimated task completion time of one or more tasks in the current target task set can be determined; the estimated task completion time of each task in the current target task set can also be determined; the estimated task completion time of some or all tasks in the current target task set can also be determined.
[0203] Optionally, one or more tasks in the target task set can have a corresponding preset task time range; each task in the target task set can have a corresponding preset task time range; some or all tasks in the target task set can have a corresponding preset task time range.
[0204] This embodiment does not limit the form and determination method of the preset task time range.
[0205] Optionally, the corresponding preset task time range can be set according to the task requirements, or according to the task processing situation, or according to the configuration of the target task set.
[0206] Optionally, a task can have a corresponding completion time limit requirement. For example, the task needs to be completed before a certain moment, so the preset task time range can be set according to the completion time limit. Specifically, it can be from the current moment to the completion time limit, or a time range can be selected before the completion time limit.
[0207] Optionally, the task processing situation can specifically be the task processing situation in the target task set. If there are tasks in the target task set that exceed the actual completion time limit, then a time range can be selected between the current moment and the corresponding completion time limit for the task to facilitate the completion of task processing before the completion time limit.
[0208] Optionally, the target task set can correspond to a configured limit on the processing duration, specifically the maximum processing duration since the task was added to the target task set. For example, if a certain task is added to the target task set at 2 o'clock sharp, it needs to be processed and completed before 4 o'clock sharp, and the maximum processing duration is 2 hours; another task is added to the target task set at 3 o'clock sharp, and it needs to be processed and completed before 5 o'clock sharp. Therefore, based on the configuration of the target task set, the completion time limit of the task can be determined, and the corresponding preset task time range can be further determined. Of course, different task sets can correspond to different maximum processing durations. For example, different task sets can correspond to 2 hours, 4 hours, 8 hours, etc., to provide different choices for customers and also charge different fees.
[0209] Optionally, the tasks in the target task set may correspond to completion time limits; the preset task time range corresponding to a task is determined based on the completion time limit corresponding to the task.
[0210] Optionally, one or more tasks in the target task set may correspond to completion time limits; each task in the target task set may correspond to a completion time limit; some or all of the tasks in the target task set may correspond to completion time limits.
[0211] This embodiment does not limit the manner of determining the task completion time limit. Optionally, it can be determined according to the task requirements, or it can be determined according to the configuration of the target task set.
[0212] This embodiment does not limit the manner of determining the preset task time range based on the completion time limit.
[0213] Optionally, the time range from the current time to the completion time limit can be determined as the preset task time range; alternatively, a time period between the current time and the completion time limit can be determined as the preset task time range; alternatively, the current time to a time before the completion time limit can be determined as the preset task time range.
[0214] Optionally, to determine the estimated task completion time of the tasks in the current target task set during the processing of the target task set, specifically, it can be: determining the estimated task completion time of one or more tasks in the current target task set during the processing of the target task set; or it can be: determining the estimated task completion time of each task in the current target task set during the processing of the target task set; or it can be: determining the estimated task completion time of all or part of the tasks in the current target task set during the processing of the target task set.
[0215] Optionally, to determine the estimated task completion time of the tasks in the current target task set during the processing of the target task set, specifically, it can be: monitoring the estimated task completion time of the tasks in the current target task set during the processing of the target task set; or, periodically determining the estimated task completion time of the tasks in the current target task set during the processing of the target task set.
[0216] This embodiment does not limit the specific method of determining the estimated task completion time.
[0217] Optionally, there may be no preset fixed processing sequence among the tasks in the target task set. Correspondingly, for any task, the estimated task completion time can be determined on the premise that the task is the last one to be processed in the target task set.
[0218] Optionally, there may be a processing order among the tasks in the target task set. Based on the processing order, it is convenient to determine the estimated task completion time of the tasks.
[0219] Optionally, based on the processing order, the estimated task completion time may specifically be the time estimated to complete the task during the process of processing the tasks in the target task set based on the processing order.
[0220] Optionally, to determine the estimated task completion time of the tasks in the target task set during the processing of the target task set, it may specifically be: for the target task in the target task set and other tasks before the target task in the processing order, determine the estimated task computation amount required to separately process each of the targeted tasks; based on the currently allocated task processing resources and the sum of the determined estimated task computation amounts, determine the estimated task completion duration of the target task during the processing of the target task set; based on the current time and the determined estimated task completion duration, determine the estimated task completion time of the target task during the processing of the target task set.
[0221] Optionally, the target task may be any task in the target task set. For the convenience of description, any task in the targeted target task set is referred to as the target task.
[0222] Optionally, the estimated task computation amount of a task may specifically be the computation amount estimated to separately process the task. The form of the estimated task computation amount is not limited in this embodiment. Optionally, the estimated task computation amount may specifically include the estimated task processing duration required to separately process the task. Optionally, the estimated task computation amount may also be the predicted number of computation times estimated to separately process the task, or the predicted computing power estimated to separately process the task, etc.
[0223] Optionally, the estimated task processing duration of a task may specifically be the duration estimated to separately process the task. It can be understood that the duration required to separately process the task may specifically be the duration required to separately process a single task based on a preset computing device. The specific preset computing device is not limited in this embodiment. Optionally, the preset computing device may be a task processing node or a task processing device.
[0224] Optionally, the estimated task completion duration of a task may specifically be the duration estimated to complete the task during the process of processing the tasks in the target task set. For example, during the process of processing the tasks in the target task set, estimate the total duration required to complete the other tasks before the task in the processing order and this task.
[0225] This embodiment does not limit the specific method for determining the estimated task computation amount of a task.
[0226] Optionally, the preset estimated task computation amount can be determined according to the specific situation of the task itself. For example, the preset estimated task computation amount can be determined according to the task type.
[0227] Optionally, the method for determining the estimated task computation amount of any task in the target task set can specifically be: for any task in the target task set, determine the estimated task computation amount required for separately processing the targeted task according to the parameters of the targeted task.
[0228] This embodiment does not limit the specific form of the task parameters, nor does it limit the manner of determining the estimated task computation amount according to the task parameters.
[0229] Optionally, the task parameters can specifically include at least one of the following: task type, task-related information, and task file size, etc.
[0230] Optionally, determining the estimated task computation amount required for separately processing the targeted task according to the parameters of the targeted task can specifically be: according to the type of the targeted task, determine the mapping relationship between the task parameters and the estimated task computation amount obtained by fitting based on the historical processing data of the same type of tasks in advance; determine the corresponding estimated task computation amount in the mapping relationship according to the task parameters of the targeted task.
[0231] This embodiment does not limit the specific fitting method.
[0232] Optionally, the estimated task computation amount can specifically be the estimated task processing duration.
[0233] This embodiment does not limit the specific manner of determining the estimated task completion duration.
[0234] Optionally, the task processing resources can include the number of task processing nodes; based on the currently allocated task processing resources and the sum of the determined estimated task computation amounts, determining the estimated task completion duration of the target task during the processing of the target task set can specifically be: divide the sum of the determined estimated task processing durations by the number of currently allocated task processing nodes to obtain the estimated task completion duration of the target task during the processing of the target task set. Optionally, the estimated task processing duration here can specifically be the duration required for a single task processing node to separately process the target task, so that the estimated task completion duration can be predicted by dividing by the number of task processing nodes.
[0235] Optionally, the task processing resources can specifically include computing power resources, so that the estimated task completion duration of the target task during the processing of the target task set can be determined according to the sum of the determined estimated task computation amounts and the currently allocated computing power resources.
[0236] Optionally, the estimated task completion duration can be determined based on other forms of task processing resources.
[0237] For ease of understanding, in a specific example, the task processing resource can specifically be the device computing power, that is, the number of calculations per minute, and the sum of the estimated task calculation amounts can also be in the form of the sum of the required calculation amounts. Thus, the required calculation duration in minutes can be predicted by dividing the sum of the estimated task calculation amounts by the device computing power to determine the estimated task completion duration.
[0238] 2. Regarding S202.
[0239] This embodiment does not limit the specific resource adjustment method.
[0240] Optionally, for the target task set, adjusting the allocated task processing resources may specifically include at least one of the following:
[0241] 1) When it is determined that the estimated task completion time of any task in the target task set is after the maximum time in the corresponding preset task time range, increase the allocated task processing resources for the target task set.
[0242] 2) When it is determined that the estimated task completion time of any task in the target task set is before the minimum time in the corresponding preset task time range, reduce the allocated task processing resources for the target task set.
[0243] 3) When it is determined that the estimated task completion times of a preset number of tasks in the target task set are before the minimum time in the corresponding preset task time range, reduce the allocated task processing resources for the target task set.
[0244] Optionally, for the target task set, the allocated task processing resources can be adjusted so that the estimated task completion times of each task in the target task set re - determined based on the adjusted task processing resources are within the corresponding preset task time ranges.
[0245] Optionally, based on the corresponding preset task time range and the currently determined estimated task completion time, the amount of resources to be adjusted can be comprehensively determined so that the estimated task completion times of each task in the target task set re - determined based on the adjusted task processing resources are within the corresponding preset task time ranges.
[0246] IV. Embodiment of resource adjustment based on the overall estimated processing situation of the task set.
[0247] In an alternative embodiment, resource adjustment can be performed according to whether the task set can be completed within the specified duration.
[0248] Optionally, the estimated processing situation of the target task set can be: determining the estimated completion duration of the set for processing the current target task set.
[0249] Optionally, the processing requirements may include: the preset set duration range corresponding to the target task set.
[0250] Optionally, it is determined that the estimated processing situation of the target task set does not meet the corresponding processing requirements. Specifically, it can be: determining that the estimated completion duration of the target task set is not within the corresponding preset set duration range.
[0251] For ease of understanding, as Figure 3 shown, Figure 3 is a schematic flowchart of another resource adjustment method provided by an exemplary embodiment.
[0252] The method may include the following steps.
[0253] S301: Based on the task processing resources currently allocated to the target task set, determine the estimated completion duration of the set for processing the current target task set; the target task set corresponds to a preset set duration range.
[0254] S302: In the case where it is determined that the estimated completion duration of the target task set is not within the corresponding preset set duration range, adjust the allocated task processing resources for the target task set.
[0255] The above method process can automatically adjust the allocated task processing resources by determining whether the estimated completion duration of the target task set is within the corresponding preset set duration range, realizing the automation of resource adjustment, reducing manual participation, improving the real-time performance and efficiency of resource adjustment, and increasing the probability of the task set being completed within the corresponding duration range.
[0256] The explanation of this embodiment can be referred to other embodiments. Specifically, it can refer to the explanation of the above method processes S101 - S102.
[0257] 1. Regarding S301.
[0258] Optionally, the estimated completion duration of the set can specifically be the duration predicted and estimated for processing all tasks in the target task set during the process of processing the target task set.
[0259] This embodiment does not limit the determination method of the estimated completion duration of the set.
[0260] Optionally, the estimated completion duration of the set can be determined according to the number of tasks in the target task set or other task information.
[0261] Optionally, the method for determining the estimated set completion duration may be as follows: for any task in the target task set, determine the estimated task computation amount required to process the targeted task individually; based on the sum of the estimated task computation amounts of the tasks in the target task set and the currently allocated task processing resources, determine the estimated set completion duration.
[0262] The explanation of the estimated task computation amount can be found above.
[0263] This embodiment does not limit the method for determining the estimated set completion duration in combination with the currently allocated task processing resources.
[0264] Optionally, the task processing resources may include the number of task processing nodes; the estimated task computation amount includes the estimated task processing duration required to process the task individually; based on the sum of the estimated task processing durations of the tasks in the target task set and the currently allocated task processing resources, determining the estimated set completion duration may specifically be: divide the sum of the estimated task processing durations of the tasks in the target task set by the number of currently allocated task processing nodes to obtain the estimated set completion duration. Optionally, the estimated task processing duration here may specifically be the duration required for a single task processing node to process the target task individually, so that the estimated task completion duration can be predicted by dividing by the number of task processing nodes. The specific explanation can be found above.
[0265] Optionally, the task processing resources may specifically include computing power resources, so that the estimated set completion duration can be determined based on the sum of the determined estimated task computation amounts and the currently allocated computing power resources.
[0266] Optionally, the estimated task completion duration may be determined according to other forms of task processing resources.
[0267] This embodiment does not limit the specific method for determining the estimated task computation amount of the task.
[0268] Optionally, the preset estimated task computation amount may be determined according to the specific situation of the task itself. For example, determine the preset estimated task computation amount according to the task type.
[0269] Optionally, the method for determining the estimated task computation amount of any task in the target task set may specifically be: for any task in the target task set, determine the estimated task computation amount required to process the targeted task individually according to the parameters of the targeted task.
[0270] This embodiment does not limit the specific form of the task parameters nor the method for determining the estimated task computation amount according to the task parameters.
[0271] Optionally, the task parameters may specifically include at least one of the following: task type, task-related information, task file size, and so on.
[0272] Optionally, based on the parameters of the targeted task, determine the estimated task computation amount required to process the targeted task individually. Specifically, it may be: based on the type of the targeted task, determine the mapping relationship between the task parameters and the estimated task computation amount obtained by fitting based on the historical processing data of the same type of tasks in advance; based on the task parameters of the targeted task, determine the corresponding estimated task computation amount in the mapping relationship.
[0273] This embodiment does not limit the specific fitting method.
[0274] Optionally, determine the estimated set completion duration for processing the current target task set. Specifically, it may be to monitor the estimated set completion duration for processing the current target task set; or periodically determine the estimated set completion duration for processing the current target task set.
[0275] This embodiment does not limit the method for determining the preset set duration range.
[0276] Optionally, for the target task set, a preset set duration range may be set in advance. Specifically, for each task set, a preset set duration range may be set separately.
[0277] In a specific example, for different task sets, different preset set duration ranges may be set. Specifically, the preset set duration ranges of 2 hours, 4 hours, and 10 hours may be set separately. The preset set duration range may be used as the processing duration limit for the tasks in the task set. More specifically, a preset set duration range of 1 hour to 2 hours may be set.
[0278] Optionally, the corresponding preset set duration range may also be determined according to the information of each task in the target task set.
[0279] For example, according to the task with the closest completion deadline in the target task set, based on the duration from the current moment to the completion deadline, determine the corresponding preset set duration range.
[0280] 2. Regarding S302.
[0281] This embodiment does not limit the specific resource adjustment method.
[0282] Optionally, for the target task set, adjust the allocated task processing resources, which may specifically include at least one of the following:
[0283] 1) In the case where it is determined that the estimated set completion duration is less than the minimum value of the preset set duration range, for the target task set, reduce the allocated task processing resources.
[0284] 2) When it is determined that the estimated set completion duration is greater than or equal to the maximum value of the preset set duration range, for the target task set, increase the allocated task processing resources.
[0285] Optionally, for the target task set, the allocated task processing resources can be adjusted so that the estimated set completion duration of the target task set re-determined based on the adjusted task processing resources is within the corresponding preset set duration range.
[0286] Optionally, based on the corresponding preset set duration range and the currently determined estimated set completion duration, the amount of resources to be adjusted can be comprehensively determined so that the estimated set completion duration of the target task set re-determined based on the adjusted task processing resources is within the corresponding preset set duration range.
[0287] For the convenience of understanding, the embodiments of this specification also provide a product embodiment.
[0288] The product can specifically be a device or a module in a device. For example, a server, a task processing center, or a resource scheduling center.
[0289] One or more task sets can be specifically deployed, and each task set can correspond to different processing duration limits. For example, processing duration limits of 2 hours, 4 hours, and no time limit respectively correspond to different task sets. Different task sets can have different charging standards.
[0290] The tasks can specifically be tasks provided by different customers. For example, 3D model rendering tasks, clothing rendering tasks, garment rendering tasks, accessory rendering tasks, and so on.
[0291] The task set can specifically be a queue structure, or a linked list structure, and can specifically be a skip list structure.
[0292] The task set can be dynamically written and read, and tasks in it can be increased or decreased according to requirements. Specifically, it can be added to the task set after the customer sends task information according to the customer's needs. Specifically, it can be to select the corresponding task set according to the processing duration limit specified by the customer; it can also be to select the corresponding task set according to the customer's payment situation. For example, if the customer needs to obtain a rendered 3D model within 2 hours, specifically for clothing, garment, or accessory, the task sent by the customer can be added to the task set with a 2-hour processing time limit for processing, and the maximum processing time limit of the task can be set to 2 hours after the current time.
[0293] For any one of the one or more task sets, the following operations can be performed to adjust resources.
[0294] Specifically, based on the task processing resources currently allocated to the task set, the estimated set completion time of the current task set can be continuously monitored and processed; the task set corresponds to a preset set time range, and the maximum value of the preset set time range can be the processing time limit.
[0295] When it is determined that the estimated set completion duration of the task set is not within the corresponding preset set duration range, the allocated task processing resources are adjusted for the task set.
[0296] With the dynamic increase or decrease of tasks in the task set, continuous monitoring can also be performed based on the above operations to facilitate real-time adjustment of task processing resources.
[0297] Of course, it is also possible to adjust resources based on whether each task in the task set can be processed and completed before the corresponding time limit. The specific process can refer to the previous method embodiment. For example, for the above-mentioned 3D model rendering task that needs to be processed and completed within 2 hours, the specific time limit may be 5 o'clock, then the estimated processing time can be predicted for the task, and then it is estimated whether it can be processed and completed before 5 o'clock. If it can be processed and completed, there is no need to adjust resources. If it cannot be processed and completed, it is necessary to increase resources to ensure that the task can be processed and completed before 5 o'clock.
[0298] For ease of understanding, the present specification also provides a specific method embodiment.
[0299] This embodiment can use a priority queue implemented by a skip list as memory storage, realize task calculation estimation and queue calculation statistics through cloud rendering time estimation algorithm, and realize intelligent task scheduling in conjunction with the elastic scaling capabilities of cloud vendors.
[0300] This embodiment can meet the user's requirements for information query and response speed as much as possible, while realizing the intelligence of the entire process, improving the utilization efficiency of computing power and reducing manual supervision and intervention.
[0301] First, the calculation formula for each task can be obtained in advance through historical data analysis. This formula is usually obtained by fitting specific business parameters with the actual processing time.
[0302] For example, in the vRay rendering task scenario, you can use the "maximum rendering time" x and the model file size as the independent variable z, and the actual rendering time as the dependent variable Y. Perform linear fitting based on historical task data, assuming that the calculation formula is as follows: Y = a*x+b*z+c. By performing binary linear regression on historical data, the parameter values a, b, and c are finally obtained.
[0303] We can further use skip lists to build priority queues.
[0304] The skip list is stored in order, and the average time complexity of searching and inserting is O(logN), which is very suitable for queues with frequent read and write operations.
[0305] Specifically, based on the priority field of the task (usually using a 2-digit decimal integer) and the duration between the current time and the task completion deadline, the sorting key value can be constructed and further the skip list can be constructed.
[0306] When taking tasks, the first sorting key value can be taken from the head of the skip list and enter the task processing process.
[0307] For specific resource adjustment, the estimated task calculation amount of each task in the priority queue (which can be specifically obtained based on the pre-fitted calculation formula) can be used to calculate the total calculation amount of the current queue, and the estimated set completion duration of the current queue can be estimated according to the current computing power situation.
[0308] When the estimated set completion time of the entire queue exceeds the threshold of the business requirement, enter the horizontal expansion process. Specifically, the API of the cloud computing vendor can be called to horizontally expand new computing power.
[0309] Similarly, when the estimated set completion time of the entire queue drops below the business requirement threshold, enter the horizontal scaling-down process, and computing power will be released in this process to save computing resources.
[0310] More specifically, the tasks can be traversed starting from the head of the priority queue, and using the pre-fitted calculation formula, the estimated task calculation amount of each task can be calculated, which can be in the form of the estimated task processing duration, and the estimated task processing durations of all tasks are accumulated together to obtain the value S, and S is the total estimated task calculation amount of the current queue (which can be the total estimated task processing duration).
[0311] Let the current time be T1, the estimated completion time of the queue be T, and the total number of nodes where the current task is executed be n, then the value of T can be calculated as follows: T = T1 + (S / n).
[0312] According to the product strategy, different thresholds for T can be set. For example: for an important task queue, a threshold T2 is set, and it is required to ensure that all tasks are completed within T2.
[0313] When it is detected that T > T2, it can be regarded as triggering an expansion. At this time, the capacity expansion process can be triggered by calling the API of the cloud service vendor, and new elastic computing hosts can be applied for in the expansion process. There are different calling methods depending on the cloud service vendor.
[0314] A threshold T3 can also be set, where T3 < T2. When it is detected that T ≤ T3, scaling-down can be triggered.
[0315] This embodiment can specifically process and adjust resources for the rendering task of the 3D model.
[0316] This embodiment can reduce manual participation, increase the probability of task completion within the time limit, and control the computing power cost.
[0317] This embodiment can regress the pre-estimation method of the task using historical data; it can also improve the query and write performance of the queue through a priority queue implemented by a skip list; it can also estimate the computing power requirements through the priority queue and access elastic computing power to balance business requirements and computing costs.
[0318] This embodiment of the specification also provides a corresponding device embodiment.
[0319] As Figure 4 shown, Figure 4 is a schematic structural diagram of a resource adjustment device provided by an exemplary embodiment.
[0320] The device may include the following units.
[0321] The estimation unit 401 is configured to determine the estimated processing situation of the current target task set based on the task processing resources currently allocated to the target task set; the target task set has corresponding processing requirements.
[0322] The adjustment unit 402 is configured to adjust the allocated task processing resources for the target task set when it is determined that the estimated processing situation of the target task set does not meet the corresponding processing requirements.
[0323] Optionally, the estimation unit 401 is configured to: determine the estimated task completion time of the tasks in the target task set during the processing of the target task set; the processing requirements include: the preset task time range corresponding to the tasks in the target task set.
[0324] Optionally, the adjustment unit 402 is configured to: when it is determined that the estimated task completion time of any task in the target task set is not within the corresponding preset task time range, adjust the allocated task processing resources for the target task set.
[0325] Optionally, the adjustment unit 402 is configured to:
[0326] when it is determined that the estimated task completion time of any task in the target task set is after the maximum time of the corresponding preset task time range, increase the allocated task processing resources for the target task set; and / or
[0327] When determining the estimated task completion time of any task in the target task set and the situation is before the minimum time of the corresponding preset task time range, reduce the allocated task processing resources for the target task set.
[0328] Optionally, there is a processing sequence among the tasks in the target task set;
[0329] Optionally, the estimation unit 401 is used for:
[0330] For the target task in the target task set and other tasks before the target task in the processing sequence, determine the estimated task computation amount required for separately processing each of the targeted tasks;
[0331] Based on the currently allocated task processing resources and the sum of the determined estimated task computation amounts, determine the estimated task completion duration of the target task during the processing of the target task set;
[0332] Based on the current time and the determined estimated task completion duration, determine the estimated task completion time of the target task during the processing of the target task set.
[0333] Optionally, the task processing resources include the number of task processing nodes; the estimated task computation amount includes the estimated task processing duration required for separately processing the task;
[0334] Optionally, the estimation unit 401 is used for: dividing the sum of the determined estimated task processing durations by the currently allocated number of task processing nodes to obtain the estimated task completion duration of the target task during the processing of the target task set.
[0335] Optionally, the method for determining the estimated task computation amount of any task in the target task set includes:
[0336] For any task in the target task set, determine the estimated task computation amount required for separately processing the targeted task according to the parameters of the targeted task.
[0337] Optionally, determining the estimated task computation amount required for separately processing the targeted task according to the parameters of the targeted task includes:
[0338] According to the type of the targeted task, determine the mapping relationship between the task parameters and the estimated task computation amount obtained by fitting based on the historical processing data of the same type of tasks in advance;
[0339] According to the task parameters of the targeted task, determine the corresponding estimated task computation amount in the mapping relationship.
[0340] Optionally, the tasks in the target task set have completion time limits; the corresponding preset task time range of the task is determined based on the completion time limit corresponding to the task.
[0341] Optionally, the estimation unit 401 is configured to: determine an estimated set completion time for processing to complete the current target task set; the processing requirements include: a preset set time range corresponding to the target task set;
[0342] Optionally, the adjustment unit 402 is configured to: in the case where it is determined that the estimated set completion time of the target task set is not within the corresponding preset set time range, adjust the allocated task processing resources for the target task set.
[0343] Optionally, the adjustment unit 402 is configured to:
[0344] In the case where it is determined that the estimated set completion time is less than the minimum value of the preset set time range, reduce the allocated task processing resources for the target task set; and / or
[0345] In the case where it is determined that the estimated set completion time is greater than or equal to the maximum value of the preset set time range, increase the allocated task processing resources for the target task set.
[0346] Optionally, the method for determining the estimated set completion time includes:
[0347] For any task in the target task set, determine the estimated task computation amount required to process the task alone;
[0348] Based on the sum of the estimated task computation amounts of the tasks in the target task set and the currently allocated task processing resources, determine the estimated set completion time.
[0349] Optionally, the task processing resources include the number of task processing nodes; the estimated task computation amount includes the estimated task processing time required to process the task alone;
[0350] Optionally, the estimation unit 401 is configured to: divide the sum of the estimated task processing times of the tasks in the target task set by the currently allocated number of task processing nodes to obtain the estimated set completion time.
[0351] Optionally, there is a processing sequence among the tasks in the target task set.
[0352] Optionally, the processing sequence among the tasks in the target task set is determined based on at least one of the following: task priority, completion deadline corresponding to the task, and estimated completion time of the task.
[0353] Optionally, the apparatus further includes an adding unit 403, configured to monitor the task adding requirement; and in the case where it is monitored that a new task needs to be added, add the new task to the target task set.
[0354] Optionally, the target task set includes: a skip list with tasks as nodes.
[0355] Optionally, the estimation unit 401 is configured to: monitor the estimated processing situation of the current target task set.
[0356] Optionally, the task processing resources include at least one of the following: the number of task processing nodes, the number of task processing devices, computing power resources, and storage resources.
[0357] For the specific explanations of the above device embodiments, reference can be made to the explanations of the method embodiments.
[0358] The various technical features in the above embodiments can be combined arbitrarily as long as there is no conflict or contradiction between the features. However, due to space limitations, they are not described one by one. Therefore, any combination of the various technical features in the above embodiments also belongs to the scope disclosed in the present invention.
[0359] The embodiments of the present specification also provide an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein, the processor realizes any of the above method embodiments by running the executable instructions.
[0360] Figure 5 It is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to Figure 5 , at the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710. Of course, it may also include other hardware required for other services. One or more embodiments of the present specification can be implemented in a software manner. For example, the processor 702 reads the corresponding computer program from the non-volatile memory 710 into the memory 708 and then runs it. Of course, in addition to the software implementation manner, one or more embodiments of the present specification do not exclude other implementation manners, such as a logic device or a combination of software and hardware. That is to say, the execution subject of the following processing flow is not limited to each logic unit, and can also be hardware or a logic device.
[0361] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by a computer chip or an entity, or by a product with a certain function. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any several of these devices.
[0362] In a typical configuration, a computer includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.
[0363] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash RAM. The memory is an example of computer-readable media.
[0364] The embodiments of this specification also provide a computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of any of the above method embodiments are implemented.
[0365] Computer-readable media includes permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0366] It should also be noted that the terms "comprises", "comprising" or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0367] The specific embodiments of this specification have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0368] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a", "the", and "said" used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0369] It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".
[0370] The above description is only a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included within the scope of protection of one or more embodiments of this specification.
Claims
1. A resource adjustment method, characterized in that, it includes: Based on the task processing resources currently allocated for the target task set, determine the estimated processing situation of the current target task set; The target task set corresponds to processing requirements; In the case where it is determined that the estimated processing situation of the target task set does not meet the corresponding processing requirements, adjust the allocated task processing resources for the target task set.
2. The method according to claim 1, characterized in that, The determination of the estimated processing situation of the current target task set includes: determining the estimated task completion time of the tasks in the target task set during the processing of the target task set; the processing requirements include: the preset task time range corresponding to the tasks in the target task set; The determination that the estimated processing situation of the target task set does not meet the corresponding processing requirements includes: determining that the estimated task completion time of any task in the target task set is not within the corresponding preset task time range.
3. The method according to claim 2, characterized in that, The adjustment of the allocated task processing resources for the target task set includes: In the case where it is determined that the estimated task completion time of any task in the target task set is after the maximum time of the corresponding preset task time range, increase the allocated task processing resources for the target task set; and / or In the case where it is determined that the estimated task completion time of any task in the target task set is before the minimum time of the corresponding preset task time range, reduce the allocated task processing resources for the target task set.
4. The method according to claim 2, characterized in that, There is a processing sequence among the tasks in the target task set; The determination of the estimated task completion time of the tasks in the target task set during the processing of the target task set includes: For the target task in the target task set and the other tasks before the target task in the processing sequence, determine the estimated task calculation amount required to separately process each of the targeted tasks; Based on the currently allocated task processing resources and the sum of the determined estimated task calculation amounts, determine the estimated task completion duration of the target task during the processing of the target task set; Based on the current time and the determined estimated task completion duration, determine the estimated task completion time of the target task during the processing of the target task set.
5. The method according to claim 4, characterized in that, The task processing resources include the number of task processing nodes; the estimated task calculation amount includes the estimated task processing duration required to separately process the task; The determination of the estimated task completion duration of the target task during the processing of the target task set based on the currently allocated task processing resources and the sum of the determined estimated task calculation amounts includes: dividing the sum of the determined estimated task processing durations by the number of currently allocated task processing nodes to obtain the estimated task completion duration of the target task during the processing of the target task set.
6. The method according to claim 4, characterized in that, The method for determining the estimated task computation amount of any task in the target task set includes: For any task in the target task set, determine the estimated task computation amount required to process the targeted task alone according to the parameters of the targeted task.
7. The method according to claim 6, wherein, the determining the estimated task computation amount required to process the targeted task alone according to the parameters of the targeted task includes: Determine the mapping relationship between the task parameters and the estimated task computation amount obtained by fitting in advance based on the historical processing data of the same type of tasks according to the type of the targeted task; Determine the corresponding estimated task computation amount in the mapping relationship according to the task parameters of the targeted task.
8. The method according to claim 2, wherein, the tasks in the target task set have corresponding completion time limits; The preset task time range corresponding to the task is determined based on the completion time limit corresponding to the task.
9. The method according to claim 1, wherein, the determining the estimated processing situation of the target task set includes: determining the estimated set completion duration for processing the current target task set; the processing requirements include: the preset set duration range corresponding to the target task set; The determining that the estimated processing situation of the target task set does not meet the corresponding processing requirements includes: determining that the estimated set completion duration of the target task set is not within the corresponding preset set duration range.
10. The method according to claim 9, wherein, the adjusting the task processing resources allocated for the target task set includes: In the case where it is determined that the estimated set completion duration is less than the minimum value of the preset set duration range, reduce the task processing resources allocated for the target task set; and / or In the case where it is determined that the estimated set completion duration is greater than or equal to the maximum value of the preset set duration range, increase the task processing resources allocated for the target task set.
11. The method according to claim 9, wherein, the determining manner of the estimated set completion duration includes: For any task in the target task set, determine the estimated task computation amount required to process the targeted task alone; Determine the estimated set completion duration according to the sum of the estimated task computation amounts of each task in the target task set and the currently allocated task processing resources.
12. The method according to claim 11, wherein, the task processing resources include the number of task processing nodes; the estimated task computation amount includes the estimated task processing duration required to process the task alone; the determining the estimated set completion duration according to the sum of the estimated task computation amounts of each task in the target task set and the currently allocated task processing resources includes: Divide the sum of the estimated task processing durations of each task in the target task set by the currently allocated number of task processing nodes to obtain the estimated set completion duration.
13. The method according to any one of claims 1 to 12, wherein, there is a processing sequence among the tasks in the target task set.
14. The method according to claim 13, wherein, the processing sequence among tasks in the target task set is determined based on at least one of the following: task priority, the completion time limit corresponding to the task, and the estimated completion time of the task.
15. The method according to any one of claims 1 to 12, wherein, it further includes: monitoring the task addition requirement; when it is monitored that a new task needs to be added, adding the new task to the target task set.
16. The method according to claim 15, wherein, the target task set includes: a skip list with tasks as nodes.
17. The method according to any one of claims 1 to 12, wherein, determining the estimated processing situation of the current target task set includes: monitoring the estimated processing situation of the current target task set.
18. The method according to any one of claims 1 to 12, wherein, the task processing resources include at least one of the following: the number of task processing nodes, the number of task processing devices, computing power resources, and storage resources.
19. A resource adjustment device, wherein, it includes: an estimation unit, configured to determine the estimated processing situation of the current target task set based on the task processing resources currently allocated to the target task set; the target task set corresponds to processing requirements; an adjustment unit, configured to, when it is determined that the estimated processing situation of the target task set does not meet the corresponding processing requirements, adjust the allocated task processing resources for the target task set.
20. An electronic device, including: a processor; a memory for storing processor-executable instructions; wherein, the processor realizes the method according to any one of claims 1 to 18 by running the executable instructions.
21. A computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 18 are realized.