Method and device for realizing self-adaptive adjustment of service resources based on operator

By defining the service CRD in the operator controller and decoupling the business process using message queues, dynamically expanding and scaling the service resources, the problems of delay and difficulty in adjusting service resources in the PaaS platform work order processing system are solved, and the adaptive adjustment and efficient operation and maintenance of service resources are realized.

CN119718669APending Publication Date: 2025-03-28SHENHUA INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411938407.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The existing technology is difficult to quickly adjust service resources in the PaaS platform work order processing system, resulting in the inability to rapidly expand service resources in scenarios with high load, affecting the operation and maintenance difficulties, and unable to effectively utilize the scalability of business volume.

Method used

By defining the service CRD in the operator controller, the operator controller issues the actual service CR and completes the automatic deployment and operation of the service, and uses the message queue to perform business communication, decouple business processes, and dynamically expand and scale service resources.

Benefits of technology

It realizes adaptive adjustment of service resources, supports dynamic expansion and capacity, guarantees core business service resources, reduces the management and operation and maintenance costs of large-scale service applications, and improves operation and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718669A_ABST
    Figure CN119718669A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and device for realizing service resource adaptive adjustment based on an operator, and relates to the technical field of resource adjustment. The method comprises the following steps: decomposing a work order to be processed into a plurality of services, and determining a corresponding custom resource definition for each service; in the service deployment process, a plurality of services obtained based on decomposition of a work order to be processed and corresponding custom resource definitions generate custom resource instances and issue the custom resource instances to an operator controller; triggering an operator controller to detect the issued custom resource instance, and pulling up a corresponding service scheduling unit instance based on parameters in the custom resource instance; the service scheduling unit instance obtains message queue state information and service real-time load information of the self-defined resource instance, and judges whether an adjustment opportunity is met or not; and when the adjustment opportunity is met, adjusting the configuration resource of the operation service by adopting a corresponding adjustment mode. According to the embodiment provided by the invention, adaptive adjustment of the service resource pool is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of resource regulation, and specifically to a method for implementing adaptive regulation of service resources based on an operator, a device for implementing adaptive regulation of service resources based on an operator, an electronic device, and a corresponding storage medium. Background Art

[0002] Before the development of container technology, most application deployment and operation were handled by operation and maintenance personnel, while developers were responsible for code writing. With the continuous development of docker and kubernetes container technologies, more and more applications have begun to use container technology for deployment and operation. The emergence of container technology has naturally brought developers and operation and maintenance personnel together, resulting in integration (devops). Kubernetes allows users to customize Kubernetes resources using CRD (Custom Resource Definition). CRD is a type (similar to Pod and service) that includes a specifiable name and mode without any programming. CR (Custom Resourse) is a specific instance of CRD; Operator is a custom Kubernetes controller that uses custom resources (CR) to manage applications and their components, supporting the management and automation of operation and maintenance applications. The development of container technology has promoted the rapid development of Operator controllers in the field of application management and automation, and has begun to be used continuously in various application operation and maintenance management scenarios.

[0003] As a large-scale application system, the PaaS platform work order processing system involves various module services. How to better manage the resources used by these services has become a difficult problem. Existing technical solutions are generally based on the monitoring system automatically reporting the service resource usage or the system operation and maintenance personnel manually monitoring the service load usage. The system operation and maintenance personnel then adjust the service usage resources according to the actual resource usage. If the load of a certain service is low, the service resources are scaled down in size or nodes on the container management platform. If the load of a certain service is high, the service resources are scaled up in size or nodes on the container management platform. When resources are tight, it is necessary to repeat the above steps to adjust the service usage resources.

