Resource scheduling method, system, device and storage medium

By combining the macro scheduling of the central node and the real-time scheduling of the edge node, the problem that the resource scheduling solution in the serverless computing product cannot adapt to dynamic loads, and real-time and accuracy of resource scheduling are achieved.

CN115658319BActive Publication Date: 2025-08-26ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211408442.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2025-08-26
Estimated Expiration
2042-11-10

AI Technical Summary

Technical Problem

The resource scheduling scheme of existing serverless computing products cannot effectively adapt to dynamically changing service loads, and the issuance of central-side strategies is poor, resulting in unreasonable resource allocation.

Method used

The central node predicts the future resource requirements of edge nodes and performs cross-node migration, and combines the real-time resource usage of edge nodes to perform resource scheduling, and the edge nodes performs real-time scheduling based on the target resource amount.

Benefits of technology

It improves the real-time and accuracy of resource scheduling, reduces the number of instances migrating across machines, and ensures reasonable allocation of resources in future time periods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658319B_ABST
    Figure CN115658319B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a resource scheduling method, system, device and storage medium. The method is applicable to edge nodes in a network system; the network system includes at least one edge node and a central node for controlling the at least one edge node; an instance is deployed on the edge node, and the method includes the following steps: receiving resource scheduling and control information sent by the central node; collecting the current resource usage of the instance; determining the target resource amount required by the instance based on the current resource usage of the instance and the resource scheduling and control information; and scheduling resources for the instance according to the target resource amount. The resource scheduling solution provided by the embodiment of the present application can not only improve the real-time performance of resource scheduling, but also ensure the accuracy of resource scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a resource scheduling method, system, device, and storage medium. Background Art

[0002] Serverless computing, also known as Function-as-a-Service (FaaS), is a cloud computing model. Based on Platform as a Service (PaaS), serverless computing provides a microarchitecture where end users do not need to deploy, configure, or manage server services. The server services required to run the code are provided by the cloud platform.

[0003] Currently, the technical architecture of serverless computing products mostly adopts a solution that schedules resources based on elastic rules configured by users at the center. However, fixed rules cannot effectively adapt to dynamically changing service loads, and the policy issuance at the center is often time-sensitive. Summary of the Invention

[0004] In view of the above problems, the present application is proposed to provide a resource scheduling method, system, device and storage medium that solve the above problems or at least partially solve the above problems.

[0005] Therefore, in one embodiment of the present application, a resource scheduling method applied to a network system is provided, wherein the network system includes: at least one edge node and a central node for managing and controlling the at least one edge node;

[0006] The central node predicts whether the edge node will meet the instance operation requirements in the future based on the historical resource usage of the instance deployed on the edge node;

[0007] When the edge node does not meet the instance operation requirements, the central node performs cross-node migration for the instance deployed on the edge node;

[0008] The edge node determines the target resource amount required by the target instance according to the current resource usage of the target instance deployed on the local node; and performs resource scheduling for the target instance according to the target resource amount.

[0009] In yet another embodiment of the present application, a network system is provided, comprising: at least one edge node and a central node for managing and controlling the at least one edge node;

[0010] The central node and the edge node cooperate with each other to implement the above resource scheduling method.

[0011] In another embodiment of the present application, an electronic device is provided, wherein a network system includes at least one edge node and a central node for managing and controlling the at least one edge node; the electronic device is an edge node in the system;

[0012] Comprising: a memory and a processor, wherein:

[0013] The memory is used to store programs;

[0014] The processor is coupled to the memory and is configured to execute the program stored in the memory to implement:

[0015] Receiving resource scheduling and control information sent by the central node;

[0016] Collect the current resource usage of the target instance deployed on this node;

[0017] Determine the target resource amount required by the target instance based on the current resource usage of the target instance and the resource scheduling and control information;

[0018] Perform resource scheduling on the target instance according to the target resource amount.

[0019] In another embodiment of the present application, a computer-readable storage medium storing a computer program is provided, wherein the computer program, when executed by a computer, can implement:

[0020] Receive resource scheduling and control information sent by the central node;

[0021] Collect the current resource usage of the target instance deployed on this node;

[0022] Determine the target resource amount required by the target instance based on the current resource usage of the target instance and the resource scheduling and control information;

[0023] Perform resource scheduling on the target instance according to the target resource amount.

[0024] In the technical solution provided by the embodiment of the present application, the central node performs macro-scheduling of instance cross-node migration, which can increase the probability that each edge node can meet the operating requirements of the instance on it within the future target time period, and reduce the number of instances that need to be migrated across machines to obtain resource satisfaction within the future target time period. In this way, when the edge node performs real-time resource scheduling within the future target time period, the probability that resource scheduling can be completed based on the resources within the node will increase. It can be seen that the technical solution provided by the embodiment of the present application is performed by the central node for macro-scheduling and the edge node for real-time scheduling, which can improve the real-time and effectiveness of resource scheduling. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0026] Figure 1 A schematic diagram of a network system provided in one embodiment of the present application;

[0027] Figure 2 A schematic diagram of a resource scheduling method according to an embodiment of the present invention;

[0028] Figure 3 A schematic diagram of a network system provided in yet another embodiment of the present application;

[0029] Figure 4 This is a structural block diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0030] Currently, most resource scheduling solutions rely on a central end to make resource scheduling decisions, but this introduces significant latency. Specifically, after the edge end collects data, it needs to transmit it to the central end for consumption, which requires transmission time. The central end then transmits the resource scheduling decision to the edge end, which also requires transmission time. However, since the entire system is in a dynamic state, long latency may indicate that the resource scheduling decision is invalid. Scheduling resources based on invalid resource scheduling decisions will inevitably lead to irrational resource allocation.

