Target resource demand amount determination method and apparatus, device, and storage medium
By automating the assessment and dynamic adjustment of cloud server resource requirements, the problem of low efficiency in resource acquisition and return in existing technologies has been solved, achieving efficient resource utilization and cost savings.
Patent Information
- Application Number
- CN202111262881.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2041-10-28
AI Technical Summary
In existing technologies, the efficiency of acquiring and returning cloud server resources is low and cannot be dynamically adjusted, resulting in a large investment of human resources and an inability to meet flexible changes in resource demand.
By determining whether the preset usage time of the candidate task meets the preset conditions with the current time, the target task is automatically determined, and the target resource requirement is dynamically determined based on the resource demand and usage, thus achieving automation and dynamic adjustment.
It improved the efficiency of determining resource demand, reduced manpower and time costs, enabled the timely acquisition and return of resources, avoided waste, and improved resource utilization.
Smart Images

Figure CN114004479B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer processing technology, and in particular to a method, apparatus, device and storage medium for determining target resource requirements. Background Technology
[0002] Currently, cloud providers typically offer cloud server resources in two ways: annual / monthly subscriptions and pay-as-you-go pricing. Users can choose between these two pricing models based on their actual needs. For those who only use cloud server resources for a few hours each day, pay-as-you-go pricing is usually the preferred option to save costs.
[0003] Typically, the requester initiates a request before the demand begins, based on actual needs, and returns the request after the demand ends. If the demand needs to be increased or decreased in the middle, it is necessary to manually determine whether to initiate another request or return request, which is inefficient and cannot dynamically determine the cloud server resources at each point in time. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for determining target resource requirements, so as to improve the efficiency of determining target resource requirements.
[0005] In a first aspect, embodiments of this application provide a method for determining target resource requirements, the method comprising:
[0006] If the current time meets the preset requirement determination period condition, then determine whether the preset requirement usage time of any candidate task and the current time meet the preset requirement task judgment condition.
[0007] If so, the candidate task is determined as at least one target task at the current time;
[0008] The resource requirements of the target task are determined based on a preset correlation between the resource requirements and the target task.
[0009] Obtain the resource usage of the target task, and determine the target resource requirement based on the resource demand and the resource usage.
[0010] Secondly, embodiments of this application provide a target resource demand determination apparatus, the apparatus comprising:
[0011] The condition judgment module is used to determine whether the preset requirement usage time of any candidate task and the current time meet the preset requirement task judgment condition if the current time meets the preset requirement period condition.
[0012] The target task determination module is used to determine the candidate task as at least one target task at the current time if the preset requirement usage time of any candidate task meets the preset requirement task judgment condition between the current time and the current time.
[0013] The task resource requirement determination module is used to determine the task resource requirement of the target task based on a preset correlation between the resource requirement and the target task.
[0014] The target resource requirement determination module is used to obtain the task resource usage of the target task and determine the target resource requirement based on the task resource requirement and the task resource usage.
[0015] Thirdly, embodiments of this application also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the target resource requirement determination method as described in any of the embodiments of the present invention.
[0016] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the target resource requirement determination method as described in any of the embodiments of the present invention.
[0017] This application embodiment achieves automated determination of target tasks by judging whether the required usage time of any candidate task meets the preset requirement task judgment conditions with the current time. By obtaining the task resource requirements and usage of the target task, the target resource requirements at each time point are dynamically determined, saving manpower and time costs, reducing human resource investment, and improving the efficiency of determining target resource requirements. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating a method for determining target resource requirements according to Embodiment 1 of this application;
[0019] Figure 2A This is a flowchart illustrating a method for determining target resource requirements according to Embodiment 2 of this application;
[0020] Figure 2B This is a schematic diagram of the resource requirement time for a candidate task in Embodiment 2 of this application;
[0021] Figure 3 This is a structural block diagram of a target resource demand determination device according to Embodiment 3 of this application;
[0022] Figure 4This is a schematic diagram of the structure of a target resource demand determination device according to Embodiment 4 of this application. Detailed Implementation
[0023] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present application, not the entire structure.
[0024] Example 1
[0025] Figure 1 This is a flowchart illustrating a method for determining target resource requirements according to Embodiment 1 of the present invention. This embodiment is applicable to situations where target resource requirements at various time points are determined. This method can be executed by a target resource requirement determination device, which can be implemented in software and / or hardware. Figure 1 As shown, the method specifically includes the following steps:
[0026] S110. If the current time meets the preset requirement determination cycle condition, then determine whether the preset requirement usage time of any candidate task meets the preset requirement task judgment condition between the current time and the preset requirement usage time.
[0027] The requirement determination cycle can be preset by relevant technical personnel. For example, the requirement determination cycle can be set to 1 minute, that is, a condition judgment is performed every 1 minute. For instance, if the time interval between the current time and the last requirement task judgment is 1 minute, then the current time meets the preset requirement determination cycle condition, and the requirement task judgment can be performed at the current time.
[0028] Optionally, the initiation time for the requirement task judgment can be flexibly set by relevant technical personnel according to actual needs. For example, fixed daily times, such as 8:20, 8:50, 9:10, ..., 23:00, can be set as the initiation time for the requirement task judgment condition. The system monitors and obtains the current time in real time. If the current time meets the pre-set fixed time point, the requirement task judgment can be performed at the current time.
[0029] Candidate tasks can be tasks that require cloud server resources to complete, and at least one candidate task can exist at any given time. The preset usage time can include the start and end times of the candidate tasks. The relationship between candidate tasks and preset usage times can be determined in advance by relevant technical personnel. For example, if the start time of candidate task A is 8:30, then relevant technical personnel can determine the completion time of candidate task A as 10:30 based on experience or experimental values. The criteria for determining the required task can be set in advance by relevant technical personnel according to actual needs. For example, if the current time is the start time of a candidate task, and the current time is also the preset start time of the candidate task, then the preset usage time of the candidate task and the current time satisfy the preset criteria for determining the required task.
[0030] It should be noted that, to ensure the accuracy of subsequent target task determination, the conditions for judging the required tasks can be further specified more precisely.
[0031] In an optional embodiment, determining whether the preset requirement usage time of any candidate task meets the preset requirement task judgment condition between the current time and the preset requirement usage time includes: determining whether the difference between the requirement start time of any candidate task and the preset resource acquisition time period is not greater than the current time, and whether the requirement end time of the candidate task is not less than the current time; if so, then determining that the preset requirement usage time of the candidate task meets the preset requirement task judgment condition between the current time and the preset requirement usage time.
[0032] The start and end times of the candidate task's requirements, as well as the preset resource acquisition time period, can be determined in advance by relevant technical personnel based on practical experience and experimental values. For example, the preset resource acquisition time period could be 30 minutes, meaning that it would take 30 minutes to acquire the required resources for the candidate task.
[0033] For example, candidate task B's start time is 8:30 and end time is 10:30, while candidate task C's start time is 9:30 and end time is 11:30. The preset resource acquisition period is 30 minutes. If the current time is 8:00, the difference between candidate task B's start time and the preset resource acquisition period can be calculated by subtracting the preset resource acquisition period from the start time of candidate task B (8:30), resulting in a difference of 8:00, which equals the current time. Furthermore, candidate task B's end time (10:30) is greater than the current time (8:00), therefore, the current time is 8:00. In other words, the difference between candidate task B's start time and the preset resource acquisition period is not greater than the current time, and candidate task B's end time is not less than the current time. That is, the preset demand usage time of candidate task B meets the preset demand task judgment condition between the current time and the current time. The difference between the start time of the requirement for candidate task C and the preset resource acquisition time is 9:00, which is greater than the current time of 8:00. Therefore, the preset requirement usage time of candidate task C does not meet the preset requirement task judgment condition between the current time and the preset requirement usage time.
[0034] Continuing the previous example, if the current time is 9:00, the difference between the start time of candidate task B's requirement and the preset resource acquisition time period is 8:00, which is less than the current time 9:00, and the end time of candidate task B's requirement is 10:30, which is greater than the current time 9:00; then at the current time 9:00, the preset requirement usage time of candidate task B meets the preset requirement task judgment condition. Similarly, if the difference between the start time of candidate task C's requirement and the preset resource acquisition time is 9:00, which is equal to the current time 9:00, and the end time of candidate task C's requirement is 11:30, which is greater than the current time 9:00; then at the current time 9:00, the preset requirement usage time of candidate task C meets the preset requirement task judgment condition.
[0035] This optional embodiment further sets the requirement task judgment condition as follows: whether the difference between the start time of any candidate task and the preset resource acquisition time period is not greater than the current time, and whether the end time of the candidate task is not less than the current time. By further limiting the requirement task judgment condition more precisely, the accuracy of determining subsequent target tasks is improved, thereby realizing the accurate determination of the subsequent target resource demand.
[0036] S120. If so, the candidate task is determined as at least one target task at the current time.
[0037] If the preset time required for any candidate task meets the preset criteria for determining the required task in relation to the current time, then the candidate task is determined as the target task for the current time, and the current time can include at least one target task. Continuing the previous example, if the current time is 8:00, then candidate task B can be the target task B for the current time; if the current time is 9:00, then both candidate task B and candidate task C can be the target tasks for the current time, and are respectively target task B and target task C. The target task can be a task that needs to be executed at the current time, a task that is being executed, or a task that is yet to be executed.
[0038] S130. Determine the resource requirements of the target task based on the preset correlation between resource requirements and target tasks.
[0039] The pre-defined relationship between resource requirements and target tasks can be determined in advance by relevant technical personnel based on experience or experimental values. For example, the resource requirement for target task A can be 10 cloud servers; the resource requirement for target task B can be 20 cloud servers.
[0040] The resource requirement of a target task can be the sum of the resource requirements of all target tasks at the current time. For example, if there are target tasks A, B, and C at the current time, and target task A requires 10 cloud servers, target task B requires 20 cloud servers, and target task C requires 15 cloud servers, then the resource requirement of the target task at the current time is 45 cloud servers.
[0041] S140. Obtain the resource usage of the target task, and determine the target resource requirement based on the resource demand and resource usage.
[0042] Identify the target tasks currently being executed. Determine if the difference between the start time of any target task's requirement and the preset resource acquisition time period equals the current time. If so, the target task has not yet been executed; it is an unexecuted task with zero resource usage. The resource usage of all target tasks at the current time is the sum of the resource usage of all other target tasks excluding unexecuted tasks. If the difference between the start time of any target task's requirement and the preset resource acquisition time period is less than the current time, the target task has started executing; it is a currently executing task.
[0043] For example, if there are target tasks A1, A2, and A3 at the current time, and the difference between the start time of target task A1's requirement and the preset resource acquisition time period is equal to the current time, then target task A1 is an unexecuted task. If the difference between the start time of target tasks A2 and A3's requirement and the preset resource acquisition time period is less than the current time, then target tasks A2 and A3 are currently being executed. Therefore, the resource usage of all target tasks at the current time is the sum of the resource usage of target task A2 and target task A3. The resource usage of an executing target task is equal to its resource requirement; that is, if the resource requirement of an executing target task is 20 cloud servers, then the resource usage of an executing target task is 20 cloud servers.
[0044] For example, if the current time is 9:00, and there are target tasks D, E, and F at the current time, and the start time of target task D is 8:30 and the end time is 10:30, the corresponding resource requirement is 10 cloud servers; the start time of target task E is 9:00 and the end time is 11:00, the corresponding resource requirement is 15 cloud servers; the start time of target task F is 9:30 and the end time is 11:30, the corresponding resource requirement is 20 cloud servers, and the preset resource acquisition time period is 30 minutes. If the difference between the start time of target task D's requirement and the preset resource acquisition time period (8:00) is less than the current time (9:00), then target task D's resource usage is 10 cloud servers. If the difference between the start time of target task E's requirement and the preset resource acquisition time period (8:30) is less than the current time (9:00), then target task E's resource usage is 15 cloud servers. If the difference between the start time of target task D's requirement and the preset resource acquisition time period (9:00) is equal to the current time (9:00), then target task D's resource usage is 0 cloud servers. Therefore, at the current time, the resource usage of the target tasks is 25 cloud servers.
[0045] The target resource requirement is determined based on the task's resource demand and usage. For example, the required resource quantity to be acquired or returned can be estimated based on these two figures, and this estimated quantity can be used as the target resource requirement. For instance, if the target task currently requires 40 cloud servers and is using 15, it can be roughly estimated that approximately 25 more cloud servers are needed, perhaps 20 more. This estimated 20 cloud servers can then be used as the target resource requirement.
[0046] This application embodiment achieves automated determination of target tasks by judging whether the required usage time of any candidate task meets the preset requirement task judgment conditions with the current time. By obtaining the task resource requirements and usage of the target task, the target resource requirements at each time point are dynamically determined, saving manpower and time costs, reducing human resource input, improving the efficiency of target resource requirement determination, and enabling rapid response to changes in target task and / or target resource requirements.
[0047] Example 2
[0048] Figure 2A This is a flowchart of a method for determining target resource requirements provided in Embodiment 2 of the present invention. This embodiment is an optimization and improvement based on the above technical solutions.
[0049] Furthermore, the phrase "determine the target resource requirement based on the task resource demand and the task resource usage" is refined to "determine the demand difference based on the task resource demand and the task resource usage, and determine the demand difference as the target resource requirement." This improves the method for determining the target resource requirement.
[0050] like Figure 2A As shown, the method includes the following specific steps:
[0051] S210. If the current time meets the preset requirement determination cycle condition, then determine whether the preset requirement usage time of any candidate task meets the preset requirement task judgment condition between the current time and the preset requirement usage time.
[0052] S220. If so, then the candidate task is determined as at least one target task at the current time.
[0053] S230. Determine the resource requirements of the target task based on the preset correlation between resource requirements and target tasks.
[0054] S240. Obtain the resource usage of the target task. Based on the resource demand and resource usage, determine the demand difference and set the demand difference as the target resource demand.
[0055] The demand difference can be obtained by subtracting the resource usage from the resource requirement of the target task, and the resulting demand difference can be positive, zero, or negative. For example, if the target task requires 30 units of resources and uses 20 units, the demand difference is 10 units, meaning the target resource requirement is 10 units. If the target task requires 10 units of resources and uses 15 units, the demand difference is -5 units, meaning the target resource requirement is -5 units.
[0056] For example, if the target resource requirement is positive, it can be considered that the current target task has insufficient resource requirements; if the target resource requirement is zero, it can be considered that the current target task has just met the resource requirements; if the target resource requirement is negative, it can be considered that the current target task has excessive resource requirements.
[0057] It should be noted that requests for acquiring or returning resources can be promptly initiated from the cloud server provider based on the target resource demand, thereby saving costs and reducing resource waste.
[0058] In an optional embodiment, after determining the target resource requirement, the method further includes: determining whether the target resource requirement is greater than a preset resource requirement; if so, initiating a target resource acquisition request to the cloud server provider based on the target resource requirement.
[0059] The preset resource requirement can be pre-set by relevant technical personnel, for example, it can be set to 0. If the target resource requirement is greater than the preset resource requirement, a request to acquire the target resource can be initiated from the cloud server provider based on the target resource requirement. The target resource can be a cloud server. For example, if the target resource requirement is 20 cloud servers and the preset resource requirement is set to 0, then the target resource requirement is greater than the preset resource requirement, and a request can be made to the cloud service provider to acquire 20 cloud servers.
[0060] This optional embodiment determines whether to initiate a target resource acquisition request to the cloud server provider by judging whether the target resource demand is greater than the preset resource demand. This enables timely acquisition of target resources at each point in time, avoiding the waste of resources caused by acquiring the target resource demand too early, and the delay in processing the target task caused by acquiring the target resource demand too late.
[0061] In an optional embodiment, after determining whether the target resource demand is greater than the preset resource demand, the method further includes: if the target resource demand is less than the preset resource demand, then the target resource is returned to the cloud server provider.
[0062] If the target resource requirement is less than the preset resource requirement, the target resources can be returned to the cloud server provider based on the target resource requirement. For example, if the target resource requirement is -10 cloud servers and the preset resource requirement is set to 0, then since the target resource requirement is less than the preset resource requirement, 10 cloud servers can be returned to the cloud service provider.
[0063] Optionally, if the target resource requirement is equal to the preset resource requirement, no processing is required; that is, there is no need to acquire or return the target resource.
[0064] This optional embodiment determines whether to return the target resource to the cloud server provider by judging whether the target resource demand is less than the preset resource demand. This enables timely return of the target resource at each point in time, avoids waste of target resources that are not needed, and reduces the cost of using cloud servers.
[0065] It's important to note that if at least one target task exists at any given time, these target tasks can share each other's cloud server resources. For example, if there are target task A, target task B, and target task C at the current time, and target task A finds its cloud server resources insufficient just before its task ends, it can use the cloud server resources of target task B or target task C. Similarly, target task B or target task C can also use the cloud server resources of target task A. By sharing resources among target tasks, there's no need to configure redundant resources for each target task individually, thus achieving efficient resource utilization.
[0066] In this embodiment, redundant resources can also be configured for each task. If there are many target tasks at a given time, there may be a situation where the cloud server resources for each target task are insufficient. For example, at the current time, the cloud server resources for target task A are insufficient, and the cloud server resources for other tasks at the current time are also insufficient for target task A. To prevent a large number of target tasks at a given time from requiring a large amount of cloud server resources, redundant resources can be obtained for multiple target tasks at that time, and these redundant resources can be used as shared resources for multiple target tasks.
[0067] In an optional embodiment, after determining the resource requirements of the target task, the method further includes: determining whether the number of target tasks at the current time meets the preset redundancy resource acquisition conditions; if so, initiating a redundancy resource acquisition request to the cloud server provider.
[0068] The preset conditions for acquiring redundant resources can be set in advance by relevant technical personnel. For example, the number of target tasks can be no less than 5, or the resource requirement of the tasks can be no less than 50 cloud servers. Redundant resources can be cloud server resources to be acquired, determined based on the target tasks and / or the resource requirements of the target tasks at the current time.
[0069] Optionally, the required amount of redundant resources can be determined based on the number of target tasks at the current time. For example, if the number of target tasks at the current time meets the preset conditions for acquiring redundant resources, then if there are 8 target tasks at the current time, the required amount of redundant resources can be 1 cloud server; if there are 15 target tasks at the current time, the required amount of redundant resources can be 2 cloud servers; and if there are 20 target tasks at the current time, the required amount of redundant resources can be 3 cloud servers. The relationship between the required amount of redundant resources and the number of target tasks at the current time can be preset in advance by relevant technical personnel, and this embodiment does not impose any restrictions on this.
[0070] Optionally, the required amount of redundant resources can be determined based on the quantity of task resources required at the current time. For example, if the number of target tasks at the current time meets the preset conditions for acquiring redundant resources, and the task resource requirement at the current time is 40 cloud servers, then the required amount of redundant resources can be 1 cloud server; if the task resource requirement at the current time is 50 cloud servers, then the required amount of redundant resources can be 2 cloud servers; and if the task resource requirement at the current time is 60 cloud servers, then the required amount of redundant resources can be 3 cloud servers. The relationship between the required amount of redundant resources and the task resource requirement at the current time can be preset in advance by relevant technical personnel, and this embodiment does not impose any restrictions on this.
[0071] For example, if the number of target tasks at the current time is 6, and the preset condition for obtaining redundant resources is that the number of target tasks is not less than 5, it can be determined that the number of target tasks at the current time meets the preset condition for obtaining redundant resources. Then, a request for obtaining redundant resources can be initiated from the cloud server provider. For example, it can be to obtain 1 cloud server from the cloud server provider as redundant resources at the current time.
[0072] This optional embodiment determines whether the number of target tasks at the current time meets the preset redundancy resource acquisition conditions; and based on the determination result, decides whether to initiate a redundancy resource acquisition request to the cloud server provider. The above solution, by acquiring redundant resources, enables resource redundancy for multiple target tasks simultaneously when there are many target tasks, without needing to perform resource redundancy for each target task individually, thus saving costs and improving resource utilization.
[0073] In one specific implementation, see 2B. Figure 2B This is a time-based diagram illustrating the resource requirements of candidate tasks. The preset criteria for determining a task's requirement are that the difference between the start time of any candidate task's requirement and the preset resource acquisition time period is no greater than the current time, and the end time of the candidate task's requirement is no less than the current time. The preset resource acquisition time period is 30 minutes. If the current time is time point 1, and the preset requirement determination cycle condition is met, such as... Figure 2B It is known that the start time of candidate task 1 is 8:30, and the end time is 10:30. The difference between the start time of candidate task 1 and the preset resource acquisition time period is 8:00, which is not greater than the current time of 8:00. Furthermore, the end time of candidate task 1, 10:30, is not less than the current time of 8:00. Therefore, candidate task 1 meets the preset requirement conditions. The start time of candidate task 2 is 9:30. The difference between the start time of candidate task 2 and the preset resource acquisition time period is 9:00, which is greater than the current time of 8:00. Therefore, candidate task 2 does not meet the preset requirement conditions. Therefore, the target task at time 1 is candidate task 1, and the target resource requirement is 10 cloud servers.
[0074] If the current time is time point 2, and the preset demand determination period condition is met, the difference between the start time of candidate task 1 and the preset resource acquisition time period is 8:00, which is not greater than the current time of 9:00, and the end time of candidate task 1 is 10:30, which is not less than the current time of 9:00. Therefore, candidate task 1 meets the preset demand task judgment condition. Similarly, the difference between the start time of candidate demand 2 and the preset resource acquisition time period is 9:00, which is not greater than the current time of 9:00, and the end time of candidate task 2 is 11:30, which is not less than the current time of 9:00. Therefore, candidate task 2 meets the preset demand task judgment condition. Thus, the target tasks at time point 2 are candidate task 1 and candidate task 2, and the target resource requirement is 30 cloud servers.
[0075] If the current time is time point 3, and the preset demand determination period condition is met, the difference between the start time of candidate task 1 and the preset resource acquisition period is 8:00, which is not greater than the current time 10:31, and the end time of candidate task 1 is 10:30, which is less than the current time 10:31. Therefore, candidate task 1 does not meet the preset demand task judgment condition. The difference between the start time of candidate demand 2 and the preset resource acquisition period is 9:00, which is not greater than the current time 10:31, and the end time of candidate task 2 is 11:30, which is not less than the current time 10:31. Therefore, candidate task 2 meets the preset demand task judgment condition. Thus, the target task at time point 3 is candidate task 2, and the target resource requirement is 20 cloud servers.
[0076] This embodiment achieves automated determination of target tasks by judging whether the required usage time of any candidate task meets the preset requirement conditions with the current time. By obtaining the task resource requirements and usage of the target task, the system dynamically determines the target resource requirements at each time point, saving manpower and time costs, reducing human resource investment, and improving the efficiency of target resource requirement determination. By determining the difference in requirements based on the task resource requirements and usage, and using this difference as the target resource requirement, the system accurately obtains the target resource requirement, thereby enabling accurate acquisition or return of target resources based on the target resource requirement.
[0077] Example 3
[0078] Figure 3 This is a schematic diagram of a target resource demand determination device provided in Embodiment 3 of this application. The target resource demand determination device provided in this embodiment is applicable to situations where the target resource demand at various time points is determined. This device can be implemented using software and / or hardware. Figure 3 As shown, the device specifically includes: a condition judgment module 301, a target task determination module 302, a task resource requirement determination module 303, and a target resource requirement determination module 304. Among them,
[0079] The condition judgment module 301 is used to determine whether the preset requirement usage time of any candidate task and the current time meet the preset requirement task judgment condition if the current time meets the preset requirement determination period condition.
[0080] The target task determination module 302 is used to determine the candidate task as at least one target task at the current time if the preset requirement usage time of any candidate task meets the preset requirement task judgment condition between the current time and the current time.
[0081] The task resource requirement determination module 303 is used to determine the task resource requirement of the target task based on a preset association relationship between the resource requirement and the target task.
[0082] The target resource requirement determination module 304 is used to obtain the task resource usage of the target task and determine the target resource requirement based on the task resource requirement and the task resource usage.
[0083] This application embodiment achieves automated determination of target tasks by judging whether the required usage time of any candidate task meets the preset requirement task judgment conditions with the current time. By obtaining the task resource requirements and usage of the target task, the target resource requirements at each time point are dynamically determined, saving manpower and time costs, reducing human resource investment, and improving the efficiency of determining target resource requirements.
[0084] Optionally, the target resource requirement determination module 304 includes:
[0085] The target resource requirement determination unit is used to determine the difference in requirement based on the task resource requirement and the task resource usage, and to determine the difference in requirement as the target resource requirement.
[0086] Optionally, the device may also include:
[0087] The target resource demand determination module is used to determine whether the target resource demand is greater than the preset resource demand after the target resource demand has been determined.
[0088] The target resource acquisition module is used to initiate a target resource acquisition request to the cloud server provider based on the target resource demand if the target resource demand exceeds the preset resource demand.
[0089] Optionally, the device may also include:
[0090] The target resource return module is used to return the target resource to the cloud server provider if the target resource demand is less than the preset resource demand.
[0091] Optionally, the condition judgment module 301 includes:
[0092] The condition judgment unit is used to determine whether the difference between the start time of the demand of any candidate task and the preset resource acquisition time period is not greater than the current time, and whether the end time of the demand of the candidate task is not less than the current time.
[0093] The condition determination unit is used to determine that if the difference between the start time of the demand of any candidate task and the preset resource acquisition time period is not greater than the current time, and the end time of the demand of the candidate task is not less than the current time, then the preset demand usage time of the candidate task satisfies the preset demand task judgment condition between the current time and the preset demand task.
[0094] Optionally, the device may also include:
[0095] The redundant resource acquisition condition judgment unit is used to determine whether the number of the target tasks at the current time meets the preset redundant resource acquisition conditions after determining the task resource requirements of the target task.
[0096] The redundant resource acquisition request initiation unit is used to initiate a redundant resource acquisition request to the cloud server provider if the number of target tasks at the current time meets the preset redundant resource acquisition conditions.
[0097] The aforementioned target resource requirement determination device can execute the target resource requirement determination method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing each target resource requirement determination method.
[0098] Example 4
[0099] Figure 4 This is a schematic diagram of the structure of a target resource demand determination device provided in Embodiment 4 of the present invention. Figure 4 A block diagram is shown of an exemplary electronic device 400 suitable for implementing embodiments of the present invention. Figure 4 The electronic device 400 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0100] like Figure 4 As shown, the electronic device 400 is presented in the form of a general-purpose computing device. The components of the electronic device 400 may include, but are not limited to: one or more processors or processing units 401, system memory 402, and bus 403 connecting different system components (including system memory 402 and processing unit 401).
[0101] Bus 403 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0102] Electronic device 400 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 400, including volatile and non-volatile media, removable and non-removable media.
[0103] System memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 404 and / or cache memory 405. Electronic device 400 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 406 may be used to read and write non-removable, non-volatile magnetic media (… Figure 4 Not shown; usually referred to as a "hard drive"). Although Figure 4 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 403 via one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0104] A program / utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402. Such program modules 407 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 407 typically perform the functions and / or methods described in the embodiments of the present invention.
[0105] Electronic device 400 can also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), and with one or more devices that enable a user to interact with the electronic device 400, and / or with any device that enables the electronic device 400 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 411. Furthermore, electronic device 400 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 412. As shown, network adapter 412 communicates with other modules of electronic device 400 via bus 403. It should be understood that, although... Figure 4 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0106] The processing unit 401 executes various functional applications and data processing by running programs stored in the system memory 402, such as implementing a method for determining target resource requirements provided in an embodiment of the present invention.
[0107] Example 5
[0108] Embodiment 5 of the present invention also provides a storage medium containing computer-executable instructions, on which a computer program is stored. When the program is executed by a processor, it implements the target resource requirement determination method provided in the embodiments of the present invention, including: if the current time meets a preset requirement determination period condition, then determining whether the preset requirement usage time of any candidate task and the current time meet a preset requirement task determination condition; if so, then determining the candidate task as at least one target task under the current time; determining the task resource requirement of the target task according to a preset association relationship between the resource requirement and the target task; obtaining the task resource usage of the target task, and determining the target resource requirement according to the task resource requirement and the task resource usage.
[0109] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0110] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0111] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0112] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0113] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.
Claims
1. A method of determining a target resource requirement amount, characterized by, The method comprises the following steps: If the current time meets the preset demand determination period condition, it is determined whether the preset demand use time of any candidate task meets the preset demand task judgment condition with the current time; If yes, the candidate task is determined as at least one target task at the current time; According to the preset association relationship between the resource demand quantity and the target task, the task resource demand quantity of the target task is determined; The task resource use quantity of the target task is obtained, and the target resource demand quantity is determined according to the task resource demand quantity and the task resource use quantity, wherein the target task is divided into an unexecuted task at the current time and an executing task, the task resource use quantity of the target task refers to the total resource use quantity of other target tasks at the current time except the unexecuted task, and the target resource is a cloud server resource; The determination of whether the preset demand use time of any candidate task meets the preset demand task judgment condition with the current time comprises the following steps: It is determined whether the difference between the demand start time of any candidate task and the preset resource acquisition time period is not greater than the current time, and whether the demand end time of the candidate task is not less than the current time; If yes, it is determined that the preset demand use time of the candidate task meets the preset demand task judgment condition with the current time.
2. The method of claim 1, wherein, The determination of the target resource demand quantity according to the task resource demand quantity and the task resource use quantity comprises the following steps: The demand quantity difference is determined according to the task resource demand quantity and the task resource use quantity, and the demand quantity difference is determined as the target resource demand quantity.
3. The method of claim 2, wherein, After the target resource demand quantity is determined, the following steps are further included: It is determined whether the target resource demand quantity is greater than the preset resource demand quantity; If yes, a target resource acquisition request is initiated to a cloud server provider according to the target resource demand quantity.
4. The method of claim 3, wherein, After it is determined whether the target resource demand quantity is greater than the preset resource demand quantity, the following steps are further included: If the target resource demand quantity is less than the preset resource demand quantity, the target resource is returned to the cloud server provider.
5. The method of claim 1, wherein, After the task resource demand quantity of the target task is determined, the following steps are further included: It is determined whether the number of the target tasks at the current time meets the preset redundant resource acquisition condition; If yes, a redundant resource acquisition request is initiated to a cloud server provider.
6. A target resource demand amount determination apparatus characterized by comprising: The method comprises the following steps: A condition judgment module is configured to determine whether the preset demand use time of any candidate task meets the preset demand task judgment condition with the current time if the current time meets the preset demand determination period condition; A target task determination module is configured to determine the candidate task as at least one target task at the current time if the preset demand use time of any candidate task meets the preset demand task judgment condition with the current time; A task resource demand quantity determination module is configured to determine the task resource demand quantity of the target task according to the preset association relationship between the resource demand quantity and the target task. The target resource demand quantity determination module is configured to acquire a task resource usage quantity of the target task, and determine a target resource demand quantity according to the task resource demand quantity and the task resource usage quantity, wherein the target task is divided into an unexecuted task at a current time and an executing task, the task resource usage quantity of the target task refers to a total resource usage quantity of other target tasks except the unexecuted task at the current time, and the target resource is a cloud server resource. The condition determination module comprises: A condition determination unit is configured to determine whether a difference between a demand start time of any candidate task and a preset resource acquisition time period is not greater than the current time, and whether a demand end time of the candidate task is not less than the current time. A condition determination unit is configured to determine whether a difference between a demand start time of any candidate task and a preset resource acquisition time period is not greater than the current time, and whether a demand end time of the candidate task is not less than the current time.
7. The apparatus of claim 6, wherein, The target resource demand quantity determination module comprises: A target resource demand quantity determination unit is configured to determine a demand quantity difference according to the task resource demand quantity and the task resource usage quantity, and determine the demand quantity difference as the target resource demand quantity.
8. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the target resource demand quantity determination method in any one of claims 1-5.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the target resource demand quantity determination method in any one of claims 1-5.
Citation Information
Patent Citations
Transcoding resource scheduling method, electronic equipment and computer readable storage medium
CN111031350A
Load balancing method and device of server, server and storage medium
CN113254208A