[0004] Existing technical solutions rely on real-time feedback from monitoring systems or operation and maintenance personnel. The feedback itself may already have a large delay. After receiving the feedback, the operation and maintenance personnel make adjustments based on the actual situation, which increases the delay. As a result, the service cannot quickly adjust service resources in high-load scenarios, affecting the operation of the application. In addition, manual intervention in the management and adjustment of services makes operation and maintenance difficult, which is not conducive to the maximum utilization of resources. In the application scenario of the PaaS platform, the platform order business volume in different time periods is very different. Generally, the overall business volume is large during the working time period on weekdays, and the business volume is small in other time periods. The business volume has a large scalability space. It is also difficult for existing technologies to use this feature to adjust service resources in real time according to the business volume to achieve maximum resource utilization. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a method and device for implementing adaptive adjustment of service resources based on an operator, which implements business process decoupling by using message queues to perform business communication between business steps, and then defines the service CRD, so that the operator controller sends the actual CR of the service to complete automatic deployment and operation of the service, supports adaptive adjustment of the service resource pool, and solves at least some of the problems in the background technology.

[0006] In order to achieve the above-mentioned purpose, a method for implementing adaptive adjustment of service resources based on operator is provided in the present application, and the method includes: decomposing a pending work order into a number of services, and determining a corresponding custom resource definition for each service; in the service deployment process, generating a custom resource instance based on the several services decomposed from the pending work order and the corresponding custom resource definition and sending it to the operator controller; triggered by the operator controller detecting the sent custom resource instance, pulling up the corresponding service scheduling unit instance based on the parameters in the custom resource instance; the service scheduling unit instance obtains the message queue status information and service real-time load information of the custom resource instance, and determines whether the adjustment opportunity is met; when the adjustment opportunity is met, the configuration resources of the running service are adjusted using the corresponding adjustment method.

[0007] Optionally, the work order to be processed is decomposed into several services, and a corresponding custom resource definition is determined for each service, including: decomposing the processed work order into a work order startup service, a work order execution service, and a work order end service; creating corresponding message queues for the work order startup service, the work order execution service, and the work order end service respectively; and the custom resource definition corresponding to each service includes several parameters for resource configuration.

[0008] Optionally, pulling up a corresponding service scheduling unit instance based on the parameters in the custom resource instance includes: pulling up a minimum scheduling unit instance of the operation and maintenance service corresponding to the custom resource instance based on the service image, minimum number of services, and service initial resources in the custom resource instance.

[0009] Optionally, the message queue status information includes: the message accumulation amount, message production speed and message consumption speed of the message queue; the service real-time load information includes: service memory usage and service available memory.

[0010] Optionally, the service scheduling unit instance obtains the message queue status information and service real-time load information of the custom resource instance, and determines whether the adjustment opportunity is met, including: within a certain time period, when the message accumulation amount in the message queue is greater than the configured service expansion node message accumulation amount trigger point, and the message production speed is greater than the message consumption speed, the service node expansion opportunity is met; within a certain time period, when the message accumulation amount in the message queue is less than the configured service reduction node message accumulation amount trigger point, and the message production speed is less than the message consumption speed, the service node reduction opportunity is met; within a certain time period, when the ratio of the service memory occupancy to the service available memory is greater than the configured service expansion memory occupancy rate trigger point, the service memory expansion opportunity is met; within a certain time period, when the ratio of the service memory occupancy to the service available memory is less than the configured service reduction memory occupancy rate trigger point, the service memory reduction opportunity is met.

[0011] Optionally, when the adjustment opportunity is met, a corresponding adjustment method is used to adjust the configuration resources of the running service, including: when the service memory expansion opportunity is met, the adjustment method includes: expanding the service memory according to a fixed memory value or an initial memory percentage; when the service memory reduction opportunity is met, the adjustment method includes: reducing the service memory according to a fixed memory value or an initial memory percentage; when the service node expansion opportunity is met, the adjustment method includes: calculating the number of expansion nodes according to the message accumulation amount, message production speed, message consumption speed, configuration time and minimum scheduling unit consumption speed, and expanding the nodes according to the calculated number of expansion nodes; when the service node reduction opportunity is met, the adjustment method includes: calculating the number of reduction nodes according to the message production speed, message consumption speed, minimum scheduling unit consumption speed and configuration service margin, and reducing the nodes according to the calculated number of reduction nodes.

[0012] Optionally, the operator controller, the service, and the service scheduling unit are set in different namespaces, and the different namespaces are set in the container cloud cluster.