[0031] In order to solve or partially solve the above technical problems, an embodiment of the present application provides a new resource scheduling method.

[0032] Specifically, the central node performs macro-scheduling of instance cross-node migration, which can increase the probability that each edge node can meet the operating requirements of the instance on it within the future target time period, and reduce the number of instances that need to be migrated across machines to obtain resource requirements within the future target time period. In this way, when the edge node performs real-time resource scheduling within the future target time period, the probability of completing resource scheduling based on the resources within the node will increase. It can be seen that the technical solution provided by the embodiment of the present application can improve the real-time performance and effectiveness of resource scheduling.

[0033] In addition, the edge node determines the target amount of resources required for the instance based on the current resource usage of the instance deployed on it and the resource scheduling and control information sent by the central node, and then performs resource scheduling for the instance. Among them, the resource scheduling decision made by the edge node can shorten the delay of resource scheduling and improve the real-time performance of resource scheduling; the resource scheduling decision made in combination with the resource scheduling and control information sent by the central node can ensure the accuracy of resource scheduling. It can be seen that the technical solution provided by the embodiment of the present application can not only improve the real-time performance of resource scheduling, but also ensure the accuracy of resource scheduling.

[0034] In order to enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below based on the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0035] In addition, some of the processes described in the specification, claims and the above-mentioned figures of this application include multiple operations that appear in a specific order. These operations may not be executed in the order in which they appear in this document or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this document are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit "first" and "second" to be different types.

[0036] Before introducing the resource scheduling method provided in the embodiment of the present application, the system architecture involved in the resource scheduling method provided in the embodiment of the present application is introduced. Figure 1 As shown, the network system includes: at least one edge node 10 and a central node 20 for managing and controlling the at least one edge node 10;

[0037] The central node 20 and the edge node 10 cooperate with each other to implement the resource scheduling method mentioned in the embodiment of the present application.

[0038] In one example, the edge node 10 is configured to:

[0039] Receive resource scheduling and control information sent by the central node 20;

[0040] Collect the current resource usage of the target instance deployed on this node;

[0041] Determine the target resource amount required by the target instance based on the current resource usage of the target instance and the resource scheduling and control information;

[0042] Perform resource scheduling on the target instance according to the target resource amount.

[0043] Each edge node in the system can be deployed with an instance. Each edge node 10 collects the current resource usage of the locally deployed instance and determines the target resource amount required by the instance based on the current resource usage of the locally deployed instance and the resource scheduling and control information sent by the central node 20.

[0044] In practical applications, the instances mentioned in this application may specifically include but are not limited to: ECS (Elastic Compute Service, cloud server) instances, function computing instances, and database instances.

[0045] In the technical solution provided by the embodiment of the present application, the edge node determines the target resource amount required for the instance based on the current resource usage of the instance deployed on it and the resource scheduling and control information sent by the central node, and then performs resource scheduling on the instance. Among them, the resource scheduling decision made by the edge node can shorten the delay of resource scheduling and improve the real-time performance of resource scheduling; the resource scheduling decision made in combination with the resource scheduling and control information sent by the central node can ensure the accuracy of resource scheduling. It can be seen that the technical solution provided by the embodiment of the present application can not only improve the real-time performance of resource scheduling, but also ensure the accuracy of resource scheduling.

[0046] In one feasible solution, the central node 20 is configured to:

[0047] Predicting whether the edge node will meet instance operation requirements in the future based on historical resource usage of the instance deployed on the edge node;

[0048] When it is predicted that the edge node will not meet the instance running requirements in the future, cross-node migration is performed for the instance deployed on the edge node.

[0049] That is, the instance deployed on the edge node is migrated to other edge nodes in the network system.

[0050] Specifically, based on the historical resource usage of at least one instance deployed on the edge node, it can be predicted whether the edge node meets the instance operation requirements of the at least one instance within a future target time period (for example, the next day).

[0051] Based on the historical resource usage of at least one instance deployed on the edge node, the total resource demand required by at least one instance deployed on the edge node in the future (specifically within a future target time period) can be predicted; the central node determines whether the edge node will meet the instance operation requirements in the future based on the total resource demand and the total resource amount of the edge node.

[0052] Specifically, based on the historical resource usage of at least one instance deployed on the edge node, the maximum resource demand of each instance in the at least one instance deployed on the edge node in the future target time period is predicted; the sum of the maximum resource demand of at least one instance in the future time period is taken as the total resource demand.

[0053] In one optional embodiment, if the total resource requirement is less than or equal to the total resource requirement of the edge node, then the edge node is determined to be able to meet the instance operation requirements within the future target time period; otherwise, it is determined to be unable to meet the requirements. Alternatively, if the total resource requirement is greater than the total resource requirement, and the difference between the total resource requirement and the total resource requirement is greater than a preset difference threshold, then the edge node is determined to be able to meet the instance operation requirements within the future target time period. The preset difference threshold can be determined based on the amount of resources occupied by other applications running on the edge node, in addition to the instance.

[0054] In the example application, the central node 20 can execute the above steps regularly to perform macro-scheduling to ensure that each edge node in the network system can meet the operating requirements of all instances on it as much as possible within the future target time period (for example: the next day), thereby reducing the number of instances that need to be migrated across machines to obtain resource satisfaction within the future target time period. In this way, within the future target time period, the edge node can complete the resource scheduling of each instance locally. The above macro-scheduling can be performed in the early morning of each day to reduce the impact on user use. Macro-scheduling can ensure the rationality of resource allocation from a global perspective.

