Resource scheduling method, system and device and storage medium
By introducing regions as resource scheduling granularity in edge computing scenarios, the problem of resource scheduling in the existing technology is solved, more accurate and flexible resource scheduling is achieved, and the resource utilization rate of edge computing is improved.
Patent Information
- Application Number
- CN202311437584.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2025-05-02
AI Technical Summary
The resource elastic scaling services provided by existing K8s in edge computing scenarios are cluster-based, and cannot meet the increasingly flexible edge computing needs, resulting in poor resource scheduling.
The area is introduced as the resource scheduling granularity. When the target application meets the scheduling trigger requirements, the target scheduling area is determined for the target application, the required number of target container copies is calculated based on the scheduling strategy associated with the target scheduling area, and the scheduling execution plan is output.
By accurately sensing the resource scheduling needs of edge computing applied in local areas, providing independent and reasonable resource scheduling solutions can effectively improve resource scheduling effects in edge computing scenarios and improve resource utilization.
Smart Images

Figure CN119917250A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of edge computing technology, and in particular to a resource scheduling method, system, device and storage medium. Background Art
[0002] With the development of edge computing technology, more and more workloads are deployed in edge data centers (Internet Data Center, IDC). As a cloud-native technology, containers are suitable for hosting edge computing applications due to their portability, lightness, and high speed. K8s, or Kubernetes, is a portable container orchestration and management tool created for container technology.
[0003] Currently, in edge computing scenarios, K8s is usually used to orchestrate and manage containers in edge data centers. K8s can support elastic scaling of resources, but the elastic scaling service provided by K8s is based on clusters, that is, the total number of container copies corresponding to edge computing applications is regulated in the cluster that carries edge computing applications.
[0004] This solution of scaling the total number of container replicas based on clusters can no longer meet the increasingly flexible edge computing needs. Summary of the invention
[0005] Multiple aspects of the present application provide a resource scheduling method, system, device and storage medium to improve the resource scheduling effect in edge computing scenarios.
[0006] The present application provides a resource scheduling method, including:
[0007] In the case where it is detected that the target application meets the scheduling trigger requirement, determining a target scheduling area for the target application;
[0008] Calculate the number of target container replicas required by the target application in the target scheduling area based on a scheduling policy associated with the target scheduling area configured for the target application;
[0009] According to the number of copies of the target container, a scheduling execution plan for the target application in this round in the target scheduling area is outputted for the target application.
[0010] The embodiment of the present application also provides a resource scheduling system, including a trigger component and a tuner;
[0011] The trigger component is used to determine a target scheduling area for the target application when it is detected that the target application meets the scheduling trigger requirement;
[0012] The tuner is used to calculate the number of target container copies required by the target application in the target scheduling area based on the scheduling policy associated with the target scheduling area configured for the target application; and output a scheduling execution plan for the target application in this round in the target scheduling area according to the number of target container copies.
[0013] The embodiment of the present application also provides a resource scheduling node, including a memory and a processor;
[0014] The memory is used to store one or more computer instructions;
[0015] The processor is coupled to the memory and is configured to execute the one or more computer instructions to execute the aforementioned resource scheduling method.
[0016] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the aforementioned resource scheduling method.
[0017] In an embodiment of the present application, a region is introduced as a resource scheduling granularity. When it is detected that the target application meets the scheduling trigger requirements, a target scheduling region can be determined for the target application. In this way, the resource scheduling requirements of the target application can be accurately perceived from the regional level; based on this, the number of target container copies required by the target application in the target scheduling region can be calculated based on the scheduling policy associated with the target scheduling region configured for the target application, which can determine a resource scheduling scheme for the target application under different target scheduling regions; and then, resource scheduling can be independently implemented under different target scheduling regions to meet the resource scheduling requirements of the target application in different target scheduling regions. Therefore, in an embodiment of the present application, in an edge computing scenario, the resource scheduling requirements of the edge computing application in the local area can be accurately perceived and an independent and reasonable resource scheduling scheme can be provided for the edge computing application in the local area, thereby supporting resource scheduling according to the regional granularity, thereby effectively improving the resource scheduling effect in the edge computing scenario and improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 A schematic diagram of a resource scheduling method provided for an exemplary embodiment of the present application;
[0020] Figure 2A logical schematic diagram of a resource scheduling method provided for an exemplary embodiment of the present application;
[0021] Figure 3 A schematic diagram of a deployment method of an edge computing application provided for an exemplary embodiment of the present application;
[0022] Figure 4 A flowchart of another resource scheduling method provided for an exemplary embodiment of the present application;
[0023] Figure 5 A schematic diagram of a resource object provided for an exemplary embodiment of the present application;
[0024] Figure 6 A flowchart of another resource scheduling method provided for an exemplary embodiment of the present application;
[0025] Figure 7 A schematic diagram of the structure of a resource scheduling system provided for another exemplary embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. 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 ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0027] Before describing the technical solution of the present application in detail, several technical concepts involved in the present application are briefly explained as follows.
[0028] Edge computing refers to the use of an open platform that integrates network, computing, storage, and application core capabilities to provide near-end services on the side close to users or data sources. Its applications are initiated on the edge side, resulting in faster network service responses, meeting the industry's basic needs in terms of real-time, application intelligence, security, and privacy protection.
[0029] Edge computing applications, applications that run based on edge computing technology, can be called edge computing applications.
[0030] The edge data center is the opposite of the concept of the central cloud (a data center with scaled resources and centralized locations). The edge data center is a data center built on edge infrastructure that is closer to the edge and has computing, storage, networking, security and other capabilities. The edge infrastructure can include wireless computer rooms (or clusters), core network equipment, base stations, gateways, servers, computing devices, storage devices and other edge nodes and the corresponding network operating environment. The edge data center has regional attributes.
[0031] Edge nodes,Edge data centers contain edge nodes, and edge nodes also have regional attributes. Edge nodes can be used to carry edge computing applications.
[0032] Containers are a technology used to bundle an application and all its necessary files into a runtime environment.
[0033] A container replica is a copy of a container created for an application. The container replica has the same runtime environment as the original container. Therefore, when the application is distributed and deployed on multiple edge nodes, the container replica can ensure high availability and scalability of the application.
[0034] At present, in edge computing scenarios, K8s technology is still generally used to orchestrate and manage containers in edge data centers. From the perspective of a single application, under K8s technology, the application is concentrated in a cluster as a whole workload, that is, the application is centrally deployed in a cluster. K8s technology provides native resource elastic scaling services, such as horizontal autoscaling HorizontalPodAutoscaler (HPA). However, these native resource elastic scaling services are usually based on cluster granularity. Taking the aforementioned autoscaling HPA as an example, these native resource elastic scaling services usually specify one or more monitoring indicators for the cluster. If the resource status of the application in the cluster reaches the relevant monitoring indicators, it will trigger the regulation of the total number of container copies of the application in the cluster.
[0035] During the research, the inventors found that after applying this native resource elastic scaling service in edge computing scenarios, it cannot meet the flexible and changeable resource scheduling requirements of edge computing applications. In many cases, it runs counter to the resource scheduling requirements of edge computing applications, resulting in insufficient response efficiency of edge computing applications for some edge users, while providing excessive response efficiency for some edge users.
[0036] To this end, a new resource scheduling method is proposed in this embodiment to more reasonably schedule resources for edge computing applications in edge computing scenarios, thereby adapting to the flexible and changeable resource scheduling requirements of applications in edge computing scenarios.
[0037] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0038] Figure 1 A schematic diagram of a resource scheduling method provided by an exemplary embodiment of the present application. Figure 1 , the method may include:
[0039] Step 100: When it is detected that the target application meets the scheduling trigger requirement, a target scheduling area is determined for the target application;
[0040] Step 101: Calculate the number of target container replicas required by the target application in the target scheduling area based on the scheduling policy associated with the target scheduling area configured for the target application;
[0041] Step 102: Output the current round scheduling execution plan in the target scheduling area for the target application according to the number of target container replicas.
[0042] The resource scheduling method provided in this embodiment can be applied to edge computing scenarios, which may include multiple edge clusters. In this embodiment, the native resource elastic scheduling service in the existing container orchestration tool is no longer used, but the new resource scheduling method provided in this embodiment is used to schedule resources for edge computing applications. Figure 2 A logical diagram of a resource scheduling method provided by an exemplary embodiment of the present application. Figure 2 In this embodiment, a resource scheduling system can be deployed outside the edge cluster, and the resource scheduling method provided in this embodiment can be executed through the resource scheduling system to perform global resource scheduling for all edge clusters. In this embodiment, the resource scheduling system can perform resource scheduling for all deployed applications separately, thereby realizing global resource scheduling.
[0043] For ease of description, this embodiment will take the target application as an example to illustrate the resource scheduling method. The target application can be any deployed edge computing application. It should be understood that resource scheduling can also be implemented for other edge computing applications according to the same resource scheduling method. In addition, this embodiment does not limit the type and function of edge computing applications.
[0044] The target application in this embodiment can be deployed in multiple edge data centers. As mentioned above, edge data centers have regional attributes. The region in this embodiment can be understood as the physical area to which the edge data center belongs. When deploying the edge data center, the edge data center has been divided into appropriate physical areas. In this embodiment, the division scheme of the physical areas used in the edge computing scenario is not limited. In actual applications, it can be divided as needed. For example, the regions in this embodiment may include East China, South China, Central China, North China and Northwest China, etc., which are not exhaustive here. In this embodiment, the regions that have been defined in edge computing technology can be used.
[0045] In addition, in this embodiment, the multiple edge data centers where the target application is located may be located in different regions. In this way, the region corresponding to the target application may be one or more, and the target application may be distributed in one or more edge data centers in a single region. The target application may occupy one or more edge nodes in a single edge data center. For ease of description, we combine the edge nodes occupied by the target application in a single edge data center as an edge node set. In this way, the target application may occupy multiple edge node sets, inheriting the regional attributes of the edge data center, and each edge node set also has regional attributes.
[0046] In this embodiment, multiple edge node sets occupied by the target application can also be divided into edge clusters, wherein the edge clusters can be constructed using the aforementioned K8s and other technologies. In this way, from the perspective of the target application, in a single edge cluster, there may be multiple edge node sets belonging to the target application, and the regional attributes of the multiple edge node sets may not be completely the same. From the perspective of the area corresponding to the target application, the target application may occupy multiple edge node sets in a single area, and the multiple edge node sets occupied by it in a single area may be divided into the same edge cluster or non-completely identical edge clusters.
[0047] Figure 3 A schematic diagram of a deployment method of an edge computing application provided by an exemplary embodiment of the present application. Figure 3 In this embodiment, the target application can occupy multiple edge node sets. It occupies 4 edge node sets in the North China region, of which 2 edge node sets in the North China region are divided into edge cluster 1, and the other two edge node sets in the North China region are divided into edge cluster 2. Edge cluster 1 also includes 1 edge node set occupied by the target application in the South China region and 1 edge node set occupied in the Central China region. Edge cluster 2 also includes 1 edge node set occupied by the target application in the Central China region. It should be understood that Figure 3 The application deployment method of the target application is only exemplarily shown. Each edge cluster in this embodiment can also carry other applications, which will not be illustrated in more detail here.
[0048] On this basis, this embodiment introduces the region as the scheduling granularity, and the cluster dimension is no longer concerned in the process of specifying the scheduling solution.
[0049] refer to Figure 1 , in step 100, when it is detected that the target application meets the scheduling trigger requirements, a target scheduling area can be determined for the target application. Among them, the target application meeting the scheduling trigger requirements indicates that the target application has resource scheduling requirements. In step 100, it can be further determined for the target application in which area there is a resource scheduling requirement, and then the area with the resource scheduling requirement is determined as the target scheduling area. It should be understood that the target scheduling area determined in step 100 may be the entire area or part of the area corresponding to the target application, that is, the essence of the target scheduling area is still the physical area that has been defined in the edge computing technology, which also reflects that the area is used as the scheduling granularity in this embodiment. In addition, the number of target scheduling areas determined for the target application may be one or more. In the case where there are multiple target scheduling areas, subsequent steps 101 and 102 can be implemented separately under different target scheduling areas.
[0050] In this way, based on step 100, it is possible to timely and accurately perceive in which regions the target application has resource scheduling needs, so as to better adapt to the regional sensitivity of the edge computing scenario. For example, in an e-commerce application, a big promotion is to be held in the North China region during a certain period of time. Then, the North China region will experience a sudden increase in access traffic during this period, and more resources need to be scheduled to the North China region. Accordingly, in step 100, the resource scheduling needs of the e-commerce application in the North China region can be timely and accurately perceived, so that the North China region will be determined as the target scheduling area.
[0051] refer to Figure 2 In this embodiment, the trigger component included in the resource scheduling system can be used to implement step 100, thereby determining a target scheduling area for the target application. Referring to the description of edge clusters and areas in the previous text, it can be seen that for a single target scheduling area, the set of edge nodes occupied by the target application in the target scheduling area may be multiple, and may be distributed in multiple edge clusters. For example, referring to Figure 3 If the North China region is determined as the target scheduling region, the resource scheduling of the target application will involve both edge cluster 1 and edge cluster 2. It can be understood that the resource scheduling method provided in this embodiment is no longer cluster-granular, but regional-granular, and is usually cross-cluster.
[0052] Continue to refer Figure 1In step 101, the number of target container replicas required by the target application in the target scheduling area may be calculated based on a scheduling policy associated with the target scheduling area configured for the target application.
[0053] As mentioned above, if there are multiple target scheduling areas, step 101 may be performed in each of the multiple target scheduling areas to calculate the number of target container replicas required by the target application in each target scheduling area.
[0054] In this embodiment, the scheduling strategies in each area can be pre-configured for the target application. In an optional implementation scheme: multiple scheduling strategies can be pre-configured for the target application, and the association between the scheduling strategies and the areas can be configured, and the scheduling strategies associated with different areas may not be completely the same.
[0055] In actual applications, a resource object can be pre-built for the target application, and scheduling configuration information can be defined in the resource object. The resource object can be implemented as a YAML file, etc. The scheduling configuration information can include a policy group field, and a variety of scheduling policies can be defined in the policy group field. The scheduling configuration information can also include a scope field, and the scope field can define various areas corresponding to the target application. The scheduling configuration information can also include an association field, and the association field can define the association between the area and the scheduling policy. In this way, in step 101, the scheduling policies configured for the target application and associated with each target scheduling area can be parsed from the resource object, and based on this, the number of target container replicas required by the target application in each target scheduling area can be calculated respectively.
[0056] Among them, the target number of container copies can be used as a scaling target for the number of container copies of the target application in the target scheduling area. In practical applications, the total amount of container copies required by the target application in the target scheduling area during a single scheduling process is used as the target number of container copies; of course, the number of container copies that are expanded / reduced based on the original number of container copies required during a single scheduling process can also be used as the target number of container copies, which is not limited here. It should be understood that the essence of resource scheduling in this embodiment is to adjust the number of container copies of the target application. The specific adjustment method can be to create / release container copies, and of course, it can also be to migrate container copies between different areas, etc. This embodiment does not limit this.
[0057] The resource scheduling in this embodiment can support two scheduling directions, namely, expansion or reduction. Among them, expansion refers to adding more container copies for the target application; reduction refers to reducing container copies for the target application. For the target application, the scheduling direction can be specified in the aforementioned scheduling policy pre-configured for it. The scheduling direction specified in the scheduling policy associated with a single area can be one or more. When the specified scheduling direction in a single area is one, only the target application will be supported to perform resource scheduling in the area according to the specified single scheduling direction. When multiple scheduling directions are specified in a single area, each time the target application is detected to meet the scheduling trigger requirements, the scheduling direction that the target application should use in the area can be determined first, and then the resource scheduling can be performed according to the determined scheduling direction. In this case, in the scheduling policy configured for the target application in the area, the policy content can usually be defined separately for multiple scheduling directions.
[0058] refer to Figure 2 In this embodiment, step 101 may be implemented by a tuner included in the aforementioned resource scheduling system. The tuner may calculate the number of target container replicas required by the target application in the target scheduling area based on the scheduling policy associated with the target scheduling area configured for the target application. Thus, in step 101, the tuner may output the number of target container replicas required by the target application in different target scheduling areas.
[0059] Continue to refer Figure 1 In step 102, the current round scheduling execution plan in the target scheduling area may be output for the target application according to the number of target container replicas.
[0060] That is, in this embodiment, based on step 100, each time the target application is detected to meet the scheduling trigger requirements, it can be decided whether to end the local scheduling and start the next round of scheduling. In each round of scheduling, the execution plan of this round of scheduling can be output based on step 102. In actual applications, a scheduling cooling cycle can be set. When it is detected that the target application meets the scheduling trigger requirements, it can be determined whether the scheduling cooling cycle has been met since the last time the target application was detected to meet the scheduling trigger requirements. If so, the next round of scheduling can be started. If not, the current round of scheduling continues.
[0061] refer to Figure 2 In this embodiment, step 102 may be implemented by the tuner in the aforementioned resource scheduling system.
[0062] In this way, in this embodiment, the current round scheduling execution plan in each target scheduling area can be output for the target application respectively, so that the number of container copies occupied by the target application can be adjusted independently in different target scheduling areas. Specifically, if the number of target container copies required by the target application in the target scheduling area is greater than the current number of container copies occupied by the target application in the target scheduling area, more container copies are newly created in the target scheduling area so that the target application occupies a sufficient number of container copies in the target scheduling area, thereby achieving capacity expansion for the target application in the target scheduling area. If the number of target container copies required by the target application in the target scheduling area is less than the current number of container copies occupied by the target application in the target scheduling area, some of the container copies occupied by the target application are released in the target scheduling area so that the target application occupies fewer container copies in the target scheduling area, thereby achieving capacity reduction for the target application in the target scheduling area.
[0063] It is worth noting that, as mentioned above, this embodiment no longer focuses on the cluster dimension. Therefore, in the process of executing the scheduling according to this round of scheduling execution plan, the edge cluster corresponding to the newly created container copy or the released container copy is not limited. In actual applications, the newly created container copy may be distributed in multiple edge clusters, and the released container copy may also be distributed in multiple clusters. In addition, in this embodiment, the scheduler ( Figure 2 The tuner may output the scheduling execution plan for this round constructed in step 102 to the scheduler as a basis for the scheduler to implement the scheduling operation. The scheduler may elastically scale the container replicas for the target application in the target scheduling area by executing the scheduling operation.
[0064] In summary, in this embodiment, the region is introduced as the resource scheduling granularity. When it is detected that the target application meets the scheduling trigger requirements, the target scheduling region can be determined for the target application. In this way, the resource scheduling requirements of the target application can be accurately perceived from the regional level; based on this, the number of target container copies required by the target application in the target scheduling region can be calculated based on the scheduling policy associated with the target scheduling region configured for the target application, which can determine the resource scheduling scheme for the target application under different target scheduling regions; and then, resource scheduling can be implemented independently under different target scheduling regions to meet the resource scheduling requirements of the target application in different target scheduling regions. Therefore, in the embodiment of the present application, in the edge computing scenario, the resource scheduling requirements of the edge computing application in the local area can be accurately perceived and an independent and reasonable resource scheduling scheme can be provided for the edge computing application in the local area, thereby supporting resource scheduling according to the regional granularity, thereby effectively improving the resource scheduling effect in the edge computing scenario and improving resource utilization.
[0065] Figure 4 A flowchart of another resource scheduling method provided by an exemplary embodiment of the present application. Figure 4 , the method comprising:
[0066] Step 400: Based on one or more triggering modes pre-configured for the target application, if it is detected that the target application meets any of the triggering modes configured for it, it is determined that the target application meets the scheduling triggering requirement;
[0067] Step 401: When it is detected that the target application meets the scheduling trigger requirement, a target scheduling area is determined for the target application;
[0068] Step 402: Calculate the number of target container replicas required by the target application in the target scheduling area based on the scheduling policy associated with the target scheduling area configured for the target application;
[0069] Step 403: Output the current round scheduling execution plan in the target scheduling area for the target application according to the number of copies of the target container.
[0070] Among them, for steps 401 to 403, reference may be made to the description in the aforementioned embodiment, and no repetition is given here. In this embodiment, an implementation method for detecting whether the target application meets the scheduling trigger requirement is provided through step 400. This implementation method can also be applied to the aforementioned and subsequent embodiments to be combined with the technical solutions in the aforementioned or subsequent embodiments.
[0071] refer to Figure 4 In this embodiment, one or more triggering modes are pre-configured for the target application. On this basis, in step 400, based on the one or more triggering modes pre-configured for the target application, if it is detected that the target application meets any of the triggering modes configured for it, it is determined that the target application meets the scheduling triggering requirement.
[0072] In this embodiment, multiple triggering modes may be supported, including but not limited to resource triggering mode, time triggering mode or event triggering mode, etc. For target applications, one or more triggering modes may be selected from the multiple triggering modes supported by this embodiment according to actual needs.
[0073] Figure 5 A schematic diagram of a resource object provided by an exemplary embodiment of the present application. Figure 5 In addition to the scope field and policy group field mentioned above, the exemplary resource object also includes a trigger mode field, and the selected trigger mode is defined in the trigger mode field.
[0074] refer to Figure 5In this exemplary resource object, resource triggering mode, time triggering mode and event triggering mode are selected for the target application. Figure 5 The trigger mode combination scheme defined for the target application is exemplified. In this embodiment, other trigger mode combination schemes can also be defined for the target application. For example, resource type trigger mode and event type trigger mode can be configured for the target application at the same time. For another example, time type trigger mode and event type trigger mode can be configured for the target application at the same time. For another example, only event type trigger mode can be configured for the target application. Therefore, in this embodiment, a variety of trigger mode combination schemes can be supported, so that the trigger expectations of different edge computing applications can be met more comprehensively and flexibly, and resource scheduling can be triggered for edge computing applications more accurately and timely.
[0075] The following describes the several exemplary triggering methods provided above.
[0076] Resource triggering method
[0077] The resource-class triggering method is used to determine whether the resource status of the application meets the specified triggering conditions. In this embodiment, it supports configuring the triggering water level of one or more resources in the resource-class triggering method, and for a single resource, it supports configuring the triggering water level in different scheduling directions. In this embodiment, the triggering water level can be understood as the threshold value of the resource status indicator used as a basis for judgment. Among them, the types of resources supported in the resource-class triggering method may include CPU resources, storage resources or network resources. For example, under the CPU resources, it can support the configuration of the first CPU usage rate for triggering expansion and / or the second CPU usage rate for triggering contraction, etc., wherein the first CPU usage rate and the second CPU usage rate are the triggering water level. For another example, under the storage resources, it supports the configuration of the first storage usage rate for triggering expansion and / or the second storage usage rate for triggering contraction, etc., wherein the first storage usage rate and the second storage usage rate are the triggering water level.
[0078] Based on this, in this embodiment, the trigger water levels of various resources in the required scheduling direction can be combined and configured in the resource class trigger mode. In this embodiment, the trigger conditions in the resource class trigger mode can be set based on the trigger water level and the scheduling direction. Typical trigger conditions can be: in the expansion direction, the resource status of the application reaches any trigger water level in the expansion direction, and it can be determined that the resource status of the application meets the trigger condition; in the shrinking direction, the resource status of the application reaches all the trigger water levels in the shrinking direction, and it can be determined that the resource status of the application meets the trigger condition.
[0079] In this way, in this embodiment, based on the resource type triggering mode, it is possible to support joint evaluation of the resource status of the application under multiple resources to determine whether the application has resource scheduling requirements.
[0080] Time trigger mode
[0081] The time trigger method is used to define the scheduling target for the application at a specified time node. The time trigger method can include the time node and the container copy control rule at the time node. For example, a time range [8:00, 10:00] can be specified in the time trigger method, and the control rule is defined as: expand to 10 container copies at 8:00 every day, continue until 10:00, and then shrink to 1 container copy. In other words, 8:00 and 10:00 are defined as time nodes respectively, and scheduling targets are defined for the two time nodes respectively.
[0082] In addition, since the present embodiment proposes to introduce regions as the scheduling granularity, the regions to be regulated may also be specified in the regulation rules of the time-based trigger mode. Of course, it is also possible not to specify, in which case, all regions defined for the application will be applied by default.
[0083] In this way, in this embodiment, based on the time-based triggering mode, it can support the application to perceive whether a specified time node has been reached to determine whether the application has a resource scheduling requirement.
[0084] Event triggering method
[0085] The event triggering method is used to sense the resource scheduling request event initiated by the application. The event triggering method may include control parameters for the resource scheduling request event, and control parameters may be designed for different scheduling directions. The control parameters here may include but are not limited to cooling time, expected ratio, etc.
[0086] An exemplary event triggering method can be defined as:
[0087] 1coolDownInterval: "30min"
[0088] 2onlyScaleUp:"true"
[0089] 3 areaAggregation:"true"
[0090] 4 scaleUpRatio: "30"
[0091] 5 scaleDownRatio: "90"
[0092] The meaning of each field description is as follows:
[0093] coolDownInterval is the cooling interval between two triggers. If it is set to 30 minutes, it will only be triggered once within 30 minutes.
[0094] onlyScaleUp only receives expansion events and is closed by default.
[0095] areaAggregation aggregation area. If the received event is a provincial expansion, the expansion range will be assigned to the corresponding area. It is enabled by default.
[0096] scaleUpRatio is the expansion ratio. The capacity is expanded according to 30% of the current replica as the final state.
[0097] scaleDownRatio is the scaling ratio. The scaling is performed based on 90% of the current replica as the final state.
[0098] In this way, in this embodiment, based on the event-based triggering method, it can support the perception of resource scheduling request events initiated for applications, so as to perceive the resource scheduling requirements of the applications.
[0099] It should be understood that the above triggering modes are merely exemplary, and the present embodiment is not limited thereto, and no further examples of triggering modes are given herein.
[0100] Thus, in this embodiment, step 400 may be implemented according to the triggering mode actually configured by the target application. Specifically, in step 400:
[0101] If the target application is configured with a resource-type trigger mode, then when it is detected that the resource state of the target application meets the trigger condition in the resource-type trigger mode, it is determined that the target application meets the resource-type trigger mode;
[0102] If the target application is configured with a time-based trigger mode, when the time node specified in the time-based trigger mode is reached, it is determined that the target application complies with the time-based trigger mode;
[0103] If the target application is configured with an event-type triggering mode, when a resource scheduling request event for the target application is monitored, it is determined that the target application complies with the event-type triggering mode.
[0104] In this embodiment, the resource scheduling request event may include, but is not limited to, information such as application identification, desired scheduling direction, and designated area. An exemplary resource scheduling request event may be characterized as follows:
[0105]
[0106]
[0107] Among them, the namespace field is used to specify the user ID, the name field is used to specify the application ID, and events is used to specify the event content. In the above example, two event contents are defined, and the region is specified by the region field in the two event contents, and the scheduling direction is specified by the action field. It should be understood that the above representation method of the resource scheduling request event is exemplary, and this embodiment is not limited to this.
[0108] Among them, an exemplary scheme for detecting whether the resource status of the target application meets the trigger condition in the resource-type trigger mode can be: obtaining the resource water level of the target application in each area associated with it; for each area associated with the target application, evaluating based on the corresponding resource water level and the trigger water level defined in the trigger condition, so as to determine whether the target application meets the trigger condition in each area associated with it. Based on this, if the target application meets the trigger condition in any area, it can be determined that the resource status of the target application meets the trigger condition in the resource-type trigger mode.
[0109] For example, if the target application is associated with the North China region and the East China region, and the resource types specified in the resource triggering method are CPU resources and storage resources. Then, the CPU water level 1 and storage water level 1 of the target application in the North China region and the CPU water level 2 and storage water level 2 in the East China region can be obtained respectively. Then, for the North China region, it can be determined whether the CPU water level 1 reaches the trigger water level for triggering expansion, and whether the storage water level 1 reaches the trigger water level for triggering expansion. If any one of them reaches the trigger water level, it can be determined that the target application meets the trigger conditions in the North China region. If neither of them reaches the trigger water level, it can continue to determine whether the CPU water level 1 reaches the trigger water level for triggering shrinkage, and whether the storage water level 1 reaches the trigger water level for triggering shrinkage. If both reach the trigger water level, it can be determined that the target application meets the trigger conditions in the North China region. Similarly, for the East China region, the same logical judgment is performed to determine whether the target application meets the trigger conditions in the East China region.
[0110] In addition, in this exemplary solution, in order to improve the evaluation efficiency, the resource water level of the target application in each area associated with it can be monitored and cached in a bypass manner. In the main process of this embodiment, the resource water level of the target application in each area associated with it can be directly read from the cache. In this bypass method: when the resource status calculation time is reached, the current resource water level and the historical resource water level corresponding to each area associated with the target application can be obtained respectively; in a single area, the obtained current resource water level and historical resource water level are weighted and summed to calculate the resource water level corresponding to the single area at the resource status calculation time; wherein the calculated resource water level is used as the historical resource water level at the next resource status calculation time; the resource water level is used to characterize the resource status of the target application. It is worth emphasizing that the resource status calculation time in this bypass method is not limited to the relevant time in the main process of this embodiment, but can be calculated according to an independent rhythm. For example, the resource water level calculation can be performed periodically with a period of 60s; the resource water level calculation can be performed separately at each timing when multiple timing moments are set, and the resource water level calculation can be performed separately at each timing moment, and so on. Furthermore, the aforementioned cache may only store the most recently calculated resource water level, so that the main process can obtain the most recent resource water level from the cache.
[0111] The resource water level calculation scheme in a single area under this bypass mode can be characterized as:
[0112]
[0113] Among them, V n Indicates the current resource level of the target application in a single area when the resource status calculation timing is reached. This value is usually obtained through status detection. This embodiment does not limit the specific detection method. In the current edge computing scenario, this status detection capability is already a common capability; davg n-1 Indicates the resource water level calculated for the target application at the last resource status calculation time, that is, the aforementioned historical resource water level; α is the weight corresponding to the historical resource water level, and 1-α is the weight corresponding to the current resource water level. The influence of the current resource water level and the historical resource water level on the result can be allocated by adjusting the value of α. It can be understood that the smaller α is, the greater the influence of the newer resource water level on the calculation result, and the current resource water level has the greatest influence on the calculation result. Exemplarily, the value of α can be set to 0.7, of course, this embodiment is not limited to this.
[0114] In this way, the resource water level of the target application in each area can be calculated in a bypass manner by using methods such as decay average calculation, thereby avoiding unnecessary resource scheduling caused by sudden changes in resource water levels, so that the resource scheduling solution provided by this embodiment can have stronger anti-burst performance. It should be understood that in this embodiment, the resource water level actually detected when the target application meets the scheduling trigger requirement can also be directly used in the main process. Although unnecessary resource scheduling may be caused by sudden changes in resource water levels, this does not affect the overall technical effect of this embodiment.
[0115] Further, refer to Figure 2 In this embodiment, step 400 may be implemented by a trigger component in the resource scheduling system to detect whether the target application complies with any of the triggering methods configured for it. In this embodiment, the trigger component in the resource scheduling system may include a first trigger and a second trigger. The first trigger is used to detect whether the target application complies with the first type of triggering method configured for it; the second trigger is used to detect whether the target application complies with the second type of triggering method configured for it. Exemplarily, the first type of triggering method may include a resource type triggering method and / or a time type triggering method, etc., and the second type of triggering method includes an event type triggering method, etc.
[0116] Based on this, if the target application is configured with a first type of triggering method, the first trigger can actively detect whether the target application complies with the first type of triggering method configured for it. The active detection here can be understood as actively initiating detection. For example, the detection can be initiated at a fixed time. Specifically, the detection operation can be started by setting a detection cycle or a timing moment, which is not limited here. Continuing the resource object configured for the target application in the aforementioned embodiment, here, the first trigger can obtain the resource object corresponding to the target application at a fixed time, and when the first type of triggering method is configured in the resource object, detect whether the target application complies with the first type of triggering method configured for it. For the specific detection implementation method, please refer to the previous description, which will not be repeated here. Moreover, since the first trigger not only provides detection for the target application, but also needs to provide detection for other edge computing applications, several coroutines can be started in parallel in the first trigger to consume and process the resource objects of several edge computing applications in parallel, that is, to perform the aforementioned active detection operation on multiple applications in parallel.
[0117] If the target application is configured with a second type of triggering method, the second trigger can detect whether the target application meets the second type of triggering method configured for it. Here, the second trigger can passively start the detection. For example, the second trigger can be implemented as a web server, and can continuously monitor whether a resource scheduling request event is received, and only when a resource scheduling request event is received, the aforementioned detection operation is passively started.
[0118] On this basis, when the first trigger or the second trigger detects that the target application meets any trigger mode, it can be determined that the target application meets the scheduling trigger requirement. That is, in the above-mentioned specific execution logic provided for step 400, if multiple trigger modes are configured for the target application, then when the target application meets any trigger mode, it can be determined that the target application meets the scheduling trigger requirement, and then the subsequent steps 401 to 403 can be triggered to implement the target application.
[0119] Since this embodiment can support configuring multiple triggering modes for the target application, the triggering mode that causes the target application to meet the scheduling triggering requirements may be one or more of them. Therefore, in this embodiment, the target scheduling area can be determined for the target application based on the triggering mode achieved by the target application. Based on this, this embodiment provides an optional implementation method for determining the target scheduling area for the target application:
[0120] If the target application is configured with a resource class trigger method and the target application complies with the resource class trigger method, then in the area configured for the target application, find the area that meets the trigger conditions in the resource class trigger method as the target scheduling area. Among them, the area configured for the target application is the area defined in the scope contained in the resource object corresponding to the target application mentioned above. Here, it is judged whether the resource status of the target application in each area configured for it meets the aforementioned trigger conditions, so that the area that meets the aforementioned trigger conditions can be screened out.
[0121] If the target application is configured with a time trigger mode and the target application complies with the time trigger mode, the area specified in the time trigger mode is used as the target scheduling area;
[0122] If the target application is configured with an event-type triggering mode and the target application complies with the event-type triggering mode, the area specified in the received resource scheduling request event is used as the target scheduling area.
[0123] In this implementation, the logic of determining the target scheduling area under different triggering modes is described respectively. It should be understood that if there are multiple triggering modes that cause the target application to meet the scheduling triggering requirement, the target scheduling areas determined under the multiple triggering modes can be used as the processing result in step 401.
[0124] In summary, in this embodiment, it is possible to support the configuration of multiple triggering methods for the target application, so as to more comprehensively and flexibly meet the triggering expectations of different edge computing applications, and thus trigger resource scheduling for edge computing applications more accurately and timely. For example, for applications that expect to respond to resource scheduling request events in a timely manner, an event-type triggering method can be configured for them. For another example, for applications that have fixed scheduling targets in a specified time period, a time-type triggering method can be configured for them. Moreover, through the combination of multiple triggering methods, the triggering expectations of various superimposed edge computing applications can be met. In addition, it is possible to evaluate whether the target application meets any of the triggering methods in the multiple areas configured for it, so as to accurately perceive whether the target application has resource scheduling needs in the local area.
[0125] Figure 6 A flowchart of another resource scheduling method provided by an exemplary embodiment of the present application. Figure 6 , the method may include:
[0126] Step 600: When it is detected that the target application meets the scheduling trigger requirement, determine a target scheduling area for the target application;
[0127] Step 601, calculating the expected number of container replicas required by the target application in the target scheduling area;
[0128] Step 602: Select a scheduling step adapted by the target application in the target scheduling area from the scheduling policies associated with the target scheduling area configured for the target application;
[0129] Step 603: Taking the expected number of container replicas as the scheduling target, according to the scheduling step, the number of container replicas corresponding to each step of the scheduling operation of the target application in the target scheduling area is calculated as the target number of container replicas.
[0130] Step 604: Output the current round scheduling execution plan in the target scheduling area for the target application according to the number of copies of the target container.
[0131] Among them, step 600 and step 604 can refer to the relevant description in the aforementioned embodiment, and will not be repeated here. In this embodiment, an optional implementation method for calculating the number of target container copies required by the target application in each target scheduling area is provided based on steps 601-603. It is worth noting that this implementation method can be used in the aforementioned or subsequent embodiments to be combined with the technical solutions in the aforementioned or subsequent embodiments.
[0132] refer to Figure 6In step 601, the expected number of container copies required by the target application in the target scheduling area can be calculated. In this embodiment, a step-by-step resource scheduling method is adopted, so the expected number of container copies calculated in step 601 is different from the target number of container copies generated in step 602. The expected number of container copies calculated in step 601 can be understood as the expected value of this round of scheduling, and the target number of container copies in step 603 can be understood as the number of container copies that should actually be scheduled at each step calculated with the expected number of container copies as the scheduling target. That is, the resource scheduling in this embodiment will not "all at once" adjust the number of container copies of the target application in the target scheduling area to the expected number of container copies, but will "gradually" adjust the number of container copies of the target application in the target scheduling area to the expected number of container copies according to the target number of container copies at each step.
[0133] refer to Figure 2 , the trigger component in the resource scheduling system provided in this embodiment can implement step 601. Since the scheme for calculating the expected number of container replicas in each target scheduling area is consistent, for ease of description, the scheme for calculating the expected number of container replicas will be described in detail from the perspective of a single target scheduling area.
[0134] In this embodiment, in step 601: if the target application is configured with multiple triggering modes, the expected number of container copies in the target scheduling area is calculated respectively under the triggering modes that the target application meets; from the expected number of container copies calculated under the triggering modes that the target application meets, an expected number of container copies that meets the specified standard is selected as the expected number of container copies required by the target application in the target scheduling area.
[0135] That is, for a single target scheduling area, the expected number of container replicas can be calculated under one or more triggering modes that the target application meets. The following describes the implementation scheme for calculating the expected number of container replicas of the target application in the target scheduling area for different triggering modes.
[0136] For resource triggering methods:
[0137] If the target application meets the resource class triggering mode in the target scheduling area, the current number of container copies of the target application in the target scheduling area is obtained;
[0138] Calculate the scheduling ratio based on the resource water level of the target application in the target scheduling area and the trigger water level specified in the resource class trigger mode;
[0139] According to the current number of container copies and the scheduling ratio, the expected number of container copies of the target application in the target scheduling area under the resource class trigger mode is calculated.
[0140] In this way, the process of calculating the expected number of container replicas under the resource class trigger mode can be characterized as follows:
[0141] Expected number of container copies = ceil [current number of container copies * (resource water level / trigger water level)]
[0142] Wherein, ceil【】is a rounding function, and (resource water level / trigger water level) is the aforementioned scheduling ratio. For the resource water level and the trigger water level, reference may be made to the description in the aforementioned embodiment, and no repetitive description is given here.
[0143] For time triggering:
[0144] If the target application complies with the time-based triggering method in the target scheduling area, the target number of container copies specified in the time-based triggering method and adapted to the current scheduling time is used as the expected number of container copies of the target application in the target scheduling area under the time-based triggering method.
[0145] As described in the previous text about the time-based triggering method, time nodes and scheduling targets corresponding to the time nodes can be defined in the time-based triggering method. Here, when the current scheduling moment reaches any time node defined in the time-based triggering method, the target number of container copies defined in the scheduling target corresponding to the time node can be used as the expected number of container copies of the target application in the target scheduling area under the time-based triggering method. It should be understood that, for the time-based triggering method, the active detection method can be used as described above to perceive whether the target application in the target scheduling area complies with the time-based triggering method configured for it, therefore, it is possible that the time node defined in the time-based triggering method is just between the two scheduled detection times. In order to avoid missed detection in this case, in this embodiment, the current scheduling moment reaches any time node defined in the time-based triggering method, which can be understood as the current scheduling moment being equal to the time node, or the current scheduling moment being greater than the time node and the previous scheduling moment being less than the time node.
[0146] For event triggering methods:
[0147] If the target application meets the event triggering mode in the target scheduling area, the current number of container copies of the target application in the target scheduling area is obtained;
[0148] Calculate the scheduling ratio based on the scheduling direction and expected ratio specified in the event triggering method;
[0149] According to the current number of container copies and the scheduling ratio, the expected number of container copies of the target application in the target scheduling area under the event-type triggering mode is calculated.
[0150] As described in the previous article about the event triggering method, in the event triggering method, expected ratios can be designed for different scheduling directions respectively. Here, the expected ratio can be used to calculate the scheduling ratio under the scheduling direction specified in the event triggering method.
[0151] In this way, the process of calculating the expected number of container replicas under event-based triggering can be characterized as follows:
[0152] In the expansion direction: the expected number of container replicas = ceil [current number of replicas * (1 + expansion ratio)]. The expansion ratio is the expected ratio defined in the expansion direction in the event triggering method.
[0153] In the shrinking direction: the expected number of container replicas = ceil [current number of replicas * (1-scaling ratio)]. The shrinking ratio is the expected ratio defined in the shrinking direction in the event triggering method.
[0154] In addition, refer to Figure 2 , following the first trigger and the second trigger included in the trigger component mentioned in the aforementioned embodiment, the first trigger can actively detect the trigger mode that the target application complies with in the target scheduling area, and under the trigger mode that complies, respectively calculate the expected number of container copies of the target application in the target scheduling area; similarly, the second trigger can detect the trigger mode that the target application complies with in the target scheduling area, and under the trigger mode that complies, respectively calculate the expected number of container copies of the target application in the target scheduling area.
[0155] In this embodiment, for a single target scheduling area determined for a target application, there may be multiple triggering methods that the target application meets in the target scheduling area. In this case, based on the aforementioned implementation method of respectively calculating the expected number of container copies under various triggering methods, there may be multiple expected numbers of container copies calculated for the target application in the target scheduling area. To this end, it is proposed in this embodiment that an expected number of container copies that meets the specified standard can be selected as the expected number of container copies required by the target application in the target scheduling area. The specified standard here can be set according to actual needs. For example, it can be set to select the maximum value, minimum value, median value, etc. For another example, it can be set to select the value that will be calculated earliest. No more examples are given here.
[0156] In a further optimization scheme: the limit value range of the number of container copies configured for the target application in the target scheduling area can also be obtained; if the expected number of container copies required by the target application in the target scheduling area actually calculated above exceeds the limit value range of the number of container copies, the corresponding limit value in the limit value range of the number of container copies is used as the expected number of container copies required by the target application in the target scheduling area. Specifically, if the expected number of container copies required by the target application in the target scheduling area actually calculated above is greater than the upper limit value in the limit value range of the number of container copies, the upper limit value is used as the expected number of container copies required by the target application in the target scheduling area; if the expected number of container copies required by the target application in the target scheduling area actually calculated above is less than the lower limit value in the limit value range of the number of container copies, the lower limit value is used as the expected number of container copies required by the target application in the target scheduling area. It is worth emphasizing that the limit value range of the number of container copies configured for the target application in different areas may not be exactly the same. In this way, by normalizing the actually calculated expected container copy data using the limit value range of the number of container copies in each area, the stability of resource scheduling can be guaranteed and over-scheduling can be avoided. In actual applications, the limit range of the number of container replicas can be defined in the scheduling policy configured for the target application in each area mentioned above. Of course, this is only exemplary and is not limited here.
[0157] In this way, the expected number of container replicas required for the target application within a single target scheduling region can be calculated. Figure 2 In the resource scheduling system, the first trigger or the second trigger may transmit the calculated expected number of container replicas to the tuner to trigger the tuner to perform subsequent steps 602 and 603. Figure 3 In actual applications, after the first trigger or the second trigger calculates the expected number of container copies, the trigger state can be updated for the resource object of the target application, and the resource object corresponding to the target application can usually be updated to an activated state. In this way, when the tuner senses that the resource object is in an activated state, it will start to execute steps 602 and 603.
[0158] On this basis, continue to refer to Figure 6 In step 602, a scheduling step adapted by the target application in the target scheduling area may be selected from the scheduling policies associated with the target scheduling area configured for the target application.
[0159] In this embodiment, it is possible to support defining multiple scheduling steps in the scheduling strategy associated with the target scheduling area configured for the target application. In step 602, a suitable scheduling step can be selected from them for use in step 603.
[0160] An exemplary scheduling strategy is provided below to more clearly reflect the scheduling steps.
[0161]
[0162]
[0163] Among them, the behavior field is used to define the scheduling direction. As described in the previous article about the scheduling policy, the scheduling policy can support the configuration of one or more scheduling directions. In the above example, only one scheduling direction is configured, namely the shrinking direction. The mixReplicas and maxReplicas fields are used to define the limit range of the number of container replicas. The cooldownSeconds field is used to define the cooldown time, and the policies field is used to define the scheduling step. One scheduling step is shrinking by quantity: the step length is 60s, and 4 container groups are shrunk in each step. Another scheduling step is shrinking by proportion: the step length is 60s, and the shrinkage is 10% in each step. The selectPolicy field defines the scheduling step selection rule. In this example, it is defined as selecting the scheduling step with the smallest shrinkage capacity.
[0164] Thus, in step 602, the single-step scheduling amount corresponding to each scheduling step in the scheduling strategy associated with the target scheduling area configured for the target application is determined respectively, and the appropriate scheduling step is selected according to the scheduling step selection rule defined in the scheduling strategy. For example, in the exemplary scheduling strategy provided above, when the scheduling step is to scale down by quantity, the single-step scheduling amount is 4 container groups; when the scheduling step is to scale down by proportion, if the current number of container copies of the target application in the target scheduling area is 10 container groups, the single-step scheduling amount is 1 container group; therefore, according to the scheduling step selection rule defined in the scheduling strategy, the scheduling step of scaling down by proportion is selected as the scheduling step adapted by the target application in the target scheduling area, and is used in the subsequent step 603.
[0165] On this basis, reference Figure 6 In step 603, the expected number of container copies required by the target application in the target scheduling area can be used as the scheduling target, and the number of container copies corresponding to each step of scheduling operation of the target application in the target scheduling area is calculated according to the scheduling step selected in step 602 as the target number of container copies. That is, in step 603, the number of container copies corresponding to each step of scheduling operation can be generated. When multiple steps of scheduling operation are required, the corresponding multiple numbers of container copies will all be used as the target number of container copies in this embodiment. It can be understood that what is generated in step 603 is a step-by-step scheduling execution plan that can achieve the expected number of container copies required, and the number of container copies that should be achieved by each step of scheduling operation is provided in the step-by-step scheduling execution plan.
[0166] refer to Figure 2 Based on the resource scheduling system provided in this embodiment, steps 602 and 603 can be implemented by the aforementioned tuner in the resource scheduling system. In this way, the tuner in this embodiment can output a step-by-step scheduling execution plan in each target scheduling area for the target application.
[0167] In a further optimization scheme, during the implementation of the above step 603, based on the normalization of the expected container replica data actually calculated using the container replica number limit range in each area, if it is detected that the cumulative number of container replicas calculated for the 1st to Nth step scheduling operations has exceeded the expected number of container replicas calculated for the target application in the target scheduling area, the number of container replicas corresponding to the Nth step scheduling operation is recalculated with the goal of reaching the expected number of scheduling replicas, and the step-by-step calculation operation is stopped. That is, the Nth step calculation operation will be the last step calculation operation of this round of resource scheduling. In this way, introducing the expected number of container replicas as a constraint in the step-by-step calculation process can avoid the problem of over-scheduling in the step-by-step scheduling process and ensure the stability of resource scheduling. Following the "activation state" mentioned above, here, after adjusting the container replicas of the target application in each target scheduling area to the corresponding expected number of container replicas in a step-by-step manner, the tuner in the resource scheduling system provided by this embodiment can update the state of the resource object corresponding to the target application to the "completion state".
[0168] In addition, it is worth noting that in this further optimization scheme, if the expected number of container copies of the target application in the target scheduling area has not been normalized according to the preset container copy number limit range in the scheduling strategy, then in this case, in addition to determining whether the current calculation operation causes the target application to reach the corresponding expected container copy data in the target scheduling area when executing each step of the calculation operation, it is also necessary to determine whether the current calculation operation causes the target application to exceed the preset container copy number limit range in the scheduling strategy in the target scheduling area. When the judgment result of any of these two aspects is reached, the current calculation operation can be regarded as the last calculation operation of this round of resource scheduling, and the corresponding number of container copies required for this calculation operation is recalculated. After these two aspects of judgment, it can be ensured that the container copy data of the target application in the target scheduling area is adjusted to the expected number of container copies and will not exceed the container copy number limit range. Thereby ensuring the stability of resource scheduling.
[0169] In addition, based on the step-by-step calculation operation in step 603, in this embodiment, in step 604, the current round scheduling execution plan of the target application in the target scheduling area can also be output step-by-step.
[0170] Considering the uncertainty of the timing when the target application meets the scheduling trigger requirement in this embodiment, it is possible that the current round of resource scheduling has not yet reached the expected number of container copies according to the step-by-step scheduling execution plan, but it has been detected that the target application has met the scheduling trigger requirement again, that is, the next resource scheduling opportunity has occurred. For this reason, this embodiment also proposes: if the target application is not detected to meet the scheduling trigger requirement again, the current round of scheduling execution plan can be output step by step according to the number of container copies generated by the step-by-step calculation operation; and if the target application is detected to meet the scheduling trigger requirement again, then if it is determined that the preset scheduling cooling cycle has been reached, stop outputting the current round of scheduling execution plan and start the next round of scheduling.
[0171] As mentioned above, step 603 in this embodiment can be implemented by the tuner in the resource scheduling system. From the perspective of the tuner, it does not directly perceive when the target application meets the scheduling trigger requirements again, but can perceive whether the trigger component provides a new expected number of container copies. Therefore, after receiving the new expected number of container copies required by the target application in the target scheduling area, the tuner can detect whether the time from the last time the expected number of container copies required by the target application in the target scheduling area meets the preset cooling time. If it meets the preset cooling time, the scheduling step can be reselected for the target application in the target scheduling area, and the number of container copies corresponding to each unscheduled operation in the target scheduling area can be calculated step by step for the target application according to the new expected number of container copies and the newly selected scheduling step. At this time, the output of the tuner is already the next round of scheduling execution plan for the target application in the target scheduling area.
[0172] In summary, in this embodiment, different scheduling strategies can be configured for target applications in different areas, and scheduling steps can be flexibly configured in the scheduling strategy, so that the number of container replicas corresponding to each step of scheduling operations can be determined for the target application in each target scheduling area in a step-by-step calculation manner, and then the current round of scheduling execution plans in each target scheduling area can be output for the target application in a step-by-step manner. This makes it possible to support flexible control of the step size and amplitude of resource scheduling in accordance with the step-by-step scheduling mode in this embodiment, so as to ensure the timeliness and accuracy of resource scheduling.
[0173] It should be noted that in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The serial numbers of the operations, such as 401, 402, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. 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 article are used to distinguish different triggers, trigger mode classifications, etc., and do not represent the order of precedence, nor do they limit the "first" and "second" to be different types.
[0174] Figure 7 A schematic diagram of a resource scheduling system provided by another exemplary embodiment of the present application. The system is used to implement the aforementioned resource scheduling method, referring to Figure 7 The system may include: a trigger component 10 and a tuner 20.
[0175] The trigger component 10 may be used to determine a target scheduling area for the target application when it is detected that the target application meets the scheduling trigger requirement;
[0176] The tuner 20 can be used to calculate the number of target container copies required by the target application in the target scheduling area based on the scheduling strategy associated with the target scheduling area configured for the target application; and output the current round scheduling execution plan for the target application in the target scheduling area according to the number of target container copies.
[0177] In an optional embodiment, the trigger component 10 can be used to:
[0178] Based on one or more triggering modes pre-configured for the target application, if it is detected that the target application meets any of the triggering modes configured for it, determining that the target application meets the scheduling triggering requirement;
[0179] The triggering mode configured for the target application includes one or more triggering modes selected from resource-based triggering mode, time-based triggering mode and event-based triggering mode.
[0180] Further, in an optional embodiment, the trigger component 10 may include a first trigger 11 and a second trigger 12, and the target application is pre-configured with one or more triggering modes;
[0181] A first trigger 11, used to detect whether the target application complies with the first type of trigger mode configured for it;
[0182] A second trigger 12, used to detect whether the target application complies with the second type of triggering mode configured for it;
[0183] The first type of triggering methods include resource triggering methods and / or time triggering methods, and the second type of triggering methods include event triggering methods;
[0184] When the first trigger 11 or the second trigger 12 detects that the target application meets any triggering mode, it is determined that the target application meets the scheduling triggering requirement.
[0185] In an optional embodiment, the trigger component 10 can be specifically used for:
[0186] If the target application is configured with a resource class trigger mode, then upon detecting that the resource state of the target application meets the trigger condition in the resource class trigger mode, determining that the target application meets the resource class trigger mode;
[0187] If the target application is configured with a time-based triggering mode, then when a time node specified in the time-based triggering mode is reached, determining that the target application complies with the time-based triggering mode;
[0188] If the target application is configured with an event-type triggering mode, then when a resource scheduling request event for the target application is monitored, it is determined that the target application complies with the event-type triggering mode.
[0189] In an optional embodiment, when determining the target scheduling area for the target application, the trigger component 10 may be used to:
[0190] If the target application is configured with a resource class trigger mode and the target application complies with the resource class trigger mode, searching for an area that complies with the trigger condition in the area configured for the target application as the target scheduling area;
[0191] If the target application is configured with a time-type trigger mode and the target application complies with the time-type trigger mode, the area specified in the time-type trigger mode is used as the target scheduling area;
[0192] If the target application is configured with an event-type triggering mode and the target application complies with the event-type triggering mode, the area specified in the resource scheduling request event is used as the target scheduling area.
[0193] In an optional embodiment, a bypass calculation component may also be included, for:
[0194] When the resource status calculation time is reached, respectively obtaining the current resource water level and the historical resource water level corresponding to each area associated with the target application;
[0195] In a single region, a weighted sum is performed on the acquired current resource water level and historical resource water level to calculate the resource water level corresponding to the single region at the resource status calculation time;
[0196] The calculated resource water level is used as a historical resource water level at the next resource status calculation opportunity; the resource water level is used to characterize the resource status of the target application.
[0197] In an optional embodiment, the trigger component 10 can also be used for:
[0198] Calculate the expected number of container replicas required by the target application in the target scheduling area;
[0199] The tuner 20 may be specifically used for:
[0200] Selecting a scheduling step adapted by the target application in the target scheduling area from the scheduling policies associated with the target scheduling area configured for the target application;
[0201] The expected number of container replicas is used as a scheduling target, and according to the selected scheduling step, the number of container replicas corresponding to each step of scheduling operation of the target application in the target scheduling area is calculated step by step as the target number of container replicas.
[0202] In an optional embodiment, when the tuner 20 outputs the current round scheduling execution plan for the target application in the target scheduling area according to the number of the target container replicas, it can be used to:
[0203] When it is not detected that the target application meets the scheduling trigger requirement again, outputting the scheduling execution plan of this round in a step-by-step manner according to the number of container copies generated by the step-by-step calculation operation;
[0204] If it is detected again that the target application meets the scheduling trigger requirement, then when it is determined that the preset scheduling cooling period has been reached, the output of the current round scheduling execution plan is stopped and the next round of scheduling is started.
[0205] In an optional embodiment, when calculating the expected number of container replicas required by the target application in the target scheduling area, the trigger component 10 may be used to:
[0206] If the target application is configured with multiple triggering modes, then the expected number of container replicas in the target scheduling area is calculated respectively under the triggering modes that the target application complies with;
[0207] From the expected container replica numbers calculated under the triggering mode that the target application complies with, an expected container replica number that meets a specified standard is selected as the expected container replica number required by the target application in the target scheduling area.
[0208] In an optional embodiment, the trigger component 10 calculates the expected number of container replicas respectively under the trigger mode that the target application complies with, including:
[0209] If the target application meets the resource class triggering mode, obtaining the current number of container copies of the target application in the target scheduling area;
[0210] Calculating a scheduling ratio based on the acquired resource water level of the target application in the target scheduling area and the trigger water level specified in the resource class trigger mode;
[0211] According to the current number of container copies and the scheduling ratio, the expected number of container copies of the target application in the target scheduling area under the resource class triggering mode is calculated.
[0212] In an optional embodiment, when the trigger component 10 respectively calculates the expected number of container replicas under the trigger mode that the target application complies with, it can be used to:
[0213] If the target application complies with the time-based triggering mode, the target number of container copies specified in the time-based triggering mode and adapted to the current scheduling time is used as the expected number of container copies of the target application in the target scheduling area under the time-based triggering mode.
[0214] In an optional embodiment, when the trigger component 10 respectively calculates the expected number of container replicas under the trigger mode that the target application complies with, it can be used to:
[0215] If the target application meets the event triggering mode, obtaining the current number of container copies of the target application in the target scheduling area;
[0216] Calculate the scheduling ratio based on the scheduling direction and expected ratio specified in the event triggering method;
[0217] According to the current number of container copies and the scheduling ratio, the expected number of container copies of the target application in the target scheduling area under the event type triggering mode is calculated.
[0218] In an optional embodiment, when calculating the expected number of container replicas required by the target application in the target scheduling area, the trigger component 10 may be used to:
[0219] Obtain a limit value range of the number of container replicas configured for the target application in the target scheduling area;
[0220] If the actually calculated expected number of container copies required by the target application in the target scheduling area exceeds the container copy number limit range, the corresponding limit value within the container copy number limit range is used as the expected number of container copies required by the target application in the target scheduling area.
[0221] In an optional embodiment, the tuner 20 calculates the number of container copies corresponding to each step of the scheduling operation of the target application in the target scheduling area according to the scheduling step, which can be used to:
[0222] In the process of step-by-step calculating the number of container replicas corresponding to each scheduling operation of the target application in the target scheduling area, if it is detected that the cumulative number of container replicas calculated for the 1st to Nth scheduling operations has exceeded the expected number of container replicas calculated for the target application in the target scheduling area, the number of container replicas corresponding to the Nth step calculation operation is recalculated with the goal of reaching the expected number of container replicas, and the step-by-step calculation operation is stopped.
[0223] In an optional embodiment, a configuration component is configured to:
[0224] Pre-configuring multiple scheduling strategies for the target application and configuring associations between the scheduling strategies and the regions;
[0225] Among them, the scheduling strategies associated with different areas are not exactly the same.
[0226] further, Figure 7 Only some components are shown schematically, which does not mean that the resource scheduling system only includes Figure 7 Components shown.
[0227] It is worth noting that the technical details in the above-mentioned resource scheduling system embodiments can refer to the relevant description in the aforementioned method embodiments. In order to save space, they will not be repeated here, but this should not cause a loss in the scope of protection of this application.
[0228] In addition, the embodiment of the present application further provides a resource scheduling node, which may include a memory and a processor, the memory is used to store one or more computer instructions, and the processor may be coupled to the memory for one or more computer instructions to execute the resource scheduling method provided in the aforementioned embodiment. For the implementation details of the resource scheduling method, reference may be made to the relevant description in the aforementioned method embodiment, which will not be repeated here to save space, but this should not cause a loss in the protection scope of the present application.
[0229] It is worth emphasizing here that, in terms of physical implementation, the resource scheduling node provided in the embodiment of the present application can be implemented as a cluster or as a single physical device. In the case of being implemented as a cluster, the resource scheduling method can be implemented based on the processor resources and memory resources provided by multiple physical devices in the cluster. In the case of being implemented as a single physical device, the resource scheduling method can be implemented based on the processor and memory in the physical device. The physical implementation form of the resource scheduling node does not affect its implementation of the resource scheduling method in this embodiment.
[0230] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps performed in the above method embodiment.
[0231] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0232] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0233] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0234] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0235] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0236] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0237] The above is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A resource scheduling method, characterized in that: include: In the case where it is detected that the target application meets the scheduling trigger requirement, determining a target scheduling area for the target application; Calculate the number of target container replicas required by the target application in the target scheduling area based on a scheduling policy associated with the target scheduling area configured for the target application; According to the number of copies of the target container, a scheduling execution plan for the target application in this round in the target scheduling area is outputted for the target application.
2. The method according to claim 1, characterized in that Also includes: Based on one or more triggering modes pre-configured for the target application, if it is detected that the target application meets any of the triggering modes configured for it, determining that the target application meets the scheduling triggering requirement; The triggering mode configured for the target application includes one or more triggering modes selected from resource-based triggering mode, time-based triggering mode and event-based triggering mode.
3. The method according to claim 2, characterized in that Also includes: If the target application is configured with a resource class trigger mode, then upon detecting that the resource state of the target application meets the trigger condition in the resource class trigger mode, determining that the target application meets the resource class trigger mode; If the target application is configured with a time-based triggering mode, then when a time node specified in the time-based triggering mode is reached, determining that the target application complies with the time-based triggering mode; If the target application is configured with an event-type triggering mode, then when a resource scheduling request event for the target application is monitored, it is determined that the target application complies with the event-type triggering mode.
4. The method according to claim 3, characterized in that: Determining a target scheduling area for the target application includes: If the target application is configured with a resource class trigger mode and the target application complies with the resource class trigger mode, searching for an area that complies with the trigger condition in the area configured for the target application as the target scheduling area; If the target application is configured with a time-type trigger mode and the target application complies with the time-type trigger mode, the area specified in the time-type trigger mode is used as the target scheduling area; If the target application is configured with an event-type triggering mode and the target application complies with the event-type triggering mode, the area specified in the resource scheduling request event is used as the target scheduling area.
5. The method according to claim 1, characterized in that Calculating the number of target container replicas required by the target application in the target scheduling area based on a scheduling policy associated with the target scheduling area configured for the target application includes: Calculate the expected number of container replicas required by the target application in the target scheduling area; Selecting a scheduling step adapted by the target application in the target scheduling area from the scheduling policies associated with the target scheduling area configured for the target application; The expected number of container replicas is used as a scheduling target, and the number of container replicas corresponding to each step of scheduling operation for the target application in the target scheduling area is calculated step by step according to the selected scheduling step, as the target number of container replicas.
6. The method according to claim 5, characterized in that Outputting a current round of scheduling execution plan for the target application in the target scheduling area according to the number of copies of the target container, including: When it is not detected that the target application meets the scheduling trigger requirement again, outputting the scheduling execution plan of this round in a step-by-step manner according to the number of container copies generated by the step-by-step calculation operation; If it is detected again that the target application meets the scheduling trigger requirement, then when it is determined that the preset scheduling cooling period has been reached, the output of the current round scheduling execution plan is stopped and the next round of scheduling is started.
7. The method according to claim 5, characterized in that Calculating the expected number of container replicas required by the target application in the target scheduling area includes: If the target application is configured with multiple triggering modes, then the expected number of container replicas in the target scheduling area is calculated respectively under the triggering modes that the target application complies with; From the expected container replica numbers calculated under the triggering mode that the target application complies with, an expected container replica number that meets a specified standard is selected as the expected container replica number required by the target application in the target scheduling area.
8. The method according to claim 7, characterized in that Calculating the expected number of container replicas respectively under the triggering mode that the target application meets, including: If the target application meets the resource class triggering mode, obtaining the current number of container copies of the target application in the target scheduling area; Calculating a scheduling ratio based on the acquired resource water level of the target application in the target scheduling area and the trigger water level specified in the resource class trigger mode; According to the current number of container copies and the scheduling ratio, the expected number of container copies of the target application in the target scheduling area under the resource class triggering mode is calculated.
9. The method according to claim 8, characterized in that The resource water level in the target scheduling area calculated in advance for the target application is obtained from the bypass, and the bypass calculation process includes: When the resource status calculation time is reached, respectively obtaining the current resource water level and the historical resource water level corresponding to each area configured for the target application; In a single region, a weighted sum is performed on the acquired current resource water level and historical resource water level to calculate the resource water level corresponding to the single region at the resource status calculation time; The calculated resource water level is used as a historical resource water level at the next resource status calculation opportunity; the resource water level is used to characterize the resource status of the target application.
10. The method according to claim 7, characterized in that Calculating the expected number of container replicas respectively under the triggering mode that the target application meets, including: If the target application complies with the time-based triggering mode, the target number of container copies specified in the time-based triggering mode and adapted to the current scheduling time is used as the expected number of container copies of the target application in the target scheduling area under the time-based triggering mode.
11. The method according to claim 7, characterized in that Calculating the expected number of container replicas respectively under the triggering mode that the target application meets, including: If the target application meets the event triggering mode, obtaining the current number of container copies of the target application in the target scheduling area; Calculate the scheduling ratio based on the scheduling direction and expected ratio specified in the event triggering method; According to the current number of container copies and the scheduling ratio, the expected number of container copies of the target application in the target scheduling area under the event type triggering mode is calculated.
12. The method according to claim 5, characterized in that Calculating the expected number of container replicas required by the target application in the target scheduling area includes: Obtain a limit range of the number of container replicas configured for the target application in the target scheduling area; If the actually calculated expected number of container copies required by the target application in the target scheduling area exceeds the container copy number limit range, the corresponding limit value within the container copy number limit range is used as the expected number of container copies required by the target application in the target scheduling area.
13. The method according to claim 12, characterized in that Calculating the number of container replicas corresponding to each step of scheduling operation of the target application in the target scheduling area according to the scheduling step, including: In the process of step-by-step calculating the number of container replicas corresponding to each scheduling operation of the target application in the target scheduling area, if it is detected that the cumulative number of container replicas calculated for the 1st to Nth scheduling operations has exceeded the expected number of container replicas calculated for the target application in the target scheduling area, the number of container replicas corresponding to the Nth scheduling operation is recalculated with the goal of reaching the expected number of container replicas, and the step-by-step calculation operation is stopped.
14. The method according to claim 1, characterized in that Also includes: Pre-configuring multiple scheduling strategies for the target application and configuring associations between the scheduling strategies and regions; Among them, the scheduling strategies associated with different areas are not exactly the same.
15. A resource scheduling system, characterized in that: Includes trigger assembly and tuner; The trigger component is used to determine a target scheduling area for the target application when it is detected that the target application meets the scheduling trigger requirement; The tuner is used to calculate the number of target container copies required by the target application in the target scheduling area based on the scheduling policy associated with the target scheduling area configured for the target application; and output a scheduling execution plan for the target application in this round in the target scheduling area according to the number of target container copies.
16. The system according to claim 15, characterized in that The trigger component includes a first trigger and a second trigger, and the target application is pre-configured with one or more trigger modes; The first trigger is used to detect whether the target application complies with the first type of triggering mode configured for it; The second trigger is used to detect whether the target application complies with the second type of triggering mode configured for it; The first type of triggering method includes a resource type triggering method and / or a time type triggering method, and the second type of triggering method includes an event type triggering method; When the first trigger or the second trigger detects that the target application complies with any triggering mode, it is determined that the target application meets the scheduling triggering requirement.
17. The system according to claim 15, characterized in that The trigger component is further used to calculate the expected number of container replicas required by the target application in the target scheduling area; The tuner is specifically used to select a scheduling step adapted by the target application in the target scheduling area from the scheduling strategy associated with the target scheduling area configured for the target application; taking the expected number of container copies as the scheduling target, and according to the scheduling step, calculating the number of container copies corresponding to each step of the scheduling operation of the target application in the target scheduling area as the target number of container copies.
18. A resource scheduling node, characterized in that: including memory and processor; The memory is used to store one or more computer instructions; The processor is coupled to the memory and is configured to execute the one or more computer instructions so as to execute the resource scheduling method according to any one of claims 1 to 14.
19. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the resource scheduling method according to any one of claims 1 to 14.