[0013] The present application also provides a device for implementing adaptive adjustment of service resources based on an operator, the device comprising: a service definition module, used to decompose a pending work order into a number of services, and determine a corresponding custom resource definition for each service; an instance delivery module, used to generate a custom resource instance based on the several services decomposed from the pending work order and the corresponding custom resource definition during the service deployment process, and deliver it to the operator controller; a scheduling trigger module, used to trigger the operator controller to detect the delivered custom resource instance, and pull up the corresponding service scheduling unit instance based on the parameters in the custom resource instance; an adjustment monitoring module, used for the service scheduling unit instance to obtain the message queue status information and service real-time load information of the custom resource instance, and determine whether the adjustment opportunity is met; and an adjustment execution module, used to use the corresponding adjustment method to adjust the configuration resources of the running service when the adjustment opportunity is met.

[0014] The present application also provides an electronic device, comprising: at least one processor; a memory connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the aforementioned method of adaptively adjusting service resources based on an operator by executing the instructions stored in the memory.

[0015] The present application also provides a machine-readable storage medium on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the aforementioned method for implementing adaptive adjustment of service resources based on an operator.

[0016] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the aforementioned method for adaptively adjusting service resources based on an operator.

[0017] The above technical solution has the following beneficial effects:

[0018] Supports adaptive adjustment of services to achieve dynamic expansion and contraction to ensure core business service resources; supports configuration of specified strategies to manage the operation and maintenance of services, reduces the management and operation costs of large-scale service applications, and improves operation and maintenance efficiency.

[0019] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:

[0021] Figure 1 The following is a schematic diagram showing the steps of a method for implementing adaptive adjustment of service resources based on an operator according to an embodiment of the present application;

[0022] Figure 2 A schematic diagram of a PaaS service management solution in the prior art is shown schematically;

[0023] Figure 3 A schematic diagram of a method for implementing adaptive adjustment of service resources based on an operator according to an embodiment of the present application is schematically shown;

[0024] Figure 4 The schematic diagram shows the structure of the device for implementing adaptive adjustment of service resources based on the operator according to the implementation mode of the present application;

[0025] Figure 5 The internal structure of an electronic device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0026] The specific implementation of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present application, and is not used to limit the embodiment of the present application.

[0027] Figure 1 The following is a schematic diagram showing the steps of a method for implementing adaptive adjustment of service resources based on an operator according to an embodiment of the present application. Figure 1 As shown, a method for implementing adaptive adjustment of service resources based on an operator, the method comprising:

[0028] S01. Decompose the work order to be processed into several services, and determine the corresponding custom resource definition (CRD, Custom Resource Definition) for each service;

[0029] S02. In the service deployment process, a custom resource (CR) instance is generated based on the services decomposed from the to-be-processed work order and the corresponding custom resource definition and sent to the operator controller;

[0030] S03. The operator controller is triggered to detect the issued custom resource instance, and to pull up the corresponding service scheduling unit instance based on the parameters in the custom resource instance; the service scheduling unit here may be a pod.

[0031] S04, the service scheduling unit instance obtains the message queue status information of the custom resource instance and the service real-time load information, and determines whether the adjustment opportunity is met;

[0032] S05. When the adjustment opportunity is met, the configuration resources of the running service are adjusted using a corresponding adjustment method.

[0033] Through the above implementation methods, the operator controller is used to adaptively adjust services to achieve dynamic expansion and contraction, thereby ensuring core business service resources. Adaptive adjustment of service resources is achieved, resource utilization is improved, and resources are used to the maximum extent.

[0034] Figure 2 The schematic diagram of the PaaS (Platform as a Service) service management scheme in the prior art is shown. As shown in the figure, it uses container management services to directly manage business resources, which cannot adapt to resource self-regulation. It can only be adjusted by system operation and maintenance personnel according to actual resource usage. Figure 3 The schematic diagram of the scheme of the method for implementing the adaptive adjustment of service resources based on the operator according to the implementation mode of the present application is shown schematically. Figure 3 As shown, an operator controller is introduced into the container cloud cluster, and is triggered and controlled based on custom resources CR, and the resource adaptive adjustment mechanism is integrated into the operator controller, thereby realizing resource adaptive adjustment in the container cloud cluster.