[0055] Edge nodes perform real-time local scheduling based on the data collected in real time, which can effectively improve the real-time and effectiveness of instance resource scheduling.

[0056] The specific implementation of the edge node 10 and the central node 20 and the interaction process between them will be introduced in the following embodiments.

[0057] Figure 2 The flowchart of the resource scheduling method applied to a network system provided by an embodiment of the present application is shown. The network system includes: at least one edge node and a central node for managing and controlling the at least one edge node. Figure 2 As shown, the method includes:

[0058] 201. The central node predicts whether the edge node will meet instance operation requirements in the future based on historical resource usage of the instance deployed on the edge node.

[0059] 202. When the edge node does not meet the instance running requirements, the central node performs cross-node migration for the instance deployed on the edge node.

[0060] 203. The edge node determines a target resource amount required by the target instance according to the current resource usage of the target instance deployed on the local node; and performs resource scheduling for the target instance according to the target resource amount.

[0061] In 201 above, the central node predicts whether the edge node will meet the instance operation requirements within a future target time period based on the historical resource usage of the instance deployed on the edge node. The length of the future target time period can be set based on actual needs and is not specifically limited in this embodiment of the application. In one example, the future target time period can be the next day.

[0062] In the above 202, the central node may determine an instance to be migrated from the edge nodes; determine other edge nodes from at least one edge node that can receive the instance to be migrated; and migrate the instance to the other edge node. Specifically, an instance to be migrated may be randomly selected from the edge nodes; or an instance whose resource demand in the future target time period is greater than a preset resource demand threshold may be selected from the edge nodes as the instance to be migrated. In one example, the minimum idle resource amount of the other edge nodes in the future target time period is greater than or equal to the maximum resource demand of the instance to be migrated in the future target time period. The minimum idle resource amount of the other edge nodes in the future target time period is determined based on the total resource amount of the other edge nodes and the total resource demand required by at least one instance deployed on the other edge node in the future target time period, for example, the difference between the total resource amount of the other edge nodes and the total resource demand required by at least one instance deployed on the other edge node in the future target time period. The process of determining the total resource demand may include: predicting the maximum resource demand of each instance deployed on the at least one edge node in the future target time period based on the historical resource usage of the at least one instance deployed on the other edge node; and taking the sum of the maximum resource demand of each instance in the future time period as the total resource demand.

[0063] In the above 203, during the future target time period, the edge node determines the target resource amount required for the target instance during the future time period based on the current resource usage of the target instance deployed on this node; and performs resource scheduling for the target instance according to the target resource amount.

[0064] The duration of the future time period is shorter than the future target time period.

[0065] In a specific implementation, the currently allocated resource amount of the target instance can be determined. When the target resource amount is greater than the currently allocated resource amount, the incremental resource amount to be added to the target instance is determined based on the difference between the target resource amount and the currently allocated resource amount. Incremental resources are then allocated to the target instance from the idle resources in the edge node 10 based on the incremental resource amount. Alternatively, the incremental resource amount to be added to the instance can be directly used as the incremental resource amount.

[0066] In one example, when the target resource amount is less than or equal to the currently allocated resource amount, no processing is performed. In another example, when the target resource amount is less than or equal to the currently allocated resource amount, the ratio of the target resource amount to the currently allocated resource amount is calculated to see whether it is less than or equal to a first preset ratio, such as 50%. If the ratio of the target resource amount to the currently allocated resource amount is less than or equal to the first preset ratio, it indicates that too many resources are allocated to the target instance, resulting in resource waste. Therefore, the allocated resource amount of the target instance can be reduced to the target resource amount.

[0067] In the technical solution provided by the embodiment of the present application, the central node performs macro-scheduling of instance cross-node migration, which can increase the probability that each edge node can meet the operating requirements of the instance on it within the future target time period, and reduce the number of instances that need to be migrated across machines to obtain resource satisfaction within the future target time period. In this way, when the edge node performs real-time resource scheduling within the future target time period, the probability of completing resource scheduling based on the resources within the node will increase. It can be seen that the technical solution provided by the embodiment of the present application can improve the real-time performance and effectiveness of resource scheduling.

[0068] Optionally, the above method may further include:

[0069] 204. The central node sends resource scheduling and control information to the edge node.

[0070] In the above 203, “the edge node determines the target resource amount required by the target instance based on the current resource usage of the target instance deployed on the local node” may include:

[0071] 2030. The edge node determines the target resource amount required by the target instance according to the current resource usage of the target instance and the resource scheduling and control information.

[0072] In the above 204, the resource scheduling and control information may include: one or more of the historical resource usage statistics of the target instance, the resource scheduling policy configured by the user, the instance startup instruction information, and the instance shutdown instruction information.

