Computing resource scheduling method and device, storage medium and electronic equipment
By obtaining the current and historical idle computing resources of the service equipment and determining the resource scheduling and configuration, the problem of low resource utilization in cluster technology is solved, and efficient and reasonable allocation of resources is achieved.
Patent Information
- Application Number
- CN202310997477.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-09
- Publication Date
- 2025-02-18
AI Technical Summary
The existing cluster technology has the problem of low resource utilization in resource scheduling, especially the unreasonable resource allocation between online and offline tasks, resulting in some nodes being overloaded while other nodes being idle.
By obtaining the current idle computing resources and historical idle computing resources of the service device, the resource scheduling configuration amount is determined, and the service device is scheduled and allocated based on this configuration amount to ensure the reasonable allocation and efficient utilization of resources.
It is achieved that the amount of idle computing resources can be guaranteed to achieve a high utilization rate at any point in time, ensure the rationality of resource allocation, and avoid node overload and resource waste.
Smart Images

Figure CN119473567A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a computing resource scheduling method, device, storage medium and electronic device. Background Art
[0002] With the development of computer technology, more and more service platforms provide growing information services through cluster technology. Cluster technology is a technology that uses a single system model to manage a group of independent computer devices connected through a high-speed network. When a client interacts with a cluster, the cluster is like an independent server.
[0003] The emergence of cluster technology can solve the problem of insufficient computing power and IO capacity of a single machine, improve service reliability, and reduce the operation and maintenance cost of the overall solution. In addition, load balancing can be achieved by distributing workloads to different nodes in the cluster. In this way, it can ensure that each node can fully utilize its resources and avoid some nodes being overloaded while other nodes are idle.
[0004] Usually, when a cluster is running, online tasks will occupy some of the cluster's hardware resources. In addition to the hardware resources occupied by online tasks, the cluster will also have idle hardware resources. Without affecting online tasks, the idle hardware resources can be used by offline tasks to improve the utilization of hardware resources. Summary of the invention
[0005] The embodiments of the present application provide a computing resource scheduling method, device, computer storage medium and electronic device, which can ensure the real-time accuracy of the idle resource scheduling configuration amount currently available for scheduling of the service device, and then dynamically perform task scheduling allocation through the real-time and accurate resource scheduling amount, so as to ensure that the idle computing resource amount can reach a high utilization rate at any time, thereby ensuring the rationality of resource allocation. The technical solution is as follows:
[0006] In a first aspect, an embodiment of the present application provides a computing resource scheduling method, the method comprising:
[0007] Obtain the current idle computing resource amount and historical idle computing resource amount corresponding to the service device;
[0008] Determining a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount;
[0009] Task scheduling is performed on the service device based on the resource scheduling configuration amount.
[0010] In a feasible implementation manner, determining the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount includes:
[0011] If the current idle computing resource amount is greater than the historical idle computing resource amount, determining a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount;
[0012] If the current idle computing resource amount is less than or equal to the historical idle computing resource amount, the current idle computing resource amount is determined as the resource scheduling configuration amount for the service device.
[0013] In a feasible implementation manner, determining the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount includes:
[0014] Determining a resource fluctuation state for the service device based on the historical idle computing resource amount and the current idle computing resource amount;
[0015] If the resource fluctuation state is the first fluctuation state, determining the resource scheduling configuration amount for the service device based on a reference idle computing resource amount, wherein the reference idle computing resource amount is one of the historical idle computing resource amount and the current idle computing resource amount;
[0016] If the resource fluctuation state is the second fluctuation state, determining an adjustment scale amount based on the historical idle computing resource amount and the current idle computing resource amount, and determining a resource scheduling configuration amount for the service device based on the adjustment scale amount and the historical idle computing resource amount;
[0017] The fluctuation amount corresponding to the first fluctuation state is smaller than the fluctuation amount corresponding to the second fluctuation state.
[0018] In a feasible implementation manner, determining the resource fluctuation state for the service device based on the historical idle computing resource amount and the current idle computing resource amount includes:
[0019] Determining a resource fluctuation quotient based on the current idle computing resource amount and the historical idle computing resource amount;
[0020] If the resource fluctuation quotient is less than a preset value, determining that the resource fluctuation state of the service device is a first fluctuation state;
[0021] If the resource fluctuation quotient is greater than or equal to a preset value, it is determined that the resource fluctuation state of the service device is a second fluctuation state.
[0022] In a feasible implementation manner, the determining the adjustment scale amount based on the historical idle computing resource amount and the current idle computing resource amount, and determining the resource scheduling configuration amount for the service device based on the adjustment scale amount and the historical idle computing resource amount include:
[0023] Obtaining an adjustment weight and a weighted adjustment number corresponding to the historical idle computing resource amount, and using the adjustment weight and the weighted adjustment number as an adjustment scale;
[0024] Perform at least one round of weighted adjustment processing on the historical idle computing resource amount according to the adjustment weight and the number of weighted adjustment times to obtain at least one first computing resource amount, where the first computing resource amount is less than or equal to the current idle computing resource amount;
[0025] In each round of weighted adjustment processing, the first computing resource amount is determined as the resource scheduling configuration amount for the service device.
[0026] In a feasible implementation manner, the obtaining the adjustment weight and the weighted adjustment times corresponding to the historical idle computing resource amount includes:
[0027] Obtaining a scale mapping relationship between a reference computing resource range and a reference adjustment scale quantity;
[0028] Determine, from the reference computing resource range, a target computing resource range into which the historical idle computing resource amount falls;
[0029] The adjustment scale quantity corresponding to the target computing resource range is queried based on the scale mapping relationship, where the adjustment scale quantity includes an adjustment weight and an adjustment weighted number of times.
[0030] In a feasible implementation manner, determining the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount includes:
[0031] At the target time indicated by the preset task scheduling update time, the current idle computing resource amount is calculated based on the historical idle computing resource amount to obtain the resource scheduling configuration amount for the service device.
[0032] In a feasible implementation manner, the performing task scheduling allocation on the service device based on the resource scheduling configuration amount includes:
[0033] Get offline tasks;
[0034] A target offline task for the service device is determined based on the resource scheduling configuration amount and the offline task, and the target offline task is scheduled to the service device.
[0035] In a second aspect, an embodiment of the present application provides a computing resource scheduling method, the method comprising:
[0036] Get the current amount of idle computing resources;
[0037] The current amount of idle computing resources is sent to a resource scheduling device, and the current amount of idle computing resources is used by the resource scheduling device to determine the resource scheduling configuration amount for the service device based on the historical amount of idle computing resources corresponding to the service device and the current amount of idle computing resources, and to perform task scheduling and allocation for the service device based on the resource scheduling configuration resource amount.
[0038] In a third aspect, an embodiment of the present application provides a computing resource scheduling device, the device comprising:
[0039] A resource acquisition module is used to obtain the current idle computing resource amount and the historical idle computing resource amount corresponding to the service device;
[0040] A resource determination module, configured to determine a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount;
[0041] A resource scheduling module is used to schedule and allocate tasks to the service device based on the resource scheduling configuration amount.
[0042] In a fourth aspect, an embodiment of the present application provides a computing resource scheduling device, the device comprising:
[0043] Resource acquisition module, used to obtain the current amount of idle computing resources;
[0044] A resource sending module is used to send the current idle computing resource amount to a resource scheduling device. The current idle computing resource amount is used by the resource scheduling device to determine the resource scheduling configuration amount for the service device based on the historical idle computing resource amount corresponding to the service device and the current idle computing resource amount, and to perform task scheduling and allocation for the service device based on the resource scheduling configuration resource amount.
[0045] In a fifth aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium has a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0046] In a sixth aspect, an embodiment of the present application provides an electronic device, which may include: a memory and a processor; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the memory and executing the above-mentioned method steps.
[0047] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0048] In an embodiment of the present application, a resource scheduling device obtains the current idle computing resource amount and the historical idle computing resource amount corresponding to a service device, determines the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount, and performs task scheduling and allocation for the service device based on the resource scheduling configuration amount. The resource scheduling device of an embodiment of the present application determines the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount corresponding to the service device, thereby ensuring the real-time accuracy of the idle resource scheduling configuration amount currently available for scheduling of the service device, and then dynamically performs task scheduling and allocation through the real-time and accurate resource scheduling amount, thereby ensuring that the idle computing resources can reach a high utilization rate at any time, thereby ensuring the rationality of resource allocation. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 It is a system architecture diagram of a computing resource scheduling method provided in an embodiment of the present application;
[0051] Figure 2 It is a flowchart of a computing resource scheduling method provided in an embodiment of the present application;
[0052] Figure 3 It is a flowchart of another computing resource scheduling method provided in an embodiment of the present application;
[0053] Figure 4 It is a flowchart of another computing resource scheduling method provided in an embodiment of the present application;
[0054] Figure 5 It is a structural diagram of a computing resource scheduling device provided in an embodiment of the present application;
[0055] Figure 6 It is a structural diagram of a computing resource scheduling device provided in an embodiment of the present application;
[0056] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0057] Figure 8It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, features, and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0059] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.
[0060] Usually, when a cluster is running, online tasks will occupy some of the cluster's hardware resources. In addition to the hardware resources occupied by online tasks, the cluster will also have idle hardware resources. Without affecting online tasks, the idle hardware resources can be used by offline tasks to improve the utilization of hardware resources.
[0061] In the related art, in the scheduling mechanism of hardware resources adopted by the cluster, the amount of hardware resources that can be called by offline tasks is a fixed value during the operation of the scheduling service, that is, no matter how much idle hardware resources the cluster currently has, the amount of hardware resources that can be called by offline tasks is always fixed. In the process of large-scale online cluster operation, the traffic of online services processed by the online cluster has peak and trough states. When the traffic is at the trough, for example, after 4 a.m., the user's access volume decreases, and a large number of hardware resources of the node are idle. At this time, the amount of idle hardware resources in the online cluster is relatively large. At this time, the amount of idle hardware resources is sufficient for offline tasks that are scheduled and allocated according to the fixed amount of hardware resources, and there are even spare hardware resources. When the traffic reaches the peak, the resource utilization rate of each node in the online cluster is at a high value. At this time, the amount of idle hardware resources in the online cluster is relatively small. At this time, the amount of idle hardware resources may not be enough to meet the offline tasks that are scheduled and allocated according to the fixed amount of hardware resources. Therefore, in the above resource scheduling mechanism, there is an unreasonable allocation problem in the amount of idle resources that can be called by offline tasks.
[0062] The present application is described in detail below with reference to specific embodiments.
[0063] See also Figure 1 , which is a system architecture diagram of a computing resource scheduling method provided in an embodiment of the present application.
[0064] like Figure 1 As shown, it includes resource scheduling device 110, service device 121, service device 122, service device 127, service device 128, etc. Generally speaking, the number of service devices is relatively large. Figure 1 The number of service devices shown is exemplary only.
[0065] The resource scheduling device 110 can be a management terminal for task scheduling in the service platform, and the service device is a task execution terminal in the cluster corresponding to the service platform. Both the resource scheduling device and the service device can be implemented by a server, which can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0066] The tasks scheduled by the resource scheduling device 110 may be tasks submitted by users in the pages provided by the service platform. The tasks scheduled by the resource scheduling device 110 may be online tasks or offline tasks. For example, a user opens a corresponding page through a browser or a client, and the user may submit his or her own computing tasks in the page. The computing tasks may be online tasks or offline tasks, and the resource scheduling task device 110 may schedule the computing tasks submitted by the user.
[0067] For example, after a user submits a computing task on a terminal device, the resource scheduling task device can determine the corresponding service device for the computing task based on the load balancing strategy, and send the computing task to the service device, so that the service device executes the computing task and returns the task result to the terminal device used by the user through the resource scheduling task device.
[0068] In an embodiment of the present application, a resource scheduling device obtains the current idle computing resource amount and the historical idle computing resource amount corresponding to a service device, determines the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount, and performs task scheduling and allocation for the service device based on the resource scheduling configuration amount. The resource scheduling device of an embodiment of the present application determines the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount corresponding to the service device, thereby ensuring the real-time accuracy of the idle resource scheduling configuration amount currently available for scheduling of the service device, and then dynamically performs task scheduling and allocation through the real-time and accurate resource scheduling amount, thereby ensuring that the idle computing resources can reach a high utilization rate at any time, thereby ensuring the rationality of resource allocation.
[0069] See also Figure 2 , is a flow chart of a computing resource scheduling method provided in an embodiment of the present application, the method can be Figure 1 The resource scheduling device 110 in the embodiment is used to execute. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:
[0070] S201, obtaining the current idle computing resource amount and the historical idle computing resource amount corresponding to the service device.
[0071] It is easy to understand that a service device refers to a computer device in a cluster that provides the same service. The service device can receive various target tasks that need to be processed, and the target tasks can be online tasks or offline tasks. For example, the target task can be a corresponding computing task submitted by a user in a page provided by the platform of the cluster. The resource scheduling device of the platform can schedule these computing tasks to the service device in the above cluster for processing according to the corresponding processing strategy.
[0072] The current amount of idle computing resources may refer to the amount of computing resources of the service device that are not occupied by online tasks in the current collection cycle. The historical amount of idle computing resources may refer to the amount of computing resources of the service device that are not occupied by online tasks in the previous collection cycle of the current collection cycle. The amount of computing resources may refer to the number of hardware resources of the device, which may include but is not limited to the number of cores of the Central Processing Unit (CPU), memory capacity, etc. The amount of computing resources includes at least the number of two types of hardware resources, which may include at least the number of CPU cores and memory capacity.
[0073] In some embodiments, the resource scheduling device may receive the current idle computing resource amount and the historical idle computing resource amount corresponding to the service device sent by the service device. In this scenario, the service device may actively send the current idle computing resource amount and the historical idle computing resource amount to the resource scheduling device. The service device may autonomously collect the idle computing resource amount and periodically send the collected idle computing resource amount to the resource scheduling device. For example, the service device may determine the amount of computing resources not occupied by online tasks, that is, the idle computing resource amount, at the beginning of each collection cycle, and send the idle computing resource amount determined in each collection cycle to the resource scheduling device. The idle computing resource amount determined in the current collection cycle may be referred to as the current idle computing resource amount, and the idle computing resource amount determined in the previous collection cycle of the current collection cycle may be referred to as the historical idle computing resource amount. In this way, the resource scheduling device may receive the current idle computing resource amount and the historical idle computing resource amount sent by the service device.
[0074] In some other embodiments, the resource scheduling device may send a resource quantity acquisition instruction to the service device, and receive the current idle computing resource quantity and the historical idle computing resource quantity sent by the service device based on the resource quantity acquisition instruction. The resource quantity acquisition instruction is used to instruct the service device to determine the current idle computing resource quantity and the historical idle computing resource quantity, and to instruct the service device to send the current idle computing resource quantity and the historical idle computing resource quantity to the resource scheduling device. In this scenario, the service device may passively send the current idle computing resource quantity and the historical idle computing resource quantity to the resource scheduling device according to the resource quantity acquisition instruction. The resource scheduling device may periodically send a resource quantity acquisition instruction to the service device, and each time the service device receives the resource quantity acquisition instruction, it needs to determine the current idle computing resource quantity and obtain the historical idle computing resource quantity determined after it received the resource quantity acquisition instruction last time, and then, for this resource quantity acquisition instruction, send the current idle computing resource quantity and the historical idle computing resource quantity to the resource scheduling device.
[0075] S202: Determine a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount.
[0076] It is easy to understand that the resource scheduling configuration amount can be the resource amount basis for the resource scheduling device to allocate offline tasks to the service device. The resource scheduling configuration amount can be understood as the currently idle computing resource amount of the evaluated service device. Because when the difference between the historical idle computing resource amount and the current idle computing resource amount suddenly increases, if the task scheduling is performed according to the current actual idle computing resource amount of the service device, it is avoided that a large number of offline tasks that are suddenly scheduled affect the online tasks being executed. Therefore, the evaluated idle computing resource amount can be determined according to the changing idle computing resource amount for subsequent task scheduling and allocation. In an embodiment of the present application, the resource scheduling configuration amount may be less than or equal to the current idle computing resource amount.
[0077] Since the amount of data of online tasks processed by the service devices in the cluster is different in different time periods, and the amount of computing resources consumed by the service devices to process online tasks is also different, the amount of idle computing resources of the service devices in different time periods is also different. That is, the difference between the historical idle computing resources and the current idle computing resources in the embodiment of the present application may be at a larger value in some time periods and at a smaller value in some time periods. For example, if the amount of data of online tasks suddenly changes from more to less in a certain time period, then the current idle computing resources may be much larger than the historical idle computing resources; or, if the amount of data of online tasks suddenly changes from less to more in a certain time period, then the historical idle computing resources may be much larger than the current idle resources. Therefore, the idle computing resources of the service device are elastically changing, and therefore, the resource scheduling configuration amount for the service device can be determined according to the elastically changing idle computing resources. Thus, the offline tasks are allocated to the service device according to the resource scheduling configuration amount, so as to achieve the effect of maintaining a high resource utilization rate of the computing resources when the idle computing resources change, thereby reducing the overall hardware cost of the cluster.
[0078] In some embodiments, after obtaining the historical idle computing resource amount and the current idle computing resource amount, the resource scheduling device can determine the size relationship between the historical idle computing resource amount and the current idle computing resource amount. Since the computing resource amount includes at least the quantity of two types of hardware resources, the size relationship between the historical idle computing resource amount and the current idle computing resource amount can be determined by comparing the sum of the quantities of all types of hardware resources. Alternatively, since for a service device, the quantity of different types of hardware resources it contains has a certain ratio, the quantity of one hardware resource can be selected for comparison, such as the number of CPU cores can be compared to determine the size relationship between the historical idle computing resource amount and the current idle computing resource amount.
[0079] Further, if the current idle computing resource amount is less than or equal to the historical idle computing resource amount, then the current idle computing resource amount may be determined as the resource scheduling configuration amount for the service device.
[0080] If the current idle computing resource amount is greater than the historical idle computing resource amount, then the resource scheduling configuration amount for the service device can be determined based on the current idle computing resource amount and the historical idle computing resource amount. Specifically, the resource amount difference between the current idle computing resource amount and the historical idle computing resource amount can be determined. When the resource amount difference exceeds the preset multiple of the historical idle computing resource amount, it can be gradually increased on the basis of the historical idle computing resource amount to obtain at least one reference computing resource amount with a gradually increasing value, and each reference computing resource amount is determined as the resource scheduling configuration amount for the service device. In this way, when there is a large span between the current idle computing resource amount and the historical idle computing resource amount, the service device is task scheduled through the resource scheduling configuration amount with a relatively smooth numerical change, so as to avoid suddenly scheduling a large number of offline tasks to the service device, so as to impact the online tasks of the service device. When the resource amount difference does not exceed the preset multiple of the historical idle computing resource amount, the current idle computing resource amount can be used as the resource scheduling configuration amount for the service device, or the historical idle computing resource amount can be used as the resource scheduling configuration amount for the service device.
[0081] S203: Perform task scheduling and allocation on the service device based on the resource scheduling configuration amount.
[0082] In some embodiments, the resource scheduling device may obtain offline tasks, determine target offline tasks for the service device according to the resource scheduling configuration amount and the offline tasks, and schedule the target offline tasks to the service device so that the service device can execute the target offline tasks.
[0083] In an embodiment of the present application, a resource scheduling device obtains the current idle computing resource amount and the historical idle computing resource amount corresponding to a service device, determines the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount, and performs task scheduling and allocation for the service device based on the resource scheduling configuration amount. The resource scheduling device of an embodiment of the present application determines the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount corresponding to the service device, thereby ensuring the real-time accuracy of the idle resource scheduling configuration amount currently available for scheduling of the service device, and then dynamically performs task scheduling and allocation through the real-time and accurate resource scheduling amount, thereby ensuring that the idle computing resources can reach a high utilization rate at any time, thereby ensuring the rationality of resource allocation.
[0084] See also Figure 3, is a flow chart of a computing resource scheduling method provided in an embodiment of the present application, the method can be Figure 1 The resource scheduling device 110 in the embodiment is used to execute. Figure 3 As shown, the method of the embodiment of the present application may include the following steps:
[0085] S301, obtaining the current idle computing resource amount and the historical idle computing resource amount corresponding to the service device.
[0086] Specifically, see Figure 2 The description of S201 in the illustrated embodiment will not be repeated here.
[0087] S302: If the current idle computing resource amount is less than or equal to the historical idle computing resource amount, the current idle computing resource amount is determined as the resource scheduling configuration amount for the service device.
[0088] In some embodiments, since the resource scheduling device can continuously obtain the current idle computing resource amount and the historical idle computing resource amount corresponding to the service device, the size relationship between the latest current idle computing resource amount and the historical idle computing resource amount can be determined at the target time indicated by the preset task scheduling update time. If the current idle computing resource amount is less than or equal to the historical idle computing resource amount, then the current idle computing resource amount can be determined as the resource scheduling configuration amount for the service device.
[0089] The preset task scheduling update time may refer to a time set for the resource scheduling device to update the task scheduling of the service device. Optionally, the preset task scheduling update time may be a time updated every 30 minutes, or a time updated every 40 minutes or a time updated every 60 minutes.
[0090] S303: If the current idle computing resource amount is greater than the historical idle computing resource amount, determine the resource fluctuation state for the service device based on the historical idle computing resource amount and the current idle computing resource amount.
[0091] In some embodiments, since the resource scheduling device can continuously obtain the current idle computing resource amount and the historical idle computing resource amount corresponding to the service device, the size relationship between the latest current idle computing resource amount and the historical idle computing resource amount can be determined at the target time indicated by the preset task scheduling update time. If the current idle computing resource amount is greater than the historical idle computing resource amount, then perform an operation based on the historical idle computing resource amount and the current idle computing resource amount to determine the resource fluctuation state for the service device. The implementation method of this operation can be: determine the resource fluctuation quotient value based on the current idle computing resource amount and the historical idle computing resource amount; if the resource fluctuation quotient value is less than the preset value, determine that the resource fluctuation state of the service device is the first fluctuation state; if the resource fluctuation quotient value is greater than or equal to the preset value, determine that the resource fluctuation state of the service device is the second fluctuation state.
[0092] Determining the resource fluctuation quotient based on the current idle computing resource amount and the historical idle computing resource amount can be understood as follows: since both the current idle computing resource amount and the historical idle computing resource amount include at least the number of two types of hardware resources, a first quotient of the number of CPU cores in the current idle computing resource amount and the number of CPU cores in the historical idle computing resource amount can be calculated, and the first quotient can be determined as the resource fluctuation quotient. Alternatively, a second quotient of the capacity of the memory in the current idle computing resource amount and the capacity of the memory in the historical idle computing resource amount can be calculated, and the second quotient can be determined as the resource fluctuation quotient. Alternatively, the above-mentioned first quotient and the above-mentioned second quotient can be calculated, and the larger value of the first quotient and the second quotient can be used as the resource fluctuation quotient.
[0093] Optionally, the preset value can be set to 3.
[0094] The first fluctuation state can be understood as a gently increasing fluctuation state, and the second fluctuation state can be understood as a steeply increasing fluctuation state.
[0095] If the resource fluctuation quotient is less than the preset value, it means that the span between the current idle computing resources and the historical idle computing resources is not so large, and it is a gently increasing fluctuation state, then the resource fluctuation state of the service device can be determined as the first fluctuation state. If the resource fluctuation quotient is greater than or equal to the preset value, it means that the span between the current idle computing resources and the historical idle computing resources is large, and it is a steeply increasing fluctuation state, then the resource fluctuation state of the service device can be determined as the second fluctuation state.
[0096] S304: If the resource fluctuation state is the first fluctuation state, determine a resource scheduling configuration amount for the service device based on a reference idle computing resource amount.
[0097] It is easy to understand that the reference to the idle computing resource amount refers to any one of the current idle computing resource amount and the historical idle computing resource amount.
[0098] In some embodiments, if the resource fluctuation state is the first fluctuation state, the current idle computing resource amount can be determined as the resource scheduling configuration amount for the service device, so that more offline tasks can be scheduled to the service device at this time, so that the current idle computing resource amount of the service device is better utilized. Alternatively, if the resource fluctuation state is the first fluctuation state, the historical idle computing resource amount can be determined as the resource scheduling configuration amount for the service device, so that the problem of impact on the online tasks of the service device when more offline tasks are temporarily scheduled to the service device can be avoided.
[0099] S305: If the resource fluctuation state is the second fluctuation state, determine an adjustment scale based on the historical idle computing resource amount and the current idle computing resource amount, and determine a resource scheduling configuration amount for the service device based on the adjustment scale and the historical idle computing resource amount.
[0100] It is easy to understand that adjusting the scale quantity may include adjusting the weight and adjusting the weighted times.
[0101] Determining an adjustment scale amount based on the historical idle computing resource amount and the current idle computing resource amount, and determining a resource scheduling configuration amount for a service device based on the adjustment scale amount and the historical idle computing resource amount can be understood as: obtaining an adjustment weight and an adjustment weighted number of times corresponding to the historical idle computing resource amount, using the adjustment weight and the adjustment weighted number of times as the adjustment scale amount, performing at least one round of weighted adjustment processing on the historical idle computing resource amount according to the adjustment weight and the adjustment weighted number of times, obtaining at least one first computing resource amount, the first computing resource amount being less than or equal to the current idle computing resource amount, and determining the first computing resource amount as the resource scheduling configuration amount for the service device in each round of weighted adjustment processing.
[0102] Specifically, the adjustment weight and the number of adjustment weights corresponding to the historical idle computing resource amount are obtained. One implementation of this operation may be: obtaining a scale mapping relationship between a reference computing resource range and a reference adjustment scale amount, determining a target computing resource range into which the historical idle computing resource amount falls from the reference computing resource range, querying the adjustment scale amount corresponding to the target computing resource range based on the scale mapping relationship, and the adjustment scale amount includes an adjustment weight and an adjustment weight number. In this implementation process, the scale mapping relationship between different reference computing resource ranges and different reference adjustment scale amounts may be preconfigured. Each reference computing resource range may include a number range of CPU cores and a capacity range of memory. Each reference adjustment scale amount may include an adjustment weight and an adjustment weight number. The target computing resource range into which the historical idle computing resource amount falls may be determined based on the number of CPU cores and the capacity of memory in the historical idle computing resource amount. The adjustment scale amount corresponding to the target computing resource range is queried based on the scale mapping relationship, and the adjustment weight and the number of adjustment weights included in the adjustment scale amount are used as the adjustment weight and the number of adjustment weights corresponding to the historical idle computing resource amount.
[0103] Another implementation of obtaining the first adjustment weight and the weighted number of adjustments corresponding to the historical idle computing resource amount may be: inputting the historical idle computing resource amount and the current idle computing resource amount into the adjustment parameter detection model to obtain the first adjustment weight and the weighted number of adjustments. The adjustment parameter detection model may be obtained by training a neural network model using multiple groups of sample data and labels corresponding to each group of sample data. Each group of sample data may include historical idle computing resource samples and current idle computing resource samples. The labels corresponding to each group of sample data may be the sample adjustment weights and the sample adjustment weighted number of times corresponding to the historical idle computing resource samples in each group of sample data.
[0104] Specifically, at least one round of weighted adjustment processing is performed on the historical idle computing resource amount according to the adjustment weight and the number of weighted adjustment times to obtain at least one first computing resource amount, the first computing resource amount is less than or equal to the current idle computing resource amount, and in each round of weighted adjustment processing, the first computing resource amount is determined as the resource scheduling configuration amount for the service device. It can be understood that a round of weighted calculation is performed on the historical idle computing resource amount according to the adjustment weight to obtain the first computing resource amount; when the moment corresponding to the specified time arrives, another round of weighted calculation is performed on the first computing resource amount according to the adjustment weight, and the current round of weighted calculation is adopted. The first computing resource amount is updated with the weighted calculation result to obtain the updated first computing resource amount; further, when another moment corresponding to the specified time arrives, another round of weighted calculation is performed on the updated first computing resource amount according to the adjustment weight, and the first computing resource amount is updated again with the weighted calculation result of this round to obtain the updated first computing resource amount, until the number of rounds of weighted calculation reaches the adjusted weighted number of times, the weighted calculation of the first computing resource amount is stopped, and after each round of weighted calculation mentioned above, the first computing resource amount can be determined as the resource scheduling configuration amount for the service device.
[0105] According to the adjustment weight, a round of weighted calculation is performed on the historical idle computing resource amount to obtain the first computing resource amount, which can be understood as performing a round of weighted calculation on the number of CPU cores and the capacity of memory in the historical idle computing resource amount according to the adjustment weight, respectively, to obtain the first number of CPU cores and the first capacity of memory, and taking the first number of CPU cores and the first capacity of memory as the first computing resource amount. Further, another round of weighted calculation can be performed on the first computing resource amount according to the adjustment weight, and the first computing resource amount is updated using the weighted calculation result of this round to obtain the updated first computing resource amount, which can be understood as performing another round of weighted calculation on the first number of CPU cores and the first capacity of memory in the first computing resource amount according to the adjustment weight, respectively, to obtain the second number of CPU cores and the second capacity of memory, and using the second number of CPU cores and the second capacity of memory to update the first number of CPU cores and the first capacity of memory in the first computing resource amount to obtain the updated first computing resource amount.
[0106] For example: the number of CPU cores in the historical idle computing resources is 10, and the number of CPU cores in the current idle computing resources is 50. At this time, the span between the historical idle computing resources and the current idle computing resources is too large. The adjustment weight corresponding to the historical idle computing resources is 2, and the number of weighted adjustments is 2. The product of 10 and 2 can be calculated as 20. The first round of weighted calculation obtains that the number of CPU cores in the first computing resources is 20. After 5 minutes, the product of 20 and 2 can be calculated as 40. The second round of weighted calculation obtains that the number of CPU cores in the first computing resources is 40. Therefore, 20 and 40 can be used as resource scheduling configuration amounts for service devices respectively.
[0107] In the embodiment of the present application, when there is a large span between the current idle computing resource amount and the historical idle computing resource amount, the historical idle computing resource amount can be adjusted by adjusting the scale amount, that is, on the basis of the historical idle computing resource amount, the value of the resource scheduling configuration amount is gradually increased, so that the resource scheduling device can schedule tasks for the service device according to the smoothly increased resource scheduling configuration amount, so as to avoid the resource scheduling device suddenly scheduling a large number of offline tasks to the service device, resulting in resource competition with online tasks and causing conflicts between the resources of offline tasks and the resources of online tasks, thereby affecting the execution efficiency of online tasks on the service device.
[0108] S307, obtaining offline tasks.
[0109] In some embodiments, the resource scheduling device may receive an offline task submitted by a user in a page provided by the service platform, and the offline task may be a computing task.
[0110] S308: Determine a target offline task for the service device based on the resource scheduling configuration amount and the offline task, and schedule the target offline task to the service device.
[0111] In some embodiments, the resource scheduling device may determine a target offline task that matches the service device according to the resource scheduling configuration amount in the offline task, and then schedule the target offline task to the service device.
[0112] In the embodiment of the present application, the current idle computing resource amount and the historical idle computing resource amount corresponding to the service device are first obtained. When the current idle computing resource amount is less than or equal to the historical idle computing resource amount, the current idle computing resource amount can be determined as the resource scheduling configuration amount for the service device. When the current idle computing resource amount is greater than the historical idle computing resource amount, the resource scheduling configuration amount for the service device can be determined according to the resource fluctuation state of the service device. Specifically, when the resource fluctuation state is a gentle fluctuation state, any one of the historical idle computing resource amount and the current idle computing resource amount can be used as the resource scheduling configuration amount. When the resource fluctuation state is a steep fluctuation state, the historical idle computing resource amount is gradually weighted and adjusted to gradually increase the value of the resource scheduling configuration amount, so that the resource scheduling device can schedule tasks for the service device according to the smoothly increased resource scheduling configuration amount, avoiding the problem of conflict between the resources of the offline tasks and the resources of the online tasks caused by resource competition with the online tasks when a large number of offline tasks are scheduled to the service device according to the suddenly increased idle computing resource amount of the service device, which affects the execution efficiency of the online tasks of the service device. Therefore, the embodiments of the present application not only ensure that the idle computing resources can reach a high utilization rate at any time, thereby ensuring the rationality of resource allocation, but also ensure that the execution efficiency of the online tasks of the service device is not affected.
[0113] See also Figure 4 , is a flow chart of a computing resource scheduling method provided in an embodiment of the present application, the method can be Figure 1 Any service device in the Figure 4 As shown, the method of the embodiment of the present application may include the following steps:
[0114] S401, obtaining the current amount of idle computing resources.
[0115] It is easy to understand that the current idle computing resources may refer to the computing resources of the service device that are not occupied by online tasks during the current acquisition cycle. The current idle computing resources may be equal to the maximum computing resources available for online and offline tasks of the service device, minus the computing resources occupied by online tasks. The maximum computing resources may be the computing resources calculated according to the maximum computing resource utilization rate corresponding to the service device. For example, if the maximum computing resource utilization rate is 80%, the product of the total computing resources of the service device and 80% is the maximum computing resources.
[0116] The amount of computing resources may refer to the number of hardware resources of a device, which may include but is not limited to the number of cores of the central processing unit (CPU), memory capacity, etc. The amount of computing resources includes at least the number of two types of hardware resources, which may include at least the number of cores and memory capacity of the CPU. The current idle amount of computing resources may include the number of cores and memory capacity of the currently idle CPU. The maximum amount of computing resources may include the maximum number of cores of the CPU and the maximum capacity of the memory. The maximum number of CPU cores may be the product of the total number of CPU cores and the maximum computing resource utilization. The maximum capacity of the memory may be the product of the total capacity of the memory and the maximum computing resource utilization.
[0117] In some embodiments, the service device may determine the current amount of idle computing resources in each collection cycle. For example, the service device may determine the current amount of idle computing resources at the beginning of each collection cycle.
[0118] S402: Send the current amount of idle computing resources to a resource scheduling device.
[0119] In some embodiments, the server may actively send the current idle computing resource amount to the resource scheduling device. Specifically, the service device may periodically send the current idle computing resource amount to the resource scheduling device, and at the same time, the service device may also send the historical idle computing resource amount to the resource scheduling device. The historical idle computing resource amount may be the idle computing resource amount determined by the service device in the previous collection cycle.
[0120] In some other embodiments, the service device may passively send the current idle computing resource amount to the resource scheduling device according to the resource amount acquisition instruction sent by the resource scheduling device. Specifically, after receiving the resource amount acquisition instruction, the service device may send the current idle computing resource amount determined in the current collection cycle and the historical idle computing resource amount determined in the previous collection cycle to the resource scheduling device.
[0121] It should be noted that the current idle computing resource amount can be used by the resource scheduling device to determine the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount corresponding to the service device, and to perform task scheduling and allocation for the service device based on the resource scheduling configuration resource amount.
[0122] In an embodiment of the present application, the service device can obtain the current amount of idle computing resources and send the current amount of idle computing resources to the resource scheduling device, so that the resource scheduling device determines the resource scheduling configuration amount for the service device based on the historical amount of idle computing resources and the current amount of idle computing resources corresponding to the service device, thereby ensuring the real-time accuracy of the idle resource scheduling configuration amount currently available for scheduling by the service device, and then dynamically performing task scheduling and allocation through the real-time and accurate resource scheduling amount, thereby ensuring that the idle computing resources can reach a high utilization rate at any time, thereby ensuring the rationality of resource allocation.
[0123] See also Figure 5 , is a schematic diagram of the structure of a computing resource scheduling device provided in an embodiment of the present application. The computing resource scheduling device 500 can be implemented as all or part of the terminal through software, hardware, or a combination of both. The computing resource scheduling device 500 includes:
[0124] Resource acquisition module 510, used to obtain the current idle computing resource amount and the historical idle computing resource amount corresponding to the service device;
[0125] A resource determination module 520, configured to determine a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount;
[0126] The resource scheduling module 530 is used to schedule and allocate tasks to the service device based on the resource scheduling configuration amount.
[0127] Optionally, the resource determination module includes:
[0128] a first determining unit, configured to determine a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount if the current idle computing resource amount is greater than the historical idle computing resource amount;
[0129] The second determining unit is configured to determine the current idle computing resource amount as the resource scheduling configuration amount for the service device if the current idle computing resource amount is less than or equal to the historical idle computing resource amount.
[0130] Optionally, the first determining unit includes:
[0131] a state determination unit, configured to determine a resource fluctuation state for the service device based on the historical idle computing resource amount and the current idle computing resource amount;
[0132] a first computing unit, configured to determine a resource scheduling configuration amount for the service device based on a reference idle computing resource amount if the resource fluctuation state is a first fluctuation state, wherein the reference idle computing resource amount is one of the historical idle computing resource amount and the current idle computing resource amount;
[0133] a second computing unit, configured to determine an adjustment scale amount based on the historical idle computing resource amount and the current idle computing resource amount if the resource fluctuation state is a second fluctuation state, and determine a resource scheduling configuration amount for the service device based on the adjustment scale amount and the historical idle computing resource amount;
[0134] The fluctuation amount corresponding to the first fluctuation state is smaller than the fluctuation amount corresponding to the second fluctuation state.
[0135] Optionally, the state determination unit is specifically configured to:
[0136] Determining a resource fluctuation quotient based on the current idle computing resource amount and the historical idle computing resource amount;
[0137] If the resource fluctuation quotient is less than a preset value, determining that the resource fluctuation state of the service device is a first fluctuation state;
[0138] If the resource fluctuation quotient is greater than or equal to a preset value, it is determined that the resource fluctuation state of the service device is a second fluctuation state.
[0139] Optionally, the second computing unit includes:
[0140] A parameter determination unit, configured to obtain an adjustment weight and a weighted adjustment number corresponding to the historical idle computing resource amount, and use the adjustment weight and the weighted adjustment number as an adjustment scale;
[0141] a resource calculation unit, configured to perform at least one round of weighted adjustment processing on the historical idle computing resource amount according to the adjustment weight and the number of weighted adjustment times, to obtain at least one first computing resource amount, wherein the first computing resource amount is less than or equal to the current idle computing resource amount;
[0142] The resource replacement unit is used to determine the first computing resource amount as the resource scheduling configuration amount for the service device in each round of weighted adjustment processing.
[0143] Optionally, the parameter determination unit is specifically configured to:
[0144] Obtaining a scale mapping relationship between a reference computing resource range and a reference adjustment scale quantity;
[0145] Determine, from the reference computing resource range, a target computing resource range into which the historical idle computing resource amount falls;
[0146] The adjustment scale quantity corresponding to the target computing resource range is queried based on the scale mapping relationship, where the adjustment scale quantity includes an adjustment weight and an adjustment weighted number of times.
[0147] Optionally, the resource determination module is specifically configured to:
[0148] At the target time indicated by the preset task scheduling update time, the current idle computing resource amount is calculated based on the historical idle computing resource amount to obtain the resource scheduling configuration amount for the service device.
[0149] Optionally, the resource scheduling module is specifically used to:
[0150] Get offline tasks;
[0151] A target offline task for the service device is determined based on the resource scheduling configuration amount and the offline task, and the target offline task is scheduled to the service device.
[0152] See also Figure 6 , is a schematic diagram of the structure of a computing resource scheduling device provided in an embodiment of the present application. The computing resource scheduling device 600 can be implemented as all or part of the terminal through software, hardware, or a combination of both. The computing resource scheduling device 600 includes:
[0153] Resource acquisition module 610, used to obtain the current amount of idle computing resources;
[0154] The resource sending module 620 is used to send the current idle computing resource amount to the resource scheduling device, and the current idle computing resource amount is used by the resource scheduling device to determine the resource scheduling configuration amount for the service device based on the historical idle computing resource amount corresponding to the service device and the current idle computing resource amount, and to perform task scheduling and allocation for the service device based on the resource scheduling configuration resource amount.
[0155] Please refer to Figure 7 , Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device can be Figure 1 Please refer to the resource scheduling device in Figure 7 , which shows a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device in the embodiment of the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected via a bus 150.
[0156] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0157] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (e.g., a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system developed by Apple, including a system deeply developed based on the IOS system or other systems.
[0158] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0159] The input device 130 is used to receive input commands or data, and includes but is not limited to a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output commands or data, and includes but is not limited to a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 are touch screen displays.
[0160] The touch display screen can be designed as a full screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of the present application.
[0161] In addition, those skilled in the art will appreciate that the structure of the electronic device shown in the above drawings does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the electronic device also includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a Bluetooth module and other components, which will not be described in detail here.
[0162] exist Figure 7 In the electronic device shown, the processor 110 may be used to call the program of the computing resource scheduling method stored in the memory 120, and specifically perform the following operations:
[0163] Obtain the current idle computing resource amount and historical idle computing resource amount corresponding to the service device;
[0164] Determining a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount;
[0165] Task scheduling is performed on the service device based on the resource scheduling configuration amount.
[0166] In one embodiment, when the processor 110 determines the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount, the processor 110 specifically performs the following operations:
[0167] If the current idle computing resource amount is greater than the historical idle computing resource amount, determining a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount;
[0168] If the current idle computing resource amount is less than or equal to the historical idle computing resource amount, the current idle computing resource amount is determined as the resource scheduling configuration amount for the service device.
[0169] In one embodiment, when the processor 110 determines the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount, the processor 110 specifically performs the following operations:
[0170] Determining a resource fluctuation state for the service device based on the historical idle computing resource amount and the current idle computing resource amount;
[0171] If the resource fluctuation state is the first fluctuation state, determining the resource scheduling configuration amount for the service device based on a reference idle computing resource amount, wherein the reference idle computing resource amount is one of the historical idle computing resource amount and the current idle computing resource amount;
[0172] If the resource fluctuation state is the second fluctuation state, determining an adjustment scale amount based on the historical idle computing resource amount and the current idle computing resource amount, and determining a resource scheduling configuration amount for the service device based on the adjustment scale amount and the historical idle computing resource amount;
[0173] The fluctuation amount corresponding to the first fluctuation state is smaller than the fluctuation amount corresponding to the second fluctuation state.
[0174] In one embodiment, when the processor 110 determines the resource fluctuation state for the service device based on the historical idle computing resource amount and the current idle computing resource amount, the processor 110 specifically performs the following operations:
[0175] Determining a resource fluctuation quotient based on the current idle computing resource amount and the historical idle computing resource amount;
[0176] If the resource fluctuation quotient is less than a preset value, determining that the resource fluctuation state of the service device is a first fluctuation state;
[0177] If the resource fluctuation quotient is greater than or equal to a preset value, it is determined that the resource fluctuation state of the service device is a second fluctuation state.
[0178] In one embodiment, when the processor 110 performs the steps of determining the adjustment scale amount based on the historical idle computing resource amount and the current idle computing resource amount, and determining the resource scheduling configuration amount for the service device based on the adjustment scale amount and the historical idle computing resource amount, the processor 110 specifically performs the following operations:
[0179] Obtaining an adjustment weight and a weighted adjustment number corresponding to the historical idle computing resource amount, and using the adjustment weight and the weighted adjustment number as an adjustment scale;
[0180] Perform at least one round of weighted adjustment processing on the historical idle computing resource amount according to the adjustment weight and the number of weighted adjustment times to obtain at least one first computing resource amount, where the first computing resource amount is less than or equal to the current idle computing resource amount;
[0181] In each round of weighted adjustment processing, the first computing resource amount is determined as the resource scheduling configuration amount for the service device.
[0182] In one embodiment, when the processor 110 executes the step of obtaining the adjustment weight and the number of adjustment weights corresponding to the historical idle computing resource amount, the processor 110 specifically performs the following operations:
[0183] Obtaining a scale mapping relationship between a reference computing resource range and a reference adjustment scale quantity;
[0184] Determine, from the reference computing resource range, a target computing resource range into which the historical idle computing resource amount falls;
[0185] The adjustment scale quantity corresponding to the target computing resource range is queried based on the scale mapping relationship, where the adjustment scale quantity includes an adjustment weight and an adjustment weighted number of times.
[0186] In one embodiment, when the processor 110 determines the resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount, the processor 110 specifically performs the following operations:
[0187] At the target time indicated by the preset task scheduling update time, the current idle computing resource amount is calculated based on the historical idle computing resource amount to obtain the resource scheduling configuration amount for the service device.
[0188] In one embodiment, when the processor 110 performs the task scheduling and allocation for the service device based on the resource scheduling configuration amount, the processor 110 specifically performs the following operations:
[0189] Get offline tasks;
[0190] A target offline task for the service device is determined based on the resource scheduling configuration amount and the offline task, and the target offline task is scheduled to the service device.
[0191] Please refer to Figure 8 , Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device can be Figure 1 Please refer to the service equipment in Figure 8, which shows a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device in the embodiment of the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected via a bus 150.
[0192] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts in the entire terminal, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0193] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (e.g., a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system developed by Apple, including a system deeply developed based on the IOS system or other systems.
[0194] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0195] The input device 130 is used to receive input commands or data, and includes but is not limited to a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output commands or data, and includes but is not limited to a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 are touch screen displays.
[0196] The touch display screen can be designed as a full screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of the present application.
[0197] In addition, those skilled in the art will appreciate that the structure of the electronic device shown in the above drawings does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the electronic device also includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a Bluetooth module and other components, which will not be described in detail here.
[0198] exist Figure 8In the electronic device shown, the processor 110 may be used to call the program of the computing resource scheduling method stored in the memory 120, and specifically perform the following operations;
[0199] Get the current amount of idle computing resources;
[0200] The current amount of idle computing resources is sent to a resource scheduling device, and the current amount of idle computing resources is used by the resource scheduling device to determine the resource scheduling configuration amount for the service device based on the historical amount of idle computing resources corresponding to the service device and the current amount of idle computing resources, and to perform task scheduling and allocation for the service device based on the resource scheduling configuration resource amount.
[0201] An embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the computing resource scheduling method described in the above embodiments.
[0202] An embodiment of the present application further provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the computing resource scheduling method described in the above embodiments.
[0203] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0204] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A computing resource scheduling method, characterized in that: The method comprises: Obtain the current idle computing resource amount and historical idle computing resource amount corresponding to the service device; Determining a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount; Task scheduling is performed on the service device based on the resource scheduling configuration amount.
2. The method according to claim 1, characterized in that The determining, based on the historical idle computing resource amount and the current idle computing resource amount, a resource scheduling configuration amount for the service device includes: If the current idle computing resource amount is greater than the historical idle computing resource amount, determining a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount; If the current idle computing resource amount is less than or equal to the historical idle computing resource amount, the current idle computing resource amount is determined as the resource scheduling configuration amount for the service device.
3. The method according to claim 2, characterized in that The determining, based on the historical idle computing resource amount and the current idle computing resource amount, a resource scheduling configuration amount for the service device includes: Determining a resource fluctuation state for the service device based on the historical idle computing resource amount and the current idle computing resource amount; If the resource fluctuation state is the first fluctuation state, determining the resource scheduling configuration amount for the service device based on a reference idle computing resource amount, wherein the reference idle computing resource amount is one of the historical idle computing resource amount and the current idle computing resource amount; If the resource fluctuation state is the second fluctuation state, determining an adjustment scale amount based on the historical idle computing resource amount and the current idle computing resource amount, and determining a resource scheduling configuration amount for the service device based on the adjustment scale amount and the historical idle computing resource amount; The fluctuation amount corresponding to the first fluctuation state is smaller than the fluctuation amount corresponding to the second fluctuation state.
4. The method according to claim 3, characterized in that The determining, based on the historical idle computing resource amount and the current idle computing resource amount, a resource fluctuation state for the service device includes: Determining a resource fluctuation quotient based on the current idle computing resource amount and the historical idle computing resource amount; If the resource fluctuation quotient is less than a preset value, determining that the resource fluctuation state of the service device is a first fluctuation state; If the resource fluctuation quotient is greater than or equal to a preset value, it is determined that the resource fluctuation state of the service device is a second fluctuation state.
5. The method according to claim 3, characterized in that: The determining of the adjustment scale amount based on the historical idle computing resource amount and the current idle computing resource amount, and determining the resource scheduling configuration amount for the service device based on the adjustment scale amount and the historical idle computing resource amount, includes: Obtaining an adjustment weight and a weighted adjustment number corresponding to the historical idle computing resource amount, and using the adjustment weight and the weighted adjustment number as an adjustment scale; Perform at least one round of weighted adjustment processing on the historical idle computing resource amount according to the adjustment weight and the number of weighted adjustment times to obtain at least one first computing resource amount, where the first computing resource amount is less than or equal to the current idle computing resource amount; In each round of weighted adjustment processing, the first computing resource amount is determined as the resource scheduling configuration amount for the service device.
6. A computing resource scheduling method, characterized in that: The method comprises: Get the current amount of idle computing resources; The current amount of idle computing resources is sent to a resource scheduling device, and the current amount of idle computing resources is used by the resource scheduling device to determine the resource scheduling configuration amount for the service device based on the historical amount of idle computing resources corresponding to the service device and the current amount of idle computing resources, and to perform task scheduling and allocation for the service device based on the resource scheduling configuration resource amount.
7. A computing resource scheduling device, characterized in that: The device comprises: A resource acquisition module is used to obtain the current idle computing resource amount and the historical idle computing resource amount corresponding to the service device; A resource determination module, configured to determine a resource scheduling configuration amount for the service device based on the historical idle computing resource amount and the current idle computing resource amount; A resource scheduling module is used to schedule and allocate tasks to the service device based on the resource scheduling configuration amount.
8. A computing resource scheduling device, characterized in that: The device comprises: Resource acquisition module, used to obtain the current amount of idle computing resources; A resource sending module is used to send the current idle computing resource amount to a resource scheduling device. The current idle computing resource amount is used by the resource scheduling device to determine the resource scheduling configuration amount for the service device based on the historical idle computing resource amount corresponding to the service device and the current idle computing resource amount, and to perform task scheduling and allocation for the service device based on the resource scheduling configuration resource amount.
9. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 5 or 6.
10. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 5 or 6.
Citation Information
Cited By
Computing power cloud resource scheduling method and system based on adaptive learning
CN120336026A
A computing power cloud resource scheduling method and system based on adaptive learning
CN120336026B
Intelligent acceptance equipment health detection method and system in intelligent traffic scene
CN121365960A