[0035] In some implementations of the present application, the work order to be processed is decomposed into several services, and the corresponding custom resource definition is determined for each service, including: decomposing the processed work order into a work order start service, a work order execution service, and a work order end service; creating corresponding message queues for the work order start service, the work order execution service, and the work order end service; the custom resource definition corresponding to each service includes several parameters for resource configuration. For example: the execution process of the PaaS component work order is divided into steps such as work order start, work order specific link execution, and work order end, and the corresponding message queues are created for the scheduling of the corresponding steps. The specific scheduling of the step is first produced by the upstream service (message producer) to send the execution message to the message queue, and then the downstream service (message consumer) obtains the message from the message queue to implement the specific logical execution of the step. After completing the execution of the current step, the next step of the work order execution is continued to be scheduled. At this time, the current downstream service continues to produce the next step execution message as the message producer of the next step, and the next step is executed according to the previous process. The specific scheduling service of the PaaS platform is divided into three services: orderStart, orderExec, and orderFinish. The orderStart service is responsible for starting the work order, the orderExec service is responsible for executing the specific steps of the work order, and the orderFinish service is responsible for ending the work order. Three message queues, orderStartQueue, orderExecQueue, and orderFinishQueue, are created for the three services, corresponding to the work order start message, the work order specific step execution message, and the work order end message. Then define the service CRD for the three services. The CRD defines several parameters for resource configuration, including: service image, minimum service number podNum, service initial resources (initCpu, initMemory), service priority orderPriority, service load limit (including service cpu limit cpuPercentLimit, memory percentage limit memoryPercentLimit, etc.), message queue queue, message management console address queueConsoleUrl, etc.

[0036] In some embodiments of the present application, the corresponding service scheduling unit instance is pulled up based on the parameters in the custom resource instance, including: pulling up a minimum scheduling unit instance of the operation and maintenance service corresponding to the custom resource instance based on the service image, the minimum number of services, and the service initial resources in the custom resource instance. Specifically, the operator controller pulls up the corresponding service pod based on the service image image, the minimum number of services podNum, and the service initial resources (initCpu, initMemory) in the CR instance. Pod is the smallest deployable computing unit that can be created and managed in Kubernetes. Pod is one or more containers that share storage, network, and specifications for how to run these containers.

[0037] Among them, the custom resource instance is obtained after instantiation according to the aforementioned custom resource definition. For example, the issued orderExec service CR is: orderPriority=1, cpuPercentLimit=70%, memoryPercentLimit=70%, queue=OrderExecQueue, queueConsoleUrl=http: / / 192.168.1.73:9678, in addition to the account information of the message console connection, etc.

[0038] In some embodiments of the present application, the message queue status information includes: the message accumulation amount, message production speed and message consumption speed of the message queue; the service real-time load information includes: service memory usage and service available memory. This embodiment determines the adjustment timing through the message queue status information and service real-time load information. Specifically, the adjustment timing is determined by the message accumulation amount, message production speed and message consumption speed of the message queue as well as the service memory usage and service available memory. The above information can be obtained by the following methods: regularly calling the message queue management platform queueConsoleUrl to obtain the message accumulation amount, message production speed and message consumption speed of the message queue defined by the queue in the current CR, and calling the k8s API to obtain the current service load, such as memory usage and CPU usage.

[0039] In some embodiments of the present application, the service scheduling unit instance obtains the message queue state information and service real-time load information of the custom resource instance, and determines whether the adjustment opportunity is met, including: within a certain time period, the message accumulation amount of the message queue is greater than the configured service expansion node message accumulation amount trigger point, and the message production speed is greater than the message consumption speed, the service node expansion opportunity is met; within a certain time period, the message accumulation amount of the message queue is less than the configured service shrinkage node message accumulation amount trigger point, and the message production speed is less than the message consumption speed, the service node shrinkage opportunity is met; in this embodiment, if the message accumulation amount of the message queue is large and is in an increasing trend, the service node needs to be expanded, otherwise the service node can be shrunk. Within a certain time period, when the ratio of the service memory occupancy to the service available memory is greater than the configured service expansion memory occupancy rate trigger point, the service memory expansion opportunity is met; within a certain time period, when the ratio of the service memory occupancy to the service available memory is less than the configured service shrinkage memory occupancy rate trigger point, the service memory shrinkage opportunity is met. This embodiment determines the expansion or shrinkage of the service memory by the memory proportion. The certain time period in this embodiment can be a preset time period or a specified time period.