[0073] The historical resource usage range of the target instance can be obtained by the central node based on the historical resource usage statistics of the target instance, for example, based on the historical resource usage statistics of the target instance in the most recent period (for example, the most recent month, three months, etc.). Specifically, the historical resource usage range of the target instance may include: the historical resource usage range of the target instance in each of the multiple time periods. In one example, a day can be divided into multiple time periods, and the duration of the multiple time periods can be consistent. The duration of the time period can be set according to actual needs, for example, 1 minute. The shorter the duration of the time period, the finer the granularity, and the greater the reference significance. Based on the historical resource usage of the target instance in the most recent period (for example, the most recent month, three months, etc.), the historical resource usage range of the target instance in each of the multiple time periods can be counted. Specifically, the multiple time periods include a first time period; based on the historical resource usage of the target instance in the most recent period, the multiple historical resource usages of the target instance in the first time period are determined; based on the distribution of the multiple historical resource usages of the target instance in the first time period, the historical resource usage range of the target instance in the first time period is determined, for example: the abnormal usage among the multiple historical resource usages of the target instance in the first time period can be determined first; the abnormal usage among the multiple historical resource usages of the target instance in the first time period is eliminated to obtain multiple historical resource usages after elimination; the minimum value among the multiple historical resource usages after elimination is determined as the lower limit of the historical resource usage range of the target instance in the first time period, and the maximum value among the multiple historical resource usages after elimination is determined as the upper limit of the historical resource usage range of the target instance in the first time period. The method for determining the abnormal usage can be designed according to actual needs, and the embodiments of the present application do not make specific limitations on this. Eliminating abnormal usage can improve the reference value of the historical resource usage range. The above historical resource usage range can be determined regularly by the above central node 20 and sent or pushed to the edge node 10 in a timely manner. For example, the central node 20 can determine the historical resource usage range of each target instance in the network system in each time period at 2 am every day.

[0074] The resource scheduling policy configured by the user is used to indicate how the edge node determines the target amount of resources required by the target instance based on the current resource usage of the target instance. That is, the edge node determines the target amount of resources required by the target instance based on the current resource usage of the target instance using the resource scheduling policy configured by the user. When the resource scheduling management and control information includes both the historical resource usage range of the target instance and the resource scheduling policy configured by the user, the resource scheduling policy configured by the user is used to indicate how the edge node determines the target amount of resources required by the target instance based on the current resource usage of the target instance and the historical resource usage range of the target instance. That is, the edge node determines the target amount of resources required by the target instance based on the current resource usage of the target instance and the historical resource usage range of the target instance using the resource scheduling policy configured by the user. The resource scheduling policy configured by the user may include: resource demand prediction model, resource scheduling rules, and the like. Typically, in daily operation and maintenance scenarios such as resource scheduling service version upgrades and grayscale releases of new resource scheduling service versions, adjustments to resource scheduling policies are involved. Therefore, the central node can send the user's newly configured resource scheduling policy to the edge node, such as the newly configured resource scheduling policy and the newly configured resource scheduling rules. In this way, after receiving the policy, the edge node will execute the resource scheduling process according to the user's newly configured resource scheduling policy.

[0075] In real-world applications, different instances have different user usage periods. For example, for an employee clock-in / clock-out service, its database instance is typically only used between 8:00 AM and 11:00 PM daily, and not between 11:00 PM and 8:00 AM the following day. Therefore, the database instance can be shut down after 11:00 PM and restarted before 8:00 AM the following day, effectively conserving resources. Therefore, the central node can predict the next startup or shutdown time of the target instance based on its historical usage. At the next startup time, the central node sends a target instance startup indication to the edge node where the target instance resides; at the next shutdown time, the central node sends a target instance shutdown indication to the edge node where the target instance resides. This approach saves resources by shutting down the target instance when it is no longer needed, and by starting it before it is needed, avoiding user waiting.

[0076] Specifically, the central node 20 can determine the daily user usage time period of the target instance based on the historical resource usage of the target instance; determine the sending time of the target instance startup indication information based on the lower limit of the target instance's daily user usage time period, for example: the difference between the lower limit and the first fixed time length is used as the sending time, and the first fixed time length can be determined based on the time required for the target instance to cold start; determine the sending time of the target instance shutdown indication information based on the upper limit of the target instance's daily user usage time period, for example: the sum of the upper limit and the second fixed time length is used as the sending time.

[0077] In the above 2030, the current resource usage of the target instance may include: one or more indicators of current resource utilization, query rate per second (qps), system throughput (TPS), input / output operations per second (IOPS), and cache hit ratio.

[0078] The edge node 10 may be provided with an indicator collector, which collects in real time the resource usage of each target instance deployed on the edge node 10. A target instance refers to any instance deployed on the edge node.

[0079] The target resource amount required by the target instance is determined based on the current resource usage of the target instance and the resource scheduling and control information.

[0080] In the technical solution provided by the embodiment of the present application, the edge node determines the target resource amount required for the instance based on the current resource usage of the instance deployed on it and the resource scheduling and control information sent by the central node, and then performs resource scheduling on the instance. Among them, the resource scheduling decision made by the edge node can shorten the delay of resource scheduling and improve the real-time performance of resource scheduling; the resource scheduling decision made in combination with the resource scheduling and control information sent by the central node can ensure the accuracy of resource scheduling. It can be seen that the technical solution provided by the embodiment of the present application can not only improve the real-time performance of resource scheduling, but also ensure the accuracy of resource scheduling.

[0081] In one feasible solution, the resource scheduling and control information includes: the historical resource usage range of the target instance. Specifically, the historical resource usage range of the target instance includes: the historical resource usage range of the target instance in each of multiple time periods. The durations of these multiple time periods can be the same or different, and can be configured according to actual needs. In one specific example, a 24-hour day can be divided into the multiple time periods, and the duration of these multiple time periods can all be 1 minute.

[0082] Optionally, the above method may further include:

[0083] 205. The central node determines a historical resource usage range of the target instance according to the historical resource usage of the target instance.

[0084] The specific process can be found in the corresponding contents of the above embodiments and will not be repeated here.

