A service scheduling method and device, a storage medium and an electronic device
By grouping and scheduling application services from the resource pool to the cloud server, the problem of excessive memory and computing power consumption of the resource pool is solved, and the memory utilization of the cloud server is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2026-03-27
AI Technical Summary
Existing container orchestration engines do not delete or redeploy application services in the resource pool when the demand for application services decreases, resulting in increased memory and computing power consumption in the resource pool and reduced memory utilization of cloud servers.
By grouping application services running on the resource pool according to application information and rescheduling application services in the scheduling groups to run on cloud servers based on the remaining number of cloud servers, the size of the resource pool is reduced.
This improves the memory utilization of cloud servers and reduces the memory and computing power requirements of the resource pool.
Smart Images

Figure CN115964157B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to an application service scheduling method and device, a storage medium, and an electronic device. BACKGROUND
[0002] Developers and software-related staff often use container orchestration engines to deploy containerized applications. The common deployable spaces of container orchestration engines include resource pools and cloud servers. However, deploying application services in an application program in a resource pool incurs more maintenance costs. Existing container orchestration engines deploy application services in a resource pool when the demand for application services is large, but do not delete or redeploy the application services in the resource pool when the demand for application services is small, thereby increasing the resources occupied in the resource pool. SUMMARY
[0003] Embodiments of the present application provide an application service scheduling method and device, a storage medium, and an electronic device. The application services running on a resource pool are grouped according to corresponding application programs, and the application services in the scheduling group are rescheduled to a cloud server, thereby reducing the size of the resource pool occupied by the application services, reducing the required memory and computing power on the resource pool, and improving the memory utilization of the cloud server. The technical solution is as follows:
[0004] In a first aspect, embodiments of the present application provide an application service scheduling method applied to a container orchestration engine. The container orchestration engine includes a resource pool and a cloud server. The method includes the following steps.
[0005] Obtaining a target application service running on the resource pool;
[0006] Obtaining application program information corresponding to the target application service, and adding the target application service to a scheduling group corresponding to the application program information;
[0007] Based on the remaining number of application services that can run in the cloud server, the target application service in the scheduling group is scheduled to run on the cloud server.
[0008] In a second aspect, embodiments of the present application provide an application service scheduling device. The device includes the following components.
[0009] An application service obtaining module is configured to obtain a target application service running on the resource pool;
[0010] A grouping module is configured to obtain application program information corresponding to the target application service, and add the target application service to a scheduling group corresponding to the application program information;
[0011] The scheduling module is configured to schedule the target application service in the scheduling group to run on the cloud server based on a remaining number of application services that can run in the cloud server.
[0012] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and performing the method steps described above.
[0013] In a fourth aspect, an embodiment of the present application provides an electronic device, which can include a processor and a memory, wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and performing the method steps described above.
[0014] The technical solutions provided by some embodiments of the present application have at least the following beneficial effects:
[0015] In one or more embodiments of the present application, a target application service running on the resource pool is acquired, application program information corresponding to the target application service is acquired, the target application service is added to a scheduling group corresponding to the application program information, and the target application service in the scheduling group is scheduled to run on the cloud server based on a remaining number of application services that can run in the cloud server. By grouping the application services running on the resource pool according to corresponding application programs, and then re-scheduling the application services in the scheduling group to the cloud server, the size of the resource pool occupied by the application services is reduced, the required memory and computing power on the resource pool are reduced, and the memory utilization of the cloud server is improved. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0017] Figure 1 is a distance diagram of an application service scheduling provided by an embodiment of the present application;
[0018] Figure 2 is a flow diagram of an application service scheduling method provided by an embodiment of the present application;
[0019] Figure 3 is a flow diagram of an application service scheduling method provided by an embodiment of the present application;
[0020] Figure 4is a flowchart of a blacklist-based target application service acquisition method provided by an embodiment of the present application.
[0021] Figure 5 is a structural diagram of an application service scheduling apparatus provided by an embodiment of the present application.
[0022] Figure 6 is a structural diagram of an application service acquisition module provided by an embodiment of the present application.
[0023] Figure 7 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0025] In the description of the present application, it should be understood that the terms "first", "second" and the like are used only for the purpose of description, and should not be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise specified and limited, "including" and "having" and any variants thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units not listed, or optionally includes other steps or units inherent to the process, method, product or device. Those of ordinary skill in the art can understand the specific meaning of the above terms in the present application according to the specific circumstances. In addition, in the description of the present application, "multiple" means two or more, unless otherwise specified. "And / or" describes the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can mean that there are three cases of A alone, A and B together, and B alone. The character " / " generally represents a "or" relationship between the associated objects before and after it.
[0026] The application service scheduling method provided by the embodiments of the present application can be implemented by relying on a computer program and can run on an application service scheduling device based on the Von Neumann system. The computer program can be integrated in an application or can run as an independent tool application. The application service scheduling device in the embodiments of the present application can be a container orchestration engine (Kubernetes), or a module in the container orchestration engine that can implement the application service scheduling method. The container orchestration engine can manage application programs in a cloud platform and can perform automatic deployment, capacity expansion processing or capacity reduction processing on the application programs. It can be understood that each application program includes at least one application service, and the application service can be used to implement different functions of the application program, for example, in an instant messaging application program, a video communication application service, a voice communication application service, etc. The container orchestration engine can manage the application program and the application service of the application program and deploy the application service on a resource pool or a cloud server. The cloud server (Elastic Compute Service, ECS) is a physical or virtual infrastructure used for executing applications and information processing and storage. A virtualization software can be used to create a cloud server, and a physical (bare metal) server is divided into a plurality of virtual servers. Enterprises or users use and access the cloud server to process workloads and store information, and remotely access the functions of the cloud server through an online interface. The resource pool can be an elastic container embodiment (Elastic Container Instance, ECI), and the resource pool does not have the concept of a server. The resource pool can provide memory and processor (central processing unit, CPU) computing power for users and enterprises. It can be understood that an enterprise or a user generally needs to rent a cloud server and a resource pool. The cloud server is rented according to a fixed CPU core and memory size. The size of the cloud server that can be rented is fixed, for example, a server of a certain size can be rented for a month or a year. The resource pool does not provide computing power or memory according to the needs of enterprises and users, but calculates the cost according to the size and time of the resource pool occupied by enterprises or users. Therefore, it is necessary to occupy less resources on the resource pool to improve the utilization rate of the cloud server. The application service scheduling method can also set at least one namespace. The namespace is used for logical isolation of different application programs and can distinguish different code functions. For example, application program A can belong to namespace A, application program B can also belong to namespace A or namespace B. The application service belongs to which namespace can be related to the application program to which the application service belongs or the program tag of the application service. The program tag can represent the development team of the application service, the program code function, etc. Therefore, the application services in the same namespace can run on the resource pool or the cloud server.
[0027] Please seeFigure 1 An example schematic diagram of application service scheduling is provided for the embodiments of the present application. It can be understood that users or enterprises will generally rent a certain size and quantity of cloud servers according to the daily required memory and traffic. For example, a cloud server equivalent to 200 servers with a specification of 32 cores and 128 GB memory can be rented. However, the application program may have a sudden increase in access volume, which requires expansion processing, i.e., increasing application services to cope with the sudden increase in access volume. In order to improve the memory utilization rate of cloud service operation, the memory and computing power of the cloud server can only meet the daily use and cannot meet the expansion processing. Therefore, the container orchestration engine will deploy the application services that cannot be deployed in the cloud server in the resource pool, and then reduce the number of application services to the daily required number after the sudden situation ends, i.e., shrinkage processing. However, the container orchestration engine does not preferentially delete the application services in the resource pool but randomly selects the application services for shrinkage processing. Therefore, the application service scheduling device will migrate the application services in the resource pool to the cloud server, reduce the size of the resource pool occupied by the application services, and reduce the required memory and computing power on the resource pool. Figure 1 As shown in FIG. 6, there are originally three application programs in the application program: application program A, application program B, and application program C. When a sudden situation such as a sudden increase in access volume occurs, the application service scheduling device performs expansion processing to increase application service D and application service E to help cope with the sudden situation. However, if there is no remaining memory in the cloud server to deploy application service D and application service E, the application service scheduling device will give application service D and application service E, which need to be deployed in the resource pool due to insufficient cloud server resources, a taint tag. When an application service is tagged with a taint tag, the application service scheduling device will confirm that the resources in the cloud server are insufficient. The application service scheduling device will deploy application service D and application service E in the resource pool. After the sudden situation ends, the application service scheduling device will perform shrinkage processing, i.e., randomly reduce the application services of the application program to the original number, for example, delete application service B and application service D. Although shrinkage processing is performed, application service E is still running on the resource pool under the condition that there is free space in the cloud server. Therefore, the application service scheduling device can schedule application service E running on the resource pool to the cloud server, thereby reducing the size of the resource pool occupied by the application services and reducing the required memory and computing power on the resource pool. The target application service in the embodiments of the present application is the application service that runs on the resource pool and needs to be scheduled to the cloud server by the application service scheduling device, for example, application service E in FIG. 6. Figure 1
[0028] The application service scheduling method provided by the present application will be described in detail below in conjunction with specific embodiments.
[0029] Please refer to Figure 2 A flowchart of an application service scheduling method is provided for the embodiments of the present application. As shown in Figure 2 The method of the embodiments of the present application can include the following steps S101-S103.
[0030] S101, obtaining a target application service running on the resource pool.
[0031] Specifically, after the application service scheduling device performs the shrinkage processing, if it is detected that there is an application service running on the resource pool, it indicates that the application service on the resource pool needs to be rescheduled to the cloud server. The application service scheduling device can traverse all the application services to obtain the target application service running on the resource pool. It can be understood that the user or the relevant staff can pre-set a blacklist and a whitelist, the application services in the whitelist can be rescheduled to the cloud server, and the application services in the blacklist do not need to be rescheduled to the cloud server. The application service scheduling device can first obtain a namespace whitelist, the namespaces in the namespace whitelist are the application services that may need to be migrated back to the cloud server, then find the target application service running on the resource pool in the namespaces contained in the namespace whitelist, the target application service is the application service that needs to be scheduled to the cloud server, which can reduce the calculation amount of the application service scheduling device, improve the application service scheduling efficiency, and also avoid the incorrect scheduling of some application services allowed to run on the resource pool.
[0032] S102, obtaining application program information corresponding to the target application service, and adding the target application service to a scheduling group corresponding to the application program information.
[0033] Specifically, the application service scheduling device can obtain the application program information corresponding to the target application service, the application program information can be the application program and the grouping information of the application program of the target application service, the grouping information can be the name, the local storage address, etc. of the application program, which can indicate the corresponding relationship between the application program and the scheduling group, then the application service scheduling device can find the corresponding scheduling group according to the application program information, and add the target application program to the scheduling group. The application programs in the same scheduling group all have the same grouping information, or belong to the same application program.
[0034] S103, based on the remaining number of application services that can run in the cloud server, scheduling the target application service in the scheduling group to run on the cloud server.
[0035] Specifically, the remaining memory and computing power of the cloud server are limited, and not all application services on the resource pool that need to be rescheduled can be scheduled to the cloud server. The remaining number of application services that can run in the cloud server needs to be determined to reschedule the application services on the resource pool. The application service scheduling device can reschedule the application services in the scheduling group one by one. For example, a target scheduling group is obtained first, and the remaining number of application services that can run in the cloud server is obtained. If the remaining number is greater than or equal to the service number of the application services in the target scheduling group, it indicates that all the application services in the target scheduling group can be rescheduled. Since the application services in a scheduling group belong to the same application program, the application service scheduling device can directly deploy the application program corresponding to the target scheduling group on the cloud server. If the remaining number is less than the service number, it indicates that the remaining memory of the cloud server is insufficient to reschedule all the application services in the target scheduling group. Therefore, at least one application service that meets the remaining number can be determined in the target scheduling group, and the at least one application service is scheduled to run on the cloud server, so as to reduce the size of the resource pool occupied and improve the memory utilization of the cloud server.
[0036] In the embodiment of the application, a target application service running on the resource pool is obtained, application program information corresponding to the target application service is obtained, the target application service is added to a scheduling group corresponding to the application program information, and the target application service in the scheduling group is scheduled to run on the cloud server based on the remaining number of application services that can run in the cloud server. By grouping the application services running on the resource pool according to the corresponding application programs, and rescheduling the application services in the scheduling group to the cloud server, the size of the resource pool occupied by the application services is reduced, the required memory and computing power on the resource pool are reduced, and the memory utilization of the cloud server is improved.
[0037] Please refer to Figure 3 A flowchart of an application service scheduling method is provided for the embodiment of the application. As shown in Figure 3 The method of the embodiment of the application can include the following steps S201-S208.
[0038] S201, a target namespace in a namespace set is obtained.
[0039] Specifically, after the application service scheduling device performs the capacity reduction processing, if it is detected that there is an application service running on the resource pool, it indicates that the application service on the resource pool needs to be rescheduled to the cloud server. The application service scheduling device can traverse all the application services to obtain the target application service running on the resource pool. If the application service scheduling device traverses all the application services to find the target application service running on the resource pool, the required calculation amount is very large and complex, and the application service scheduling efficiency is low. Therefore, the application service scheduling device can obtain the target application service in units of namespaces, and it can be understood that not all the application services in the namespaces need to be rescheduled, and the application service in the target namespace may need to be rescheduled. The application services in the namespaces other than the target namespace are allowed to run on the resource pool. Therefore, the application service scheduling device can first obtain the target namespace in the namespace set, and then obtain the target application service in the target namespace set.
[0040] Optionally, the user or the relevant staff can pre-set the black list and the white list. The application services in the white list can be rescheduled to the cloud server, and the application services in the black list do not need to be rescheduled to the cloud server. For example, the user or the relevant staff can pre-set the namespace white list in the application service scheduling device. There is a target application service running on the resource pool and needing to be rescheduled in the namespace in the namespace white list. Therefore, the application service scheduling device can first detect whether the namespace white list exists or whether the namespace white list is empty. If the namespace white list is not empty, the application service scheduling device can confirm the namespaces in the namespace white list as the target namespaces, that is, the namespaces in the namespace white list are checked to find whether there is a target application service. If the namespace white list is empty or the namespace white list does not exist, the application service scheduling device can confirm all the namespaces in the namespace set as the target namespaces, that is, all the namespaces need to be checked to find the target application service.
[0041] It can be understood that the namespace white list can be set in the application service scheduling device, and the namespace black list can also be set. The application services in the namespaces in the namespace black list are allowed to run on the resource pool and do not need to be rescheduled. If the namespace black list is not empty, the application service scheduling device can obtain the namespaces in the namespace black list, and confirm the namespaces other than the namespaces in the namespace black list in the namespace set as the target namespaces.
[0042] S202, determining a set of application services running on the resource pool in the target namespace.
[0043] Specifically, since the application services in the same namespace can run on the cloud server or the resource pool, the application service scheduling apparatus can determine a set of application services running on the resource pool in the target namespace, and the application services in the set belong to the target namespace and run on the resource pool.
[0044] S203, obtaining a target application service in the set of application services based on the tag blacklist and / or the application program blacklist.
[0045] Specifically, the user or the relevant staff can set the tag blacklist and the application program blacklist in the application service scheduling apparatus, the tag blacklist stores program tags of at least one application service, and the application program blacklist stores application identifiers of at least one application program, which can be the name of the application program, the name of the development team, the function, or the storage address, etc. The application identifiers can be used to distinguish the application program. The application service corresponding to the program tag in the tag blacklist and the application service contained in the application program in the application program blacklist are allowed to run on the resource pool and do not need to be rescheduled. The application service scheduling apparatus can obtain the program tags of the application services in the set of application services and the application identifiers of the application programs to which the application services belong. If the program tag of the first application service in the set of application services does not exist in the tag blacklist, and the application identifier corresponding to the first application service does not exist in the application program blacklist, the application service scheduling apparatus confirms the first application service as the target application service.
[0046] Please see Figure 4 A flowchart of a method for obtaining a target application service based on a blacklist is provided for the embodiments of the present application, which can include the following steps S301-S304.
[0047] S301, determining a first application service in the set of application services, obtaining a program tag of the first application service, and obtaining an application identifier of an application program to which the first application service belongs.
[0048] Specifically, the application service scheduling apparatus can determine the first application service in the set of application services in sequence, for example, the application services in the set of application services can be labeled with numbers 0, 1, 2, etc. in order, and the first application service can be determined in the set of application services in ascending order. The application service scheduling apparatus can obtain the program tag of the first application service and the application identifier of the application program to which the first application service belongs.
[0049] S302, judging whether the program tag corresponding to the first application service exists in the tag blacklist.
[0050] Specifically, the application service scheduling apparatus can determine whether the program label corresponding to the first application service exists in the label blacklist. It can be understood that the program label of the application service can represent the development team of the application service, the program code function, etc. If the program label corresponding to the first application service exists in the label blacklist, it means that the first application service is allowed to run in the resource pool due to the team or function of the first application service, and does not need to be rescheduled. Then, S301 is performed, and the application service scheduling apparatus confirms the next application service as the first application service in the order of the labels until all the application services in the application service set are detected, i.e., if the value corresponding to the label of the first application service is greater than or equal to the total number of the application services in the application service set, S204 is performed.
[0051] If the program label corresponding to the first application service does not exist in the label blacklist, it is necessary to determine whether the application program of the first application service is allowed to run in the resource pool, and S303 is performed.
[0052] S303, determining whether the application identifier corresponding to the first application service exists in the application program blacklist.
[0053] Specifically, the application service scheduling apparatus can determine whether the application identifier of the application program to which the first application service belongs exists in the application program blacklist. If the application identifier corresponding to the first application service exists in the application program blacklist, it means that the application service in the application program is allowed to run in the resource pool by the application program scheduling apparatus, and does not need to be rescheduled. Then, S301 is performed, and the application service scheduling apparatus confirms the next application service as the first application service in the order of the labels until all the application services in the application service set are detected, i.e., if the value corresponding to the label of the first application service is greater than or equal to the total number of the application services in the application service set, S204 is performed.
[0054] If the application identifier corresponding to the first application service does not exist in the application program blacklist, S304 is performed.
[0055] It can be understood that the execution order of S302 and S303 can be exchanged, which is not limited here.
[0056] S304, confirming the first application service as the target application service.
[0057] Specifically, since the program label corresponding to the first application service does not exist in the label blacklist, and the application identifier corresponding to the first application service also does not exist in the application program blacklist, it means that the first application service is not allowed to run in the resource pool from the development team level, the function category level, or the application program level to which the first application service belongs. The first application service is an application service that needs to be rescheduled, and the application service scheduling apparatus will confirm the first application service as the target application service.
[0058] It can be understood that in addition to the label blacklist and the application program blacklist, a label whitelist and an application program whitelist can also be set, the label whitelist storing program labels of at least one application service, and the application program whitelist storing application identifiers of at least one application program. As the name implies, the application service corresponding to the program label in the label whitelist and the application service contained in the application program in the application program whitelist are not allowed to run on the resource pool and need to be rescheduled. If the program label of the first application service in the application service set exists in the label whitelist and / or the application identifier corresponding to the first application service exists in the application program whitelist, the application service scheduling device confirms the first application service as the target application service. It can be understood that in order to reduce the size of the occupied resource pool and improve the memory utilization of the cloud server, only a small part of the application services do not need to be migrated back, that is, the content of the label blacklist and the application program blacklist is less than that of the label whitelist and the application program whitelist, so the application service scheduling device only enables the label blacklist and the application program blacklist, and can not enable or set the label whitelist and the application program whitelist, which can improve the efficiency of application service scheduling.
[0059] Optionally, the target application service is deployed to the resource pool by the application service scheduling device due to insufficient resources in the cloud server before, so the target application service has a stain label. The application service scheduling device will perform resource integration and reschedule the target application service after determining the target application service in the resource pool, that is, steps S204-207. The application service scheduling device can remove the stain label of the target application service before performing S204. Because according to the running logic of the application service scheduling device, when there is an application service with a stain label, it indicates that the resources of the cloud server are insufficient, so when performing resource integration, the application service scheduling device will consider both the unoccupied resources of the cloud server and the unoccupied resources of the resource pool, and there may be an error condition that the target application service is not scheduled to the cloud server but is rescheduled to the resource pool again. If the stain label of the target application service is removed before resource integration, the application service scheduling device will only consider the unoccupied resources of the cloud server when performing resource integration, which can avoid scheduling errors and improve the accuracy of application service scheduling.
[0060] S204, obtaining an application program to which the target application service belongs, obtaining a grouping label of the application program, and adding the target application service to a scheduling group corresponding to the grouping label based on the grouping label.
[0061] Specifically, the application service scheduling device can obtain an application program to which the target application service belongs, and obtain a grouping tag of the application program. The grouping tag can be the name, storage address, or developer name of the application program, or a label set for the application program by a user or a related staff, and one grouping tag corresponds to one scheduling group. The application service scheduling device can add the target application service to the scheduling group corresponding to the grouping tag, so that the application services in one scheduling group belong to the same application program.
[0062] S205, obtain the number of application services in the scheduling group, and obtain the remaining number of application services that can be run in the cloud server.
[0063] Specifically, the application service scheduling device can obtain a plurality of scheduling groups, and sequentially reschedule the application services in the scheduling groups. The application service scheduling device obtains the number of application services in one scheduling group, which is the number of application services in the scheduling group, and obtains the remaining number of application services that can be run in the cloud server, which is the number of application services that can be run in the cloud server at present.
[0064] S206, if the number of application services is less than or equal to the remaining number of application services, deploy the application program corresponding to the scheduling group to the cloud server.
[0065] Specifically, if the number of application services is less than or equal to the remaining number of application services, it means that there are enough resources in the cloud server to run all the application services in the scheduling group, and it also means that all the application services contained in the application program corresponding to the scheduling group can be run on the cloud server. The application service scheduling device can directly redeploy the application program corresponding to the scheduling group, and deploy the application program to the cloud server.
[0066] S207, if the number of application services is greater than the remaining number of application services, determine at least one application service in the scheduling group that satisfies the remaining number of application services, and schedule the at least one application service to run on the cloud server.
[0067] Specifically, if the number of application services is greater than the remaining number of application services, it means that the resources in the cloud server are insufficient to run all the application services in the scheduling group. The application service scheduling device can determine at least one application service in the scheduling group that satisfies the remaining number of application services, and schedule the at least one application service to run on the cloud server. It can be understood that when the remaining number of application services is 0, it means that there is no remaining resource in the cloud server to run the application service, and the application service scheduling ends. If it is detected again that there are enough resources in the cloud server and there are application services running on the resource pool, S201 is executed again.
[0068] In the embodiment of the present application, the target namespace in which the application service needs to be rescheduled is obtained from the namespace set, the target application service is obtained in the target namespace according to the label blacklist and the application program blacklist, the calculation amount of the application service scheduling device is reduced, the application service scheduling efficiency is improved, and the misoperation on the application service that does not need to be rescheduled is avoided. In addition, the stain label on the target application service can be removed, the target application service is prevented from being rescheduled to the resource pool by the application service scheduling device, and the accuracy of the application service scheduling is improved. The application program information corresponding to the target application service is obtained, the target application service is added to the scheduling group corresponding to the application program information, and the target application service in the scheduling group is scheduled to run on the cloud server based on the remaining number of the application services that can run in the cloud server. By grouping the application services running on the resource pool according to the corresponding application programs, and rescheduling the application services in the scheduling group to the cloud server, the size of the resource pool occupied by the application services is reduced, the required memory and computing power on the resource pool are reduced, and the memory utilization of the cloud server is improved.
[0069] The application will be described in detail below with reference to the accompanying drawings. Figure 5 -Appendix Figure 6 The application service scheduling device provided by the embodiment of the present application will be described in detail. It should be noted that the application service scheduling device provided by the embodiment of the present application is only an example, and the application service scheduling device provided by the embodiment of the present application can also be implemented as a device that is all or part of the application service scheduling device. Figure 5 -Appendix Figure 6 The application service scheduling device in the embodiment of the present application is used to execute the method of the embodiment of the present application. Figure 2 and Figure 3 The embodiment of the present application is only related to the part of the embodiment of the present application, and the specific technical details are not disclosed, please refer to the embodiment of the present application. Figure 2 and Figure 3 The embodiment of the present application is only related to the part of the embodiment of the present application, and the specific technical details are not disclosed, please refer to the embodiment of the present application.
[0070] Please refer to Figure 5 , which shows the structure diagram of the application service scheduling device provided by an exemplary embodiment of the present application. The application service scheduling device can be realized by software, hardware or combination of the two to become all or part of the device. The device 1 includes an application service acquisition module 11, a grouping module 12 and a scheduling module 13.
[0071] The application service acquisition module 11 is used to obtain the target application service running on the resource pool;
[0072] Specifically, please refer to Figure 6 , which provides a structure diagram of an application service acquisition module. As shown in the figure, Figure 6 The application service acquisition module 11 can include:
[0073] The namespace obtaining unit 111 is configured to obtain a target namespace in a namespace set;
[0074] The application service obtaining unit 112 is configured to determine a target application service running on the resource pool in the target namespace.
[0075] Optionally, the namespace obtaining unit 111 is specifically configured to, if the namespace white list is not empty, confirm the namespaces in the namespace white list as the target namespaces.
[0076] If the namespace white list is empty, all the namespaces in the namespace set are confirmed as the target namespaces.
[0077] Optionally, the application service obtaining unit 112 is specifically configured to determine a set of application services running on the resource pool in the target namespace.
[0078] The target application service in the set of application services is obtained based on a label black list and / or an application program black list.
[0079] Optionally, the application service obtaining unit 112 is specifically configured to obtain a program label of each application service in the set of application services, and obtain an application identifier of an application program to which each application service in the set of application services belongs.
[0080] If a program label corresponding to a first application service in the set of application services does not exist in the label black list, and an application identifier corresponding to the first application service does not exist in the application program black list, the first application service is confirmed as the target application service.
[0081] The grouping module 12 is configured to obtain application program information corresponding to the target application service, and add the target application service into a scheduling group corresponding to the application program information.
[0082] Optionally, the grouping module 12 is specifically configured to obtain an application program to which the target application service belongs, and obtain a grouping label of the application program.
[0083] The target application service is added into a scheduling group corresponding to the grouping label based on the grouping label.
[0084] The scheduling module 13 is configured to schedule the target application service in the scheduling group to run on the cloud server based on a remaining number of application services that can run in the cloud server.
[0085] Optionally, the scheduling module 13 is specifically configured to obtain a service number of application services in the scheduling group, and obtain the remaining number of application services that can run in the cloud server.
[0086] If the number of services is less than or equal to the remaining number, deploying the application corresponding to the scheduling group to the cloud server;
[0087] If the number of services is greater than the remaining number, determining at least one application service in the scheduling group that satisfies the remaining number, and scheduling the at least one application service to run on the cloud server.
[0088] In the embodiment, a target namespace in which an application service needs to be rescheduled is obtained from the namespace set, a target application service is obtained from the target namespace according to the label blacklist and the application blacklist, the calculation amount of the application service scheduling device is reduced, the application service scheduling efficiency is improved, and misoperation on the application service that does not need to be rescheduled is avoided. In addition, the stain label on the target application service can be removed, the application service scheduling device is prevented from rescheduling the target application service to the resource pool again, and the accuracy of the application service scheduling is improved. Application program information corresponding to the target application service is obtained, the target application service is added to a scheduling group corresponding to the application program information, and the target application service in the scheduling group is scheduled to run on the cloud server based on a remaining number of application services that can run in the cloud server. The application services running on the resource pool are grouped according to corresponding application programs, and the application services in the scheduling group are rescheduled to the cloud server, so that the size of the resource pool occupied by the application services is reduced, the required memory and computing power on the resource pool are reduced, and the memory utilization of the cloud server is improved.
[0089] It should be noted that the application service scheduling device provided in the above embodiments is only used as an example to illustrate the division of the above functional modules, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the application service scheduling device and the application service scheduling method provided in the above embodiments belong to the same concept, and the implementation process is described in detail in the method embodiments, which will not be described here.
[0090] The serial numbers of the above embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0091] The embodiments of the present application also provide a computer storage medium, which can store a plurality of instructions, the instructions being suitable for being loaded and executed by a processor to implement the application service scheduling method of the above-described embodiments. Figures 1-4 The specific implementation process can be referred to the specific description of the above-described embodiments, which will not be described here. Figures 1-4
[0092] The application also provides a computer program product, which stores at least one instruction, the at least one instruction is loaded and executed by the processor to perform the method as above Figures 1-4 The application service scheduling method of the embodiment shown in the figure, the specific implementation process can be referred to Figures 1-4 The specific description of the embodiment shown in the figure, will not be described here.
[0093] Please refer to Figure 7 , which shows a structural schematic diagram of an electronic device provided by an exemplary embodiment of the present application. The electronic device in the present application can include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140 and a bus 150. The processor 110, the memory 120, the input device 130 and the output device 140 can be connected through the bus 150.
[0094] The processor 110 can include one or more processing cores. The processor 110 connects various parts within the server through various interfaces and lines, executes various functions of the terminal 100 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one of the following hardware forms: digital signal processing (DSP), field-programmable gate array (FPGA), programmable logic array (PLA). The processor 110 can integrate a combination of one or more of central processing unit (CPU), graphics processing unit (GPU) and modem. Among them, the CPU mainly processes operating system, user page and application program etc.; the GPU is responsible for rendering and drawing display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 110, but be realized by a separate communication chip.
[0095] The memory 120 can include a random access memory (RAM) and can also include a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like, and the operating system can be an Android system, an IOS system developed by Apple Inc., a system developed based on the Android system or the IOS system, or other systems.
[0096] The memory 120 can be divided into an operating system space and a user space, where the operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve good running effects, the operating system allocates corresponding system resources to different third-party applications. However, there are also differences in the demand for system resources in different application scenarios in the same third-party application, for example, in the local resource loading scenario, the third-party application has a higher requirement for the disk reading speed; in the animation rendering scenario, the third-party application has a higher requirement for the GPU performance. However, the operating system and the third-party application are independent of each other, and the operating system often cannot timely perceive the current application scenario of the third-party application, resulting in that the operating system cannot perform targeted system resource adaptation according to the specific application scenario of the third-party application.
[0097] In order to enable the operating system to distinguish the specific application scenario of the third-party application, it is necessary to open up the data communication between the third-party application and the operating system, so that the operating system can obtain the current scenario information of the third-party application at any time, and then perform targeted system resource adaptation based on the current scenario.
[0098] The input device 130 is configured to receive input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is configured to output instructions or data, and the output device 140 includes but is not limited to an electronic device and a speaker, etc. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 are a touch display screen.
[0099] The touch display screen can be designed as a full screen, a curved screen, or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, and the present application does not limit this.
[0100] In addition, those skilled in the art can understand that the structure of the electronic device shown in the above figure does not constitute a limitation on the electronic device, and the terminal can include more or fewer components than the figure, or combine certain components, or different component arrangements. For example, the terminal also includes radio frequency circuit, input unit, sensor, audio circuit, wireless fidelity (WiFi) module, power supply, Bluetooth module and the like, which will not be described here.
[0101] In Figure 7 In the electronic device shown, the processor 110 can be configured to invoke an application service scheduling application stored in the memory 120, applied to a container orchestration engine including a resource pool and a cloud server, and specifically perform the following operations:
[0102] Obtain a target application service running on the resource pool;
[0103] Obtain application program information corresponding to the target application service, and add the target application service to a scheduling group corresponding to the application program information;
[0104] Based on the remaining number of application services that can be run in the cloud server, the target application service in the scheduling group is scheduled to run on the cloud server.
[0105] In one embodiment, when the processor 110 performs the operation of obtaining a target application service running on the resource pool, it specifically performs the following operations:
[0106] Obtain a target namespace in a namespace set;
[0107] Determine the target application service running on the resource pool in the target namespace.
[0108] In one embodiment, when the processor 110 performs the operation of obtaining a target namespace in a namespace set, it specifically performs the following operations:
[0109] If the namespace whitelist is not empty, the namespaces in the namespace whitelist are confirmed as target namespaces;
[0110] If the namespace whitelist is empty, all namespaces in the namespace set are confirmed as the target namespaces.
[0111] In one embodiment, the processor 110, in determining a target application service running on the resource pool in the target namespace, specifically performs the following operations:
[0112] determining a set of application services running on the resource pool in the target namespace;
[0113] obtaining a target application service in the set of application services based on a label blacklist and / or an application program blacklist.
[0114] In one embodiment, the processor 110, in obtaining a target application service in the set of application services based on a label blacklist and / or an application program blacklist, specifically performs the following operations:
[0115] obtaining a program label of each application service in the set of application services and obtaining an application identifier of an application program to which each application service in the set of application services belongs;
[0116] if a program label corresponding to a first application service in the set of application services does not exist in the label blacklist and an application identifier corresponding to the first application service does not exist in the application program blacklist, confirming the first application service as the target application service.
[0117] In one embodiment, the processor 110, in obtaining application program information corresponding to the target application service and adding the target application service to a scheduling group corresponding to the application program information, specifically performs the following operations:
[0118] obtaining an application program to which the target application service belongs and obtaining a group label of the application program;
[0119] adding the target application service to a scheduling group corresponding to the group label based on the group label.
[0120] In one embodiment, the processor 110, in scheduling the target application service in the scheduling group to run on the cloud server based on a remaining number of application services that can run in the cloud server, specifically performs the following operations:
[0121] obtaining a service number of application services in the scheduling group and obtaining a remaining number of application services that can run in the cloud server;
[0122] if the service number is less than or equal to the remaining number, deploying an application program corresponding to the scheduling group to the cloud server;
[0123] If the service quantity is greater than the remaining quantity, at least one application service satisfying the remaining quantity is determined in the scheduling group, and the at least one application service is scheduled to run on the cloud server.
[0124] In the embodiment, a target namespace in which an application service needs to be rescheduled is acquired from the namespace set, a target application service is acquired from the target namespace according to the label blacklist and the application program blacklist, the calculation amount of the application service scheduling device is reduced, the application service scheduling efficiency is improved, and misoperation on the application service that does not need to be rescheduled is avoided. In addition, the stain label on the target application service can be removed, the application service scheduling device is prevented from rescheduling the target application service to the resource pool again, and the accuracy of the application service scheduling is improved. Application program information corresponding to the target application service is acquired, the target application service is added to a scheduling group corresponding to the application program information, and the target application service in the scheduling group is scheduled to run on the cloud server based on a remaining quantity of application services that can run in the cloud server. The application services running on the resource pool are grouped according to corresponding application programs, and the application services in the scheduling group are rescheduled to the cloud server, so that the size of the resource pool occupied by the application services is reduced, the required memory and computing power on the resource pool are reduced, and the memory utilization of the cloud server is improved.
[0125] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, the processes of the above-mentioned embodiments can be included. The storage medium can be a magnetic disc, an optical disc, a read-only memory, or a random access memory.
[0126] The above only describes the preferred embodiments of the present application, and of course cannot limit the scope of the rights of the present application, so equivalent changes made according to the claims of the present application are still within the scope of the present application.
Claims
1. An application service scheduling method, characterized in that, Applied to a container orchestration engine, wherein the container orchestration engine includes a resource pool and cloud servers, the method includes: When there is an application service that has been tagged with a tainted label, the application service tagged with a tainted label is deployed in the resource pool. The application service tagged with a tainted label is an application service added during the expansion process. If, after scaling down, an application service is detected still running on the resource pool, then the target application service currently running on the resource pool is obtained. Remove the tainted tags from the target application service; Obtain the application information corresponding to the target application service, and add the target application service to the scheduling group corresponding to the application information; Based on the remaining number of runnable application services in the cloud server, the target application service in the scheduling group is scheduled to run on the cloud server.
2. The method according to claim 1, characterized in that, The step of obtaining the target application service running on the resource pool includes: Retrieve the target namespace from the namespace collection; Within the target namespace, identify the target application service running on the resource pool.
3. The method according to claim 2, characterized in that, The step of obtaining the target namespace from the namespace set includes: If the namespace whitelist is not empty, then the namespaces in the namespace whitelist are confirmed as the target namespaces; If the namespace whitelist is empty, then all namespaces in the namespace set will be identified as the target namespace.
4. The method according to claim 2, characterized in that, The step of determining the target application service running on the resource pool within the target namespace includes: Determine the set of application services running on the resource pool within the target namespace; Based on the tag blacklist and / or application blacklist, obtain the target application service in the application service set.
5. The method according to claim 4, characterized in that, The step of obtaining the target application service from the application service set based on the tag blacklist and / or application blacklist includes: Obtain the program tag of each application service in the application service set, and obtain the application identifier of the application to which each application service in the application service set belongs; If the program tag corresponding to the first application service in the application service set does not exist in the tag blacklist, and the application identifier corresponding to the first application service does not exist in the application blacklist, then the first application service is identified as the target application service.
6. The method according to claim 1, characterized in that, The step of obtaining the application information corresponding to the target application service and adding the target application service to the scheduling group corresponding to the application information includes: Obtain the application to which the target application service belongs, and obtain the grouping tags of the application; Based on the group label, the target application service is added to the scheduling group corresponding to the group label.
7. The method according to claim 1, characterized in that, The step of scheduling the target application service in the scheduling group to run on the cloud server based on the remaining number of runnable application services in the cloud server includes: Obtain the number of application services in the scheduling group, and obtain the remaining number of runnable application services in the cloud server; If the number of services is less than or equal to the remaining number, the application corresponding to the scheduling group will be deployed to the cloud server; If the number of services is greater than the remaining number, then at least one application service that meets the remaining number is determined in the scheduling group, and the at least one application service is scheduled to run on the cloud server.
8. An application service scheduling device, characterized in that, The device includes: The application service acquisition module is used to deploy the application service with the tainted label in the resource pool when there is an application service with the tainted label. The application service with the tainted label is the application service added during the expansion process. If, after scaling down, an application service is detected still running on the resource pool, then the target application service currently running on the resource pool is obtained. Remove the tainted tags from the target application service; The grouping module is used to obtain the application information corresponding to the target application service and add the target application service to the scheduling group corresponding to the application information; The scheduling module is used to schedule the target application service in the scheduling group to run on the cloud server based on the remaining number of runnable application services in the cloud server.
9. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, which are adapted to be loaded by a processor and executed as method steps as claimed in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and apparatus to maximize return on investment in hybrid cloud environment
US20130339419A1