[0040] In some embodiments of the present application, when the adjustment opportunity is met, the configuration resources of the running service are adjusted using a corresponding adjustment method, including: when the service memory expansion opportunity is met, the adjustment method includes: expanding the service memory according to a fixed memory value or an initial memory percentage; when the service memory reduction opportunity is met, the adjustment method includes: reducing the service memory according to a fixed memory value or an initial memory percentage.

[0041] When the opportunity for service node expansion is met, the adjustment method includes: calculating the number of expansion nodes according to the message accumulation amount, message production speed, message consumption speed, configuration time and the minimum scheduling unit consumption speed, and performing node expansion according to the calculated number of expansion nodes. For example, the number of expansion nodes is calculated by the following formula: number of expansion nodes = [message accumulation amount + (message production speed - message consumption speed) × configuration time] / (configuration time × pod consumption speed).

[0042] When the time for reducing the capacity of the service nodes is met, the adjustment method includes: calculating the number of reduced nodes according to the message production speed, the message consumption speed, the minimum scheduling unit consumption speed and the configuration service margin, and reducing the nodes according to the calculated number of reduced nodes. For example, the number of reduced nodes is calculated by the following formula: number of reduced nodes = (message consumption speed - message production speed) / pod consumption speed - configuration service margin.

[0043] The above adjustment actions are based on the load limits cpuPercentLimit and memoryPercentLimit, message queue and other configuration information in the CR, based on the current message queue and service load real-time information, and adaptively adjust the service. The specific adjustment logic is as described above.

[0044] In some embodiments of the present application, the operator controller, the service, and the service scheduling unit are set in different namespaces, and the different namespaces are set in the container cloud cluster. Figure 2 As shown, the service is deployed in namespace 1, the service scheduling unit is deployed in namespace 2, and the operator controller is set in another namespace. Namespaces are used for additional information to distinguish similar functions, classes, variables, etc. The design in this embodiment can make the calling of the operator controller, service and service scheduling unit clearer.

[0045] Through the above implementation methods, adaptive adjustment services are implemented to achieve dynamic expansion and contraction, ensuring core business service resources; support the configuration of specified strategies to manage the operation and maintenance of services, reduce the management and operation and maintenance costs of large-scale service applications, and improve operation and maintenance efficiency.

[0046] Based on the same inventive concept, the present application also provides a device for implementing adaptive adjustment of service resources based on operator. Figure 4 The schematic diagram shows the structure of the device for implementing the adaptive adjustment of service resources based on the operator according to the implementation mode of the present application. Figure 4 As shown, the device includes: a service definition module, which is used to decompose the pending work order into several services and determine the corresponding custom resource definition for each service; an instance delivery module, which is used to generate a custom resource instance based on the several services decomposed from the pending work order and the corresponding custom resource definition during the service deployment process and deliver it to the operator controller; a scheduling trigger module, which is used to trigger the operator controller to detect the delivered custom resource instance and pull up the corresponding service scheduling unit instance based on the parameters in the custom resource instance; an adjustment monitoring module, which is used for the service scheduling unit instance to obtain the message queue status information and service real-time load information of the custom resource instance to determine whether the adjustment opportunity is met; and an adjustment execution module, which is used to use the corresponding adjustment method to adjust the configuration resources of the running service when the adjustment opportunity is met.

[0047] In some optional implementations of the present application, the work order to be processed is decomposed into several services, and a corresponding custom resource definition is determined for each service, including: decomposing the processed work order into a work order startup service, a work order execution service, and a work order end service; creating corresponding message queues for the work order startup service, the work order execution service, and the work order end service respectively; and the custom resource definition corresponding to each service includes several parameters for resource configuration.

[0048] In some optional embodiments of the present application, a corresponding service scheduling unit instance is pulled up based on the parameters in the custom resource instance, including: pulling up a minimum scheduling unit instance of the operation and maintenance service corresponding to the custom resource instance based on the service image, minimum number of services, and service initial resources in the custom resource instance.