[0085] In the above 203, "the edge node determines the target resource amount required by the target instance based on the current resource usage of the target instance and the resource scheduling and control information" can be implemented by the following steps:

[0086] 2031. The edge node predicts a first target resource amount required by the target instance within a future preset time period based on the current resource usage of the target instance.

[0087] 2032. The edge node determines whether the first target resource amount is credible based on the historical resource usage range of the target instance.

[0088] 2033. When it is determined that the first target resource amount is credible, the edge node determines the target resource amount required by the target instance based on the first target resource amount.

[0089] In the above 2031, the current resource usage may include: the resource usage collected at multiple time points within the current preset time period. The current preset time period can be within the current 2 seconds, within the current 1 minute, etc. The length of the current preset time period can be set according to actual needs, and this embodiment of the application does not specifically limit this. Note: The resource usage collected at multiple time points within the current preset time period includes: the resource usage of the target instance collected at the current time point.

[0090] Specifically, based on the current resource usage of the target instance, a resource demand prediction model is used to predict the first target resource amount required by the target instance in a future preset time period. The future preset time period can be 1s in the future, 2s in the future, 1min in the future, and so on. The length of the future preset time period can be set according to actual needs, and the embodiment of the present application does not make specific restrictions on this. Among them, the resource demand prediction model can be trained based on the historical resource usage of the target instance. The resource demand prediction model can be implemented based on a classification algorithm, wherein the classification algorithm includes but is not limited to: neural network classification algorithm, Bayesian classification algorithm, support vector machine and other general machine learning algorithms.

[0091] Typically, the resource usage collected within the current preset time period includes: the resource usage of the target instance collected at multiple time points; the resource usage of the target instance collected at multiple time points can be sorted according to the time sequence of the multiple time points to obtain a resource usage sequence; based on the resource usage sequence, the resource demand prediction model is used to predict the first target resource required for the target instance.

[0092] In one instance, in the above 2032, when the first target resource amount is within the historical resource usage range of the instance, the first target resource amount is determined to be credible; when the first target resource amount is not within the historical resource usage range of the target instance, it can be determined that the first target resource amount is unreliable or it can be further determined whether the first target resource amount is credible.

[0093] Further judgment steps may include: using a metric function to calculate the distance between the first target resource amount and the historical resource usage range of the target instance; when the distance is greater than a preset distance threshold, it is determined to be unreliable; when the distance is less than or equal to the preset distance threshold, it is determined to be credible.

[0094] In another example, the historical resource usage range of the target instance includes the historical resource usage range of the target instance in each of multiple time periods. The step 2032 above, "the edge node determines whether the first target resource amount is credible based on the historical resource usage range of the target instance," can be implemented using the following steps:

[0095] S11. Determine a target time period in which the future preset time period is located from the multiple time periods.

[0096] S12: When the first target resource amount is within the historical resource usage range of the target instance in the target time period, determine that the first target resource amount is credible.

[0097] Optionally, when the first target resource amount is not within the historical resource usage range of the target instance in the target time period, it is determined that the first target resource amount is not credible.

[0098] Taking into account the fact that in actual applications, the resource demand of an instance may fluctuate, that is, the historical resource usage range of the instance in the target time period cannot completely cover the actual resource demand of the instance in the future during the target time period. However, generally speaking, the actual resource demand of the instance in the future during the target time period should be near the historical resource usage range, and not far away from the historical resource usage range. Therefore, the above-mentioned "determining whether the first target resource amount is credible based on the historical resource usage range of the target instance" in 2032 may also include the following steps:

[0099] S13. When the first target resource amount is not within the historical resource usage range of the target instance in the target time period, the edge node determines a distance between the first target resource amount and the historical resource usage range of the target instance in the target time period.

[0100] S14. When the distance is less than or equal to the preset distance threshold, the edge node determines that the first target resource amount is credible.

[0101] S15. When the distance is greater than the preset distance threshold, the edge node determines that the first target resource amount is unreliable.

[0102] Specifically, a metric function (or distance function) may be used to calculate the distance between the first target resource amount and the historical resource usage range of the target instance during the target time period. Specifically, the first target resource amount and the historical resource usage range of the target instance during the target time period may be input into the metric function to obtain the distance between the two.

[0103] A small distance indicates that the prediction of the first target resource volume is accurate and reliable; a large distance indicates that the prediction of the first target resource volume is inaccurate and unreliable.

[0104] In the above 2033, when it is determined that the first target resource amount is credible, the target resource amount required by the target instance is determined based on the first target resource amount. In a specific example, the first target resource amount can be used as the target resource amount required by the target instance.

[0105] In practical applications, to ensure stable operation of edge nodes and reduce the incidence of failures, it is necessary to control the operating load rate of edge nodes to a preset load rate threshold, for example, below 80%. Therefore, in another specific example, the quotient obtained by dividing the first target resource amount by the preset load rate threshold can be used as the target resource amount required by the target instance.

[0106] Optionally, the step of “the edge node determining the target resource amount required by the target instance according to the current resource usage of the target instance and the resource scheduling and control information” in 203 above may further include the following steps:

[0107] 2034. When it is determined that the first target resource amount is unreliable, the edge node determines the target resource amount required by the target instance based on the historical resource usage range of the target instance.

[0108] Specifically, when it is determined that the first target resource amount is unreliable, the edge node determines the target resource amount required by the target instance based on the historical resource usage range of the target instance in the target time period.

