A method, device, equipment and medium for adjusting function computing resource pool
By obtaining function running container data and using preset models to predict computing power consumption requirements, resource pool adjustments are made to solve the time loss problem caused by function cold start, improve resource utilization and adjustment efficiency, and reduce resource consumption.
Patent Information
- Application Number
- CN202210319331.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-03-29
AI Technical Summary
During the function computing resource pool adjustment process, how can we avoid the time loss caused by function cold start, improve resource utilization and adjustment efficiency, and reduce resource consumption?
By obtaining data information from the function running container, the preset model is used to predict the computing power consumption demand for the next cycle, and resource adjustments are made through the resource pool controller, including expansion or reduction.
This effectively avoids the time loss caused by function cold start, improves resource utilization and the efficiency of function computing resource pool adjustment, and reduces resource consumption.
Smart Images

Figure CN114780202B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing, and in particular to a method, device, equipment and medium for adjusting a function computing resource pool. Background Art
[0002] At present, with the rapid development of cloud computing technology, the migration of applications to the cloud is gradually deepening. The rapid construction, deployment, and operation of applications based on various cloud-based infrastructures has become an important option for developers. The technical concepts and engineering practices of cloud native are gradually maturing, and the cloud nativeization of applications has become an important trend. Cloud native technology has become an important engine to drive business growth. At the same time, as an important supporting technology for new infrastructure and an important technical field of cloud native, Serverless does not require users to pay attention to computing, storage, network and other infrastructure. All resources are provided to users in the form of services. Through Serverless-related technologies, users can be provided with an agile and on-demand way of using resources, which is of great significance for building elastic, scalable, and observable applications. Function Compute, as an important product form of Serverless technology, provides users with fully managed Serverless computing services, supporting execution environments for multiple programming languages and full-process functional support such as development, debugging, and log monitoring. Users only need to write function code packages or application images and configure running parameters to run the code flexibly and securely; user functions are triggered for execution in an event-driven manner and consume resources in full accordance with the actual task execution; users can quickly build any type of application and service based on the Function Compute service and only pay for the resources consumed by the actual task execution; Function Compute provides extreme 0-N elastic scaling capabilities, scaling resources according to the size of user request traffic. The expansion process from 0 to N is post-processed and is started only after user traffic comes in. In particular, there is a function cold start process during the expansion process, which generally takes a long time and has a greater impact in scenarios that are sensitive to latency.
[0003] As can be seen from the above, during the function computing resource pool adjustment process, how to avoid time loss caused by function cold start, effectively improve resource utilization and the efficiency of function computing resource pool adjustment, and reduce resource consumption are problems to be solved in this field. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, device, and medium for adjusting a function computing resource pool, which can effectively improve resource utilization and the efficiency of adjusting the function computing resource pool, and reduce resource consumption. The specific solution is as follows:
[0005] In a first aspect, the present application discloses a method for adjusting a function computing resource pool, comprising:
[0006] Obtain the logic code to be run and send it to the function running container in the preset pod; the preset pod includes the function running container and the sidecar container;
[0007] Obtain function data information in the function running container based on the sidecar container in the preset pod, and save the function data information to a preset data collection library;
[0008] Inputting the function data information in the preset data acquisition library into a preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, and sending the predicted computing power consumption demand to a preset resource pool controller;
[0009] The resources of the preset resource pool are adjusted through the preset resource pool controller based on the computing power consumption demand.
[0010] Optionally, before obtaining the logic code to be run and sending the logic code to be run to the function running container in the preset pod, the process further includes:
[0011] Establish a communication connection between the Kubernetes container and the preset pod, and then control the function running container and the sidecar container in the preset pod based on the orchestration and scheduling function of the Kubernetes container.
[0012] Optionally, after obtaining the logic code to be run and sending the logic code to be run to the function running container in the preset pod, the method further includes:
[0013] Running the logic code to be run through the function running container to obtain a result after the run;
[0014] The result after the operation is output and saved to a third-party storage through a preset output method; the preset output method includes synchronous return or asynchronous return.
[0015] Optionally, inputting the function data information in the preset data collection library into a preset model to use the preset model to predict the computing power consumption demand for the next cycle includes:
[0016] The function data information in the preset data acquisition library is input into a preset time series prediction model, and based on the preset time series prediction model, the computing power consumption demand of the next cycle is predicted using a composite sequence decomposition prediction method.
[0017] Optionally, the predicting of the computing power consumption demand for the next period by using a composite sequence decomposition prediction method based on the preset time series prediction model includes:
[0018] Determining a computing power consumption requirement sequence based on the function data information;
[0019] A seasonal index is calculated based on the preset time series prediction model using a weighted moving average trend elimination method, and the seasonal index is eliminated from the computing power consumption demand sequence to obtain the computing power consumption demand for the next cycle.
[0020] Optionally, the predicting of the computing power consumption demand for the next period by using a composite sequence decomposition prediction method based on the preset time series prediction model includes:
[0021] Determining a prediction period for predicting computing power consumption demand using the preset time series model by a preset period determination method;
[0022] Based on the preset time series prediction model, the computing power consumption demand for the next week is predicted using the composite sequence decomposition prediction method and the prediction period.
[0023] Optionally, adjusting the resources of the preset resource pool based on the computing power consumption requirement by the preset resource pool controller includes:
[0024] Determining, by the preset resource pool controller and based on the computing power consumption requirement, a size relationship between the computing power consumption requirement and the size of the preset resource pool;
[0025] Determine the scale of unoccupied resources from the preset resource pool; if the computing power consumption demand is greater than the scale of unoccupied resources, expand the scale of unoccupied resources based on the preset resource pool controller; if the computing power consumption demand is less than the scale of unoccupied resources, shrink the scale of unoccupied resources based on the preset resource pool controller.
[0026] In a second aspect, the present application discloses a function computing resource pool adjustment device, comprising:
[0027] A code sending module is used to obtain the logic code to be run and send the logic code to be run to the function running container in the preset pod; the preset pod includes the function running container and the sidecar container;
[0028] An information storage module is used to obtain the function data information in the function running container based on the sidecar container in the preset pod, and save the function data information to a preset data collection library;
[0029] A prediction module, configured to input the function data information in the preset data collection library into a preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, and send the predicted computing power consumption demand to a preset resource pool controller;
[0030] A resource adjustment module is used to adjust the resources of the preset resource pool through the preset resource pool controller and based on the computing power consumption demand.
[0031] In a third aspect, the present application discloses an electronic device, comprising:
[0032] Memory, used to store computer programs;
[0033] A processor is used to execute the computer program to implement the aforementioned function computing resource pool adjustment method.
[0034] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed function computing resource pool adjustment method are implemented.
[0035] It can be seen that the present application provides a method for adjusting a function computing resource pool, including obtaining logic code to be run, and sending the logic code to be run to a function running container in a preset pod; the preset pod includes the function running container and the sidecar container; based on the sidecar container in the preset pod, the function data information in the function running container is obtained, and the function data information is saved to a preset data acquisition library; the function data information in the preset data acquisition library is input into a preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, and the predicted computing power consumption demand is sent to the preset resource pool controller; through the preset resource pool controller and based on the computing power consumption demand, the resources of the preset resource pool are adjusted. The present application uses the function running container and the sidecar container in the preset pod to obtain and save function data information, and then inputs the function data information into the preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, so as to adjust the resources of the preset resource pool, thereby effectively avoiding the time loss caused by the cold start of the function, effectively improving resource utilization, further increasing the efficiency of the function computing resource pool adjustment, and reducing resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0037] Figure 1 This is a flow chart of a function computing resource pool adjustment method disclosed in this application;
[0038] Figure 2 This is a flow chart of a function computing resource pool adjustment method disclosed in this application;
[0039] Figure 3 This is a specific flow chart of a function computing resource pool adjustment method disclosed in this application;
[0040] Figure 4 A topology diagram of a function computing resource pool adjustment method disclosed in this application;
[0041] Figure 5 This is a schematic diagram of the structure of a function computing resource pool adjustment device disclosed in this application;
[0042] Figure 6 This is a structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION
[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0044] In the current context, with the rapid development of cloud computing and the increasing adoption of cloud-based applications, developers are increasingly choosing to rapidly build, deploy, and run applications using cloud-based infrastructure. Cloud-native technology and engineering practices are maturing, and the shift to cloud-native applications is becoming a significant trend. Cloud-native technology has become a key driver of business growth and a crucial supporting technology for new infrastructure. As can be seen from the preceding, avoiding time lost due to cold starts during function pool adjustments, effectively improving resource utilization and the efficiency of function pool adjustments, and reducing resource consumption are unresolved challenges in this area.
[0045] See also Figure 1As shown, an embodiment of the present invention discloses a method for adjusting a function computing resource pool, which may specifically include:
[0046] Step S11: Obtain the logic code to be run, and send the logic code to be run to the function running container in the preset pod; the preset pod includes the function running container and the sidecar container.
[0047] In this embodiment, before obtaining the logic code to be run and sending the logic code to be run to the function running container in the preset pod, it also includes: establishing a communication connection between the Kubernetes container and the preset pod, and then controlling the function running container and the sidecar container in the preset pod based on the orchestration and scheduling function of the Kubernetes container.
[0048] In this embodiment, after obtaining the logic code to be run and sending the logic code to be run to the function running container in the preset pod, the logic code to be run is run through the function running container to obtain the result after running, and then the result after running is output and saved to a third-party storage through a preset output method; the preset output method includes synchronous return or asynchronous return.
[0049] Step S12: Based on the sidecar container in the preset pod, obtain the function data information in the function running container, and save the function data information to a preset data collection library.
[0050] Step S13: inputting the function data information in the preset data acquisition library into a preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, and sending the predicted computing power consumption demand to the preset resource pool controller.
[0051] In this embodiment, after the function data information is saved to the preset data acquisition library, the function data information in the preset data acquisition library is input into the preset model, and then the preset model is used to predict the computing power consumption demand for the next cycle, and the predicted computing power consumption demand is sent to the preset resource pool controller.
[0052] Step S14: adjusting the resources of the preset resource pool based on the computing power consumption requirement through the preset resource pool controller.
[0053] In this embodiment, after the predicted computing power consumption demand is sent to the preset resource pool controller, the preset resource pool controller determines the size relationship between the computing power consumption demand and the scale of the preset resource pool based on the computing power consumption demand, and then determines the unoccupied resource scale from the preset resource pool; if the computing power consumption demand is greater than the unoccupied resource scale, the unoccupied resource scale is expanded based on the preset resource pool controller; if the computing power consumption demand is less than the unoccupied resource scale, the unoccupied resource scale is reduced based on the preset resource pool controller.
[0054] In this embodiment, the logic code to be run is obtained, and the logic code to be run is sent to the function running container in the preset pod; the preset pod includes the function running container and the sidecar container; the function data information in the function running container is obtained based on the sidecar container in the preset pod, and the function data information is saved to the preset data acquisition library; the function data information in the preset data acquisition library is input into the preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, and the predicted computing power consumption demand is sent to the preset resource pool controller; through the preset resource pool controller and based on the computing power consumption demand, the resources of the preset resource pool are adjusted. This application uses the function running container and the sidecar container in the preset pod to obtain and save function data information, and then inputs the function data information into the preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, so as to adjust the resources of the preset resource pool, thereby effectively avoiding the time loss caused by the cold start of the function, and can effectively improve resource utilization, further increase the efficiency of the function computing resource pool adjustment, and reduce resource consumption.
[0055] See also Figure 2 As shown, an embodiment of the present invention discloses a method for adjusting a function computing resource pool, which may specifically include:
[0056] Step S21: Obtain the logic code to be run and send the logic code to be run to the function running container in the preset pod; the preset pod includes the function running container and the sidecar container.
[0057] Step S22: Based on the sidecar container in the preset pod, obtain the function data information in the function running container, and save the function data information to the preset data collection library.
[0058] Step S23: inputting the function data information in the preset data collection library into a preset time series prediction model, and determining a computing power consumption demand sequence based on the function data information.
[0059] Step S24: Determine the prediction period for the preset time series model to predict the computing power consumption demand through a preset period determination method.
[0060] Step S25: Based on the preset time series prediction model and the prediction period, the seasonal index is calculated using the weighted moving average trend elimination method, and the seasonal index is eliminated from the computing power consumption demand sequence to obtain the computing power consumption demand for the next period, and the predicted computing power consumption demand is sent to the preset resource pool controller.
[0061] Step S26: adjusting the resources of the preset resource pool through the preset resource pool controller based on the computing power consumption requirement.
[0062] In this embodiment, the logic code to be run is obtained and sent to the function running container in the preset pod; the preset pod includes the function running container and the sidecar container; based on the sidecar container in the preset pod, the function data information in the function running container is obtained, and the function data information is saved to the preset data acquisition library, the function data information in the preset data acquisition library is input into the preset time series prediction model, the computing power consumption demand sequence is determined based on the function data information, the prediction period for predicting the computing power consumption demand by the preset time series model is determined by the preset period determination method, the seasonal index is calculated based on the preset time series prediction model and the prediction period using the weighted moving average trend elimination method, and the seasonal index is eliminated from the computing power consumption demand sequence to obtain the computing power consumption demand of the next period, and the predicted computing power consumption demand is sent to the preset resource pool controller, and the resources of the preset resource pool are adjusted based on the preset resource pool controller and the computing power consumption demand. As can be seen from the above, this application can avoid time loss caused by function cold start during the function computing resource pool adjustment process, effectively improve resource utilization and the efficiency of function computing resource pool adjustment, and reduce resource consumption.
[0063] For example, Figure 3As shown, the preset pod includes the function running container and the sidecar container. After obtaining the logic code to be run and sending the logic code to be run to the function running container in the preset pod, the function data information in the function running container is obtained based on the sidecar container in the preset pod, and the function data information is saved in the data acquisition component. The function data information in the data acquisition component is input into the model prediction calculation component, that is, the preset time series prediction model. The computing power consumption demand sequence is determined based on the function data information, and the prediction period for predicting the computing power consumption demand by the preset time series model is determined by the preset period determination method. The seasonal index is calculated based on the preset time series prediction model and the prediction period using the weighted moving average trend elimination method, and the seasonal index is eliminated from the computing power consumption demand sequence to obtain the computing power consumption demand of the next period, and the predicted computing power consumption demand is sent to the preset resource pool controller. The resources of the preset resource pool are adjusted through the preset resource pool controller and based on the computing power consumption demand.
[0064] Among them, the computing power consumption demand sequence is determined based on the function data information, and the prediction period for predicting the computing power consumption demand by the preset time series model is determined by a preset period determination method. The seasonal index is calculated based on the preset time series prediction model and the prediction period using the weighted moving average trend elimination method, and the seasonal index is eliminated from the computing power consumption demand sequence to obtain the computing power consumption demand for the next period. The specific process is to form a time series data set with the resources consumed per unit time in a period of time. The resources consumed by function applications in a certain period of time as the business volume changes have a certain trend. In the rapid business growth stage, the computing power consumption of function applications has an upward trend, and in the business recession stage, the computing power consumption has a downward trend. For some function applications, 9-10 am and 24-16 pm every day are traffic peak periods, and off-get off work time is the trough period. For other applications, 12-13 pm and 21-22 pm are their traffic peak periods. Their computing power consumption has obvious seasonality in units of days and has a seasonal component. Function instances are data reported by the sidecar container for each function request execution, including the single execution time and the memory configuration of the function instance. After being reported to the data collection component, the computing power consumed by this call is calculated. The computing power consumed by the function is accumulated hourly, and up to 240 hours of data are taken to form a data set with hours as the time series x-axis and resource consumption computing power as the y-axis, such as Figure 4As shown, the observed value of computing power consumption for each hour is represented as Yt (t=1, 2, 3, 4...240). The data set includes a maximum of the computing power consumption observations of the past 240 hours (the past 10 days). This prediction method does not consider the consumption data before 240 hours. For newly created function data, if it is impossible to collect a full 240 hours of data, it is filled with zeros to indicate that this function does not consume resources.
[0065] Specifically, a seasonal index is calculated based on the preset time series prediction model and the prediction period using a weighted moving average trend elimination method, and the seasonal index is eliminated from the computing power consumption demand sequence to obtain the computing power consumption demand for the next period. Specifically, the method may include: first, taking a 24-hour moving average and centering the result again, that is, performing a binomial moving average on the moving average result to finally obtain a centralized moving average of computing power consumption; second, calculating the moving average of hourly computing power consumption according to the simple moving average method, and then calculating a single moving average. To avoid large prediction deviations and data trend lags, a binomial moving average is performed on the single moving average to obtain a final centralized moving average of computing power consumption; finally, using the centralized moving average to calculate the seasonal ratio of computing power consumption, the average ratio within each period, and the average total computing power consumption ratio to finally obtain the seasonal index; then, by dividing the hourly computing power consumption by the corresponding seasonal index, the seasonal component is separated from the time series. Finally, after the above processing, a computing power consumption data series with the seasonal component removed is obtained, which reflects the changing pattern of computing power consumption in the absence of seasonal factors.
[0066] See also Figure 5 As shown, an embodiment of the present invention discloses a function computing resource pool adjustment device, which may specifically include:
[0067] The code sending module 11 is used to obtain the logic code to be run and send the logic code to be run to the function running container in the preset pod; the preset pod includes the function running container and the sidecar container;
[0068] An information storage module 12 is configured to obtain function data information in the function running container based on the sidecar container in the preset pod, and save the function data information to a preset data collection library;
[0069] The prediction module 13 is configured to input the function data information in the preset data collection library into a preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, and send the predicted computing power consumption demand to a preset resource pool controller;
[0070] The resource adjustment module 14 is configured to adjust the resources of the preset resource pool through the preset resource pool controller based on the computing power consumption requirement.
[0071] In this embodiment, the logic code to be run is obtained, and the logic code to be run is sent to the function running container in the preset pod; the preset pod includes the function running container and the sidecar container; the function data information in the function running container is obtained based on the sidecar container in the preset pod, and the function data information is saved to the preset data acquisition library; the function data information in the preset data acquisition library is input into the preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, and the predicted computing power consumption demand is sent to the preset resource pool controller; through the preset resource pool controller and based on the computing power consumption demand, the resources of the preset resource pool are adjusted. This application uses the function running container and the sidecar container in the preset pod to obtain and save function data information, and then inputs the function data information into the preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, so as to adjust the resources of the preset resource pool, thereby effectively avoiding the time loss caused by the cold start of the function, and can effectively improve resource utilization, further increase the efficiency of the function computing resource pool adjustment, and reduce resource consumption.
[0072] In some specific embodiments, the code sending module 11 may specifically include:
[0073] A communication connection module is used to establish a communication connection between the Kubernetes container and the preset pod;
[0074] A control module is used to control the function running container and the sidecar container in the preset pod based on the orchestration and scheduling function of the Kubernetes container.
[0075] In some specific embodiments, the code sending module 11 may specifically include:
[0076] A code running module, configured to run the logic code to be run through the function running container to obtain a result after the run;
[0077] The result saving module is used to output the result after the operation and save it to a third-party storage through a preset output method; the preset output method includes synchronous return or asynchronous return.
[0078] In some specific embodiments, the prediction module 13 may specifically include:
[0079] An information input module, configured to input the function data information in the preset data acquisition library into a preset time series prediction model;
[0080] A sequence determination module, configured to determine a computing power consumption requirement sequence based on the function data information;
[0081] A seasonal index calculation module, configured to calculate a seasonal index using a weighted moving average trend elimination method based on the preset time series prediction model, and eliminate the seasonal index from the computing power consumption demand sequence;
[0082] A prediction period determination module, configured to determine a prediction period for predicting computing power consumption demand using a preset time series model by using a preset period determination method;
[0083] The computing power consumption demand determination module is used to predict the computing power consumption demand for the next week based on the preset time series prediction model using the composite sequence decomposition prediction method and the prediction period.
[0084] In some specific embodiments, the resource adjustment module 14 may specifically include:
[0085] a determination module, configured to determine, through the preset resource pool controller and based on the computing power consumption requirement, a size relationship between the computing power consumption requirement and the size of the preset resource pool;
[0086] A resource scale adjustment module is used to determine the unoccupied resource scale from the preset resource pool; if the computing power consumption demand is greater than the unoccupied resource scale, the unoccupied resource scale is expanded based on the preset resource pool controller; if the computing power consumption demand is less than the unoccupied resource scale, the unoccupied resource scale is reduced based on the preset resource pool controller.
[0087] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the function computing resource pool adjustment method performed by the function computing resource pool adjustment device disclosed in any of the aforementioned embodiments.
[0088] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0089] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, a magnetic disk, or an optical disk. The resources stored thereon may include an operating system 221, a computer program 222, and data 223. The data 223 may include various data. The storage method can be temporary storage or permanent storage.
[0090] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222. The operating system 221 can be Windows Server, NetWare, Unix, Linux, etc. In addition to including a computer program capable of implementing the function computing resource pool adjustment method performed by the electronic device 20 as disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs capable of performing other specific tasks.
[0091] Furthermore, the embodiment of the present application also discloses a computer-readable storage medium, where the computer-readable storage medium includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk or an optical disk, or any other form of storage medium known in the technical field. Wherein, when the computer program is executed by the processor, the aforementioned function computing resource pool adjustment method is implemented. For the specific steps of the method, reference can be made to the corresponding content disclosed in the aforementioned embodiment, and no further details will be given here.
[0092] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0093] The steps of adjusting the function computing resource pool or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0094] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0095] The above is a detailed introduction to the function computing resource pool adjustment provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for adjusting a function computing resource pool, characterized in that: include: Obtain the logic code to be run and send it to the function running container in the preset pod; The preset pod includes the function running container and the sidecar container; Obtain function data information in the function running container based on the sidecar container in the preset pod, and save the function data information to a preset data collection library; The function data information is information about resource computing power consumed by the function application; Inputting the function data information in the preset data acquisition library into a preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, and sending the predicted computing power consumption demand to a preset resource pool controller; The step of inputting the function data information in the preset data collection library into a preset model to predict the computing power consumption demand for the next cycle using the preset model includes: Inputting the function data information in the preset data collection library into a preset time series prediction model to determine a computing power consumption demand sequence based on the function data information, and calculating a seasonal index using a weighted moving average trend elimination method based on the preset time series prediction model, and eliminating the seasonal index from the computing power consumption demand sequence to obtain the computing power consumption demand for the next cycle; The resources of the preset resource pool are adjusted through the preset resource pool controller based on the computing power consumption demand.
2. The function computing resource pool adjustment method according to claim 1, characterized in that: Before obtaining the logic code to be run and sending the logic code to be run to the function running container in the preset pod, the method further includes: Establish a communication connection between the Kubernetes container and the preset pod, and then control the function running container and the sidecar container in the preset pod based on the orchestration and scheduling function of the Kubernetes container.
3. The function computing resource pool adjustment method according to claim 1, characterized in that: After obtaining the logic code to be run and sending the logic code to be run to the function running container in the preset pod, the method further includes: Running the logic code to be run through the function running container to obtain a result after the run; The result after the operation is output and saved to a third-party storage through a preset output method; the preset output method includes synchronous return or asynchronous return.
4. The method for adjusting the function computing resource pool according to any one of claims 1 to 3, characterized in that: The adjusting the resources of the preset resource pool based on the computing power consumption requirement by the preset resource pool controller includes: Determining, by the preset resource pool controller and based on the computing power consumption requirement, a size relationship between the computing power consumption requirement and the size of the preset resource pool; Determine the scale of unoccupied resources from the preset resource pool; if the computing power consumption demand is greater than the scale of unoccupied resources, expand the scale of unoccupied resources based on the preset resource pool controller; if the computing power consumption demand is less than the scale of unoccupied resources, shrink the scale of unoccupied resources based on the preset resource pool controller.
5. A function computing resource pool adjustment device, characterized in that: include: The code sending module is used to obtain the logic code to be run and send the logic code to be run to the function running container in the preset pod; The preset pod includes the function running container and the sidecar container; An information storage module is used to obtain the function data information in the function running container based on the sidecar container in the preset pod, and save the function data information to a preset data collection library; The function data information is information about resource computing power consumed by the function application; A prediction module, configured to input the function data information in the preset data collection library into a preset model, so as to use the preset model to predict the computing power consumption demand of the next cycle, and send the predicted computing power consumption demand to a preset resource pool controller; The step of inputting the function data information in the preset data collection library into a preset model to predict the computing power consumption demand for the next cycle using the preset model includes: Inputting the function data information in the preset data collection library into a preset time series prediction model to determine a computing power consumption demand sequence based on the function data information, and calculating a seasonal index using a weighted moving average trend elimination method based on the preset time series prediction model, and eliminating the seasonal index from the computing power consumption demand sequence to obtain the computing power consumption demand for the next cycle; A resource adjustment module is used to adjust the resources of the preset resource pool through the preset resource pool controller and based on the computing power consumption demand.
6. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the function computing resource pool adjustment method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the function computing resource pool adjustment method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Cloud-based service construction resource allocation method, device and computer equipment
CN113268350A