[0049] In some optional implementations of the present application, the message queue status information includes: the message accumulation amount, message production speed and message consumption speed of the message queue; the service real-time load information includes: service memory occupancy and service available memory.

[0050] In some optional implementations of the present application, the service scheduling unit instance obtains the message queue status information and service real-time load information of the custom resource instance, and determines whether the adjustment opportunity is met, including: within a certain time period, when the message accumulation amount in the message queue is greater than the configured service expansion node message accumulation amount trigger point, and the message production speed is greater than the message consumption speed, the service node expansion opportunity is met; within a certain time period, when the message accumulation amount in the message queue is less than the configured service reduction node message accumulation amount trigger point, and the message production speed is less than the message consumption speed, the service node reduction opportunity is met; within a certain time period, when the ratio of the service memory occupancy to the service available memory is greater than the configured service expansion memory occupancy rate trigger point, the service memory expansion opportunity is met; within a certain time period, when the ratio of the service memory occupancy to the service available memory is less than the configured service reduction memory occupancy rate trigger point, the service memory reduction opportunity is met.

[0051] In some optional implementations of the present application, when the adjustment opportunity is met, the configuration resources of the running service are adjusted by a corresponding adjustment method, including: when the service memory expansion opportunity is met, the adjustment method includes: expanding the service memory according to a fixed memory value or an initial memory percentage; when the service memory reduction opportunity is met, the adjustment method includes: reducing the service memory according to a fixed memory value or an initial memory percentage; when the service node expansion opportunity is met, the adjustment method includes: calculating the number of expansion nodes according to the message accumulation amount, the message production speed, the message consumption speed, the configuration time and the minimum scheduling unit consumption speed, and expanding the nodes according to the calculated number of expansion nodes; when the service node reduction opportunity is met, the adjustment method includes: calculating the number of reduction nodes according to the message production speed, the message consumption speed, the minimum scheduling unit consumption speed and the configuration service margin, and reducing the nodes according to the calculated number of reduction nodes.

[0052] In some optional implementations of the present application, the operator controller, the service, and the service scheduling unit are set in different namespaces, and the different namespaces are set in a container cloud cluster.

[0053] The specific definition of each functional module in the above-mentioned device for implementing adaptive adjustment of service resources based on operator can be found in the above-mentioned definition of the method for implementing adaptive adjustment of service resources based on operator, which will not be repeated here. Each module in the above-mentioned system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It also achieves the advantages of adaptive adjustment of resources.

[0054] In some embodiments of the present application, an electronic device is also provided, comprising: at least one processor; a memory connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the aforementioned method for implementing service resource adaptive adjustment based on an operator. Its internal structure diagram can be as follows Figure 5 shown. Figure 5The internal structure diagram of an electronic device according to an implementation manner of the present application is schematically shown. The electronic device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected via a system bus. Among them, the processor A01 of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The network interface A02 of the electronic device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a method for adaptively adjusting service resources based on an operator is implemented.

[0055] Those skilled in the art will understand that Figure 5 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0056] In one embodiment provided in the present application, a machine-readable storage medium is provided, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the aforementioned method for implementing adaptive adjustment of service resources based on an operator.

[0057] In one embodiment provided in the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the aforementioned method for adaptively adjusting service resources based on an operator.

[0058] 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.

[0059] 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.

[0060] 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.

[0061] 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. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0062] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0063] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0064] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0065] 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.

[0066] The above are only embodiments of the present application and are 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 within the scope of the claims of the present application.

Claims

1. A method for implementing adaptive adjustment of service resources based on operator, characterized in that: The method includes: Decompose the pending work orders into several services and determine the corresponding custom resource definitions for each service; In the service deployment process, a custom resource instance is generated based on the services decomposed from the to-be-processed work order and the corresponding custom resource definition and sent to the operator controller; The operator controller is triggered when it detects a sent custom resource instance and starts a corresponding service scheduling unit instance based on the parameters in the custom resource instance; The service scheduling unit instance obtains the message queue status information and service real-time load information of the custom resource instance to determine whether the adjustment opportunity is met; When the adjustment opportunity is met, the configuration resources of the running service are adjusted using the corresponding adjustment method.