[0109] In one specific example, the target resource value required by the target instance can be determined based on the midpoint value of the target instance's historical resource usage range during the target time period. For example, the midpoint value can be used directly as the target resource value, or the quotient of the midpoint value divided by a preset load rate can be used as the target resource value.

[0110] In another example, a target value closest to the first target resource amount can be determined from the upper and lower limits of the historical resource usage range; the target resource value can be determined based on this target value. For example, the target value can be used directly as the target resource value, or the quotient of the target value divided by a preset load factor can be used as the target resource value. Note: The target value is either the lower limit or the lower limit described above.

[0111] Furthermore, the resource scheduling and control information also includes: a resource scheduling strategy configured by the user; the resource scheduling strategy configured by the user includes the resource demand prediction model mentioned above. The above method may also include:

[0112] 206. The central node determines the resource scheduling strategy according to the user's configuration operation data.

[0113] Users can perform configuration operations on their own terminal devices, which then send the configuration operation data to the central node. These users can include instance tenants, operation and maintenance personnel, and so on.

[0114] In the above 2031, “the edge node predicts the first target resource amount required by the target instance within a future preset time period based on the current resource usage of the target instance” can be implemented by the following steps:

[0115] S21. The edge node predicts a first target resource amount required by the target instance within a future preset time period based on the current resource usage of the target instance and using the resource demand prediction model.

[0116] The specific implementation of the above step S21 can refer to the corresponding content in the above embodiment, which will not be repeated here.

[0117] In an embodiment of the present application, the user can change the resource demand prediction model at any time and send it to the central node, which then sends it to the edge node in a timely manner.

[0118] Furthermore, the resource scheduling strategy configured by the user also includes resource scheduling rules. In the above 2033, "when the edge node determines that the first target resource amount is credible, determining the target resource amount required by the target instance based on the first target resource amount" may include:

[0119] S31. When it is determined that the first target resource amount is credible, the first target resource amount is adjusted according to the resource scheduling rule to obtain the target resource amount required by the target instance.

[0120] In S31, the resource scheduling rule may include: the preset load rate threshold and / or the increase or decrease amount. The increase or decrease amount has a positive or negative sign, and when the increase or decrease amount is positive, it indicates an increase in the amount of resources; when the increase or decrease amount is negative, it indicates a decrease in the amount of resources.

[0121] Specifically, when the resource scheduling rule includes a preset load rate threshold, the quotient of the first target resource amount divided by the preset load rate threshold is used as the target resource amount. When the resource scheduling rule includes an increase or decrease amount, the sum of the first target resource amount and the increase or decrease amount is used as the target resource amount. When the resource scheduling rule includes both a preset load rate threshold and an increase or decrease amount, the quotient of the first target resource amount divided by the preset load rate threshold is determined; and the sum of the quotient and the increase or decrease amount is used as the target resource amount.

[0122] In actual applications, users can configure different increase or decrease amounts for different target instance types to meet their actual operational needs. In this way, the first target resource amount can be adjusted according to the increase or decrease amount corresponding to the instance type to which the target instance belongs.

[0123] Optionally, in the above 203, “the edge node performs resource scheduling on the target instance according to the target resource amount” can be implemented by the following steps:

[0124] 2035. The edge node determines the currently allocated resource amount of the target instance and the idle resource amount of the edge node.

[0125] 2036. The edge node determines the additional resource amount required by the target instance based on the target resource amount and the currently allocated resource amount.

[0126] 2037. When the idle resource amount is greater than or equal to the additional resource amount, the edge node allocates the idle resources on the edge node to the target instance according to the additional resource amount.

[0127] In the above 2035, the idle resource amount of the edge node refers to the amount of resources that have not been allocated on the edge node.

[0128] In step 2036 above, a determination is made as to whether the target resource amount is greater than the currently allocated resource amount. If the target resource amount is greater than the currently allocated resource amount, this indicates that the target instance is resource-constrained. Therefore, additional resources need to be added to the resource-constrained instance. If the target resource amount is greater than the currently allocated resource amount, the difference between the target resource amount and the currently allocated resource amount is determined; this difference is used as the additional resource amount required for the target instance.

[0129] In the above 2037, after determining the additional resource amount required by the target instance, it is also necessary to determine whether the idle resource amount of the edge node meets the expansion demand of the target instance.

[0130] When the amount of idle resources is greater than or equal to the amount of additional resources, it indicates that the amount of idle resources of the edge node meets the capacity expansion requirement of the target instance.

[0131] When the amount of idle resources is less than the amount of additional resources, it means that the idle resources of the edge node cannot meet the capacity expansion requirements of the target instance, and it is necessary to request the central node to migrate the target instance to other edge nodes in the network system, so that the other edge nodes can perform resource scheduling for the target instance. After receiving the request, the central node can determine the target edge node from at least one edge node based on the idle resources of at least one edge node, and then migrate the target instance to the target edge node, so that the target edge node can perform resource scheduling for the target instance. The edge node whose idle resources are greater than or equal to the target resources required by the target instance is used as the target edge node.

[0132] The technical solution provided in the embodiment of the present application has been refined for elastic decision-making, and adopts a method of cooperation between edge nodes and central nodes to make elastic decisions. The edge nodes make real-time elastic decisions based on real-time data to improve the elastic response time; the central end comprehensively manages the control strategy, operation strategy, user configuration, instance analysis strategy, etc., and pushes them to the edge nodes in a timely manner to improve the scalability of the elastic strategy.

[0133] This solution mainly involves two types of machine nodes: central nodes and edge nodes. Their specific functions are as follows:

[0134] Central node: a centrally deployed stream computing server that can obtain full data;

[0135] Edge node: The server where the database instance is deployed.

[0136] The following will be combined Figure 3 The technical solutions provided in the embodiments of this application are introduced as follows:

[0137] like Figure 3 As shown, the network system may include: a central node 31 and an edge node 32; wherein, multiple DB (Data Base) instances are deployed on the edge node 32. Figure 3 Only one edge node 32 is shown as an example. In practice, there are multiple edge nodes 32 in the network system.

[0138] The edge node 32 mainly includes the following working components:

[0139] Indicator Collector 322: responsible for collecting and reporting real-time data on resource performance indicators of database instances;

[0140] On-device elastic policy scheduler 323: Responsible for elastic policies on edge nodes. It consists of multiple key modules. The specific modules and functions are as follows:

[0141] Real-time algorithm strategy module 3231: responsible for calculating the appropriate target specifications for scaling up or down based on the current real-time load of the instance;

[0142] Resource contention identification module 3232: responsible for identifying database instances on the current edge node that are causing resource contention due to insufficient physical machine resources;

[0143] Long-term policy module 3233: Responsible for identifying the normalized resource usage range of instances based on long-term database instance performance indicators, and used to define the reasonable range of instance resource consumption;

[0144] Control Policy Module 3234: Responsible for processing restrictive rules in the cloud service provider's operation and maintenance process, used for daily operation and maintenance operations;

[0145] Operation strategy module 3235: responsible for processing the operation strategy of the cloud service provider during the product operation process.

[0146] Global elasticity policy module 3235: responsible for summarizing the results of multiple key modules and generating unique operation and maintenance instructions, which are then sent to the scaling controller 324 for execution.

[0147] Scaling controller 324: responsible for executing the policy changes produced by the elastic policy scheduler 323 on the client to the specific database instance;

[0148] The central node 32 mainly includes the following working components:

[0149] Operation configuration module 311, used to receive the flexible scheduling policy configured by the user;

[0150] The indicator history database 312 is used to store the historical resource performance indicators of all instances in the system (i.e., the historical resource usage mentioned above);

[0151] Instance profile analyzer 313: responsible for performing long-term instance profiling based on the load performance data of the database instance and analyzing the resource usage of the database.

[0152] Start / Stop Decision Maker 314: responsible for predicting the next start / stop time of an instance based on the database link information used by the user, thereby improving the cold start efficiency of the database.

[0153] The detailed task flow of the program is as follows Figure 3 As shown:

[0154] 1. The indicator collector 322 in the edge node 32 collects resource usage indicators of the database instance 321 and reports the data on a regular basis;

[0155] 2. The instance profile analyzer 313 and the start / stop decision maker 314 in the central node 31 periodically perform data analysis on all instances in the system;

[0156] 3. The on-device elastic policy scheduler 323 in the edge node 32 processes the data and analyzes whether a specific database instance requires elastic operation, such as increasing or decreasing the database instance specification, that is, increasing or decreasing the amount of resources allocated to the database instance. Specifically, the following steps may be included:

[0157] a. The real-time algorithm strategy module determines the first target resource amount required for the instance based on real-time performance indicators;

[0158] b. The long-term strategy module receives the historical resource usage range of the instance sent by the instance profile analyzer;

[0159] c. The resource contention identification module determines the target resource amount required by the instance based on the historical resource usage range of the instance and the first target resource amount; and determines whether the instance is a resource contention instance based on the target resource amount required by the instance and the currently allocated resource amount of the instance;

[0160] d. The control policy module determines whether there are global control policy constraints related to operations and maintenance, such as instance startup instructions and instance shutdown instructions sent by the start / stop decision maker.

[0161] e. The operation policy module determines whether there are global policy constraints for product operations, which is the user-configured elastic scheduling policy described above.

[0162] f. The global elasticity decision module integrates the results of multiple key modules to produce the final elasticity decision;

[0163] g. The scaling controller executes specific elastic operation commands.

[0164] The central node 31 will perform the macro-control mentioned in the above embodiments once a day.

[0165] As can be seen, this solution utilizes a comprehensive decision-making approach across both the center and the edge, which not only improves the real-time nature of elastic decision-making but also ensures the rationality of resource allocation from a global perspective, while also rationally utilizing redundant resources to reduce computing costs at the center. This solution also delegates maintenance and operational decisions to edge nodes, effectively shortening the response time of such global policies. The integration of data from the center and edge effectively improves the accuracy of elastic policies. Furthermore, the edge's combination of multiple policies is compatible with operational, control, and algorithmic rules, resulting in better service scalability.

[0166] Figure 4 FIG. 1 shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 4 As shown, the electronic device includes a memory 1101 and a processor 1102. The memory 1101 can be configured to store various other data to support operations on the electronic device. Examples of such data include instruction information for any application or method operating on the electronic device. The memory 1101 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0167] The memory 1101 is used to store programs;

[0168] The processor 1102 is coupled to the memory 1101 and is configured to execute the program stored in the memory 1101 to implement:

[0169] Receiving resource scheduling and control information sent by the central node;

[0170] Collect the current resource usage of the target instance deployed on this node;

[0171] Determine the target resource amount required by the target instance based on the current resource usage of the target instance and the resource scheduling and control information;

[0172] According to the target resource amount, resource scheduling is performed on the target instance. The specific implementation process can refer to the corresponding content of the above embodiments, which will not be repeated here.