2. The method according to claim 1, characterized in that Decompose the pending work orders into several services and determine the corresponding custom resource definitions for each service, including: Decomposing the work order processing into a work order start service, a work order execution service and a work order end service; Create corresponding message queues for the work order start service, work order execution service and work order end service respectively; The custom resource definition corresponding to each service includes several parameters for resource configuration.

3. The method according to claim 1, characterized in that Pulling up a corresponding service scheduling unit instance based on the parameters in the custom resource instance includes: A minimum scheduling unit instance of the operation and maintenance service corresponding to the custom resource instance is pulled up based on the service image, the minimum number of services, and the service initial resources in the custom resource instance.

4. The method according to claim 1, characterized in that: The message queue status information includes: the message accumulation amount, message production speed and message consumption speed of the message queue; The service real-time load information includes: service memory usage and service available memory.

5. The method according to claim 4, characterized in that The service scheduling unit instance obtains the message queue status information and service real-time load information of the custom resource instance, and determines whether the adjustment opportunity is met, including: In a certain period of time, when the message accumulation in the message queue is greater than the configured service expansion node message accumulation trigger point, and the message production speed is greater than the message consumption speed, the service node expansion opportunity is met; In a certain period of time, when the message accumulation amount in the message queue is less than the configured trigger point for reducing the capacity of the service node, and the message production speed is less than the message consumption speed, the service node is eligible for reduction. When the ratio of service memory usage to service available memory is greater than the configured service expansion memory usage trigger point within a certain period of time, the service memory expansion opportunity is met; When the ratio of service memory usage to service available memory is less than the configured service memory usage trigger point within a certain period of time, the timing for service memory reduction is met.

6. The method according to claim 5, characterized in that When the adjustment opportunity is met, the configuration resources of the running service are adjusted using the corresponding adjustment method, including: When the opportunity for service memory expansion is met, the adjustment method includes: expanding the service memory according to a fixed memory value or an initial memory percentage; When the opportunity for reducing the service memory is met, the adjustment method includes: reducing the service memory according to a fixed memory value or an initial memory percentage; When the opportunity for service node expansion is met, the adjustment method includes: calculating the number of expansion nodes according to the message accumulation amount, message production speed, message consumption speed, configuration time and minimum scheduling unit consumption speed, and performing node expansion according to the calculated number of expansion nodes; When the opportunity for reducing the capacity of service nodes is met, the adjustment method includes: calculating the number of reduced nodes according to the message production speed, message consumption speed, minimum scheduling unit consumption speed and configuration service margin, and reducing the nodes according to the calculated number of reduced nodes.

7. The method according to any one of claims 1 to 6, characterized in that: The operator controller, service and service scheduling unit are arranged in different namespaces, and the different namespaces are arranged in a container cloud cluster.

8. A device for implementing adaptive adjustment of service resources based on operator, characterized in that: The device includes: The service definition module is used to decompose the pending work orders into several services and determine the corresponding custom resource definition for each service; An instance delivery module is used to generate a custom resource instance based on the services decomposed from the to-be-processed work order and the corresponding custom resource definition during the service deployment process and deliver it to the operator controller; A scheduling trigger module, used to trigger the operator controller to detect the issued custom resource instance and pull up the corresponding service scheduling unit instance based on the parameters in the custom resource instance; An adjustment monitoring module is used for the service scheduling unit instance to obtain the message queue status information and service real-time load information of the custom resource instance to determine whether the adjustment opportunity is met; and The adjustment execution module is used to adjust the configuration resources of the running service by adopting a corresponding adjustment method when the adjustment opportunity is met.

9. An electronic device, characterized in that: include: at least one processor; a memory connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the steps of the method for adaptively adjusting service resources based on an operator as described in any one of claims 1 to 7 by executing the instructions stored in the memory.

10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the steps of the method for implementing adaptive adjustment of service resources based on an operator as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Multi-service queue elastic consumption regulation and control method based on database load awareness

    CN120295795A