[0173] Further, if Figure 4 As shown, the electronic device also includes: a communication component 1103, a display 1104, a power component 1105, an audio component 1106 and other components. Figure 4 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 4 Components shown.

[0174] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a computer, can achieve:

[0175] Receiving resource scheduling and control information sent by the central node;

[0176] Collect the current resource usage of the target instance deployed on this node;

[0177] Determine the target resource amount required by the target instance based on the current resource usage of the target instance and the resource scheduling and control information;

[0178] Perform resource scheduling on the target instance according to the target resource amount.

[0179] The specific implementation process can be found in the corresponding contents of the above embodiments, which will not be repeated here.

[0180] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0181] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by means of hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A resource scheduling method applied to a network system, wherein: The network system includes: at least one edge node and a central node for managing and controlling the at least one edge node; The central node predicts whether the edge node will meet the instance operation requirements in the future based on the historical resource usage of the instance deployed on the edge node; When the edge node does not meet the instance operation requirements, the central node performs cross-node migration for the instance deployed on the edge node; The edge node determines the target resource amount required by the target instance according to the current resource usage of the target instance deployed on the local node; and performs resource scheduling for the target instance according to the target resource amount; The central node predicts whether the edge node will meet the instance operation requirements in the future based on the historical resource usage of the instance deployed on the edge node, including: The central node predicts the total resource demand required in the future by at least one instance deployed on the edge node based on historical resource usage of at least one instance deployed on the edge node; The central node determines whether the edge node can meet the instance operation requirement in the future according to the total resource requirement and the total resource amount of the edge node; When the edge node does not meet the instance operation requirements, the central node performs cross-node migration for the instance deployed on the edge node, including: When the edge node does not meet the instance operation requirements, the central node determines an instance to be migrated from the edge node; The central node determines, from the at least one edge node, other edge nodes that can receive the instance to be migrated; The central node migrates the instance to be migrated to the other edge node.

2. The method according to claim 1, wherein Also includes: The central node sends resource scheduling and control information to the edge node; The edge node determines the target resource amount required by the target instance according to the current resource usage of the target instance deployed on the local node, including: The edge node determines the target resource amount required by the target instance according to the current resource usage of the target instance and the resource scheduling and control information.

3. The method according to claim 2, wherein: The resource scheduling and control information includes: the historical resource usage range of the target instance; the method further includes: The central node determines the historical resource usage range of the target instance according to the historical resource usage of the target instance; The edge node determines the target resource amount required by the target instance according to the current resource usage of the target instance and the resource scheduling and control information, including: The edge node predicts the first target resource amount required by the target instance within a future preset time period based on the current resource usage of the target instance; determines whether the first target resource amount is credible based on the historical resource usage range of the target instance; and when it is determined that the first target resource amount is credible, determines the target resource amount required by the target instance based on the first target resource amount.

4. The method according to claim 3, wherein: The historical resource usage scope of the target instance includes: the historical resource usage scope of the target instance in each of multiple time periods; The edge node determines whether the first target resource amount is credible based on the historical resource usage range of the target instance, including: The edge node determines, from the multiple time periods, a target time period in which the future preset time period is located; When the first target resource amount is within the historical resource usage range of the target instance in the target time period, the edge node determines that the first target resource amount is credible.

5. The method according to claim 4, wherein The edge node determines whether the first target resource amount is credible based on the historical resource usage range of the target instance, further comprising: When the first target resource amount is not within the historical resource usage range of the target instance in the target time period, the edge node determines a distance between the first target resource amount and the historical resource usage range of the target instance in the target time period; When the distance is less than or equal to a preset distance threshold, the edge node determines that the first target resource amount is credible.

6. The method according to claim 4, wherein: Determining a target resource amount required by the instance based on the current resource usage of the instance and the resource scheduling and control information, further comprising: When it is determined that the first target resource amount is not credible, the target resource amount required by the target instance is determined based on the historical resource usage range of the instance in the target time period.

7. The method according to any one of claims 3 to 6, wherein The resource scheduling control information also includes: a resource scheduling strategy configured by a user; the resource scheduling strategy configured by the user includes a resource demand prediction model; the method further includes: The central node determines the resource scheduling strategy according to the user's configuration operation data; The edge node predicts, based on current resource usage of the target instance, a first target resource amount required by the target instance within a future preset time period, including: The edge node predicts a first target resource amount required by the target instance within a future preset time period based on the current resource usage of the target instance and using the resource demand prediction model.

8. The method according to claim 7, wherein: The resource scheduling policy configured by the user also includes: resource scheduling rules; When it is determined that the first target resource amount is credible, the edge node determines the target resource amount required by the target instance based on the first target resource amount, including: When it is determined that the first target resource amount is credible, the edge node adjusts the first target resource amount according to the resource scheduling rule to obtain the target resource amount required by the target instance.

9. The method according to any one of claims 1 to 6, wherein The edge node performs resource scheduling on the target instance according to the target resource amount, including: The edge node determines the currently allocated resource amount of the target instance and the idle resource amount of the node; The edge node determines the additional resource amount required by the target instance according to the target resource amount and the currently allocated resource amount; When the idle resource amount is greater than or equal to the additional resource amount, the edge node allocates the idle resources of the node to the target instance according to the additional resource amount.

10. A network system, wherein: include: At least one edge node and a central node for managing the at least one edge node; The central node and the edge node cooperate with each other to implement the resource scheduling method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Internet of things resource scheduling method and system, computer-readable storage medium and terminal

    CN109005223A

  • Edge distributed management and control system, method and equipment and storage medium

    CN114301909A