Container preloading method, electronic device and storage medium
By predicting the business operation cycle and historical performance indicator data, the container is preloaded in advance, and the problem of long resource preemption and waiting time for container scheduling during peak business periods is solved, and resource utilization and business performance are improved.
Patent Information
- Application Number
- CN202111486393.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-12-07
AI Technical Summary
The existing container scheduling schemes can easily lead to resource preemption and waiting time during peak business periods, resulting in business blockage and low resource utilization, especially during business failures.
By predicting business operation cycles and historical performance indicator data, preload the required target containers in advance, reducing container preparation time, and avoiding resource waste and business waiting.
It effectively reduces the preparation time of the service runtime container, avoids the problems of resource preemption and waiting time during peak business periods, and improves resource utilization and overall performance of business operations.
Smart Images

Figure CN114237820B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of big data technology, and in particular to a container preloading method, an electronic device, and a storage medium. Background Art
[0002] With the rapid development of big data related technologies, the trend of business data expansion is unstoppable. Business container orchestration management tools are becoming more and more widely used in actual production applications. Container orchestration management tools can be used to schedule containers to ensure the normal operation of the business. The current container scheduling solutions include: Docker Swarm, YetAnother Resource Negotiator (yarn), Kubernetes (K8s) native scheduling method, Volcano and Transwarp.
[0003] However, Docker Swarm does not provide storage items, and containers cannot be connected to storage modules. Data between containers cannot be shared, and there is too little monitoring information for containers. It is necessary to rely on third-party tools such as Cadvisor to monitor containers.
[0004] YARN, the native scheduling method of K8s, Volcano, and Transwarp solutions all use a real-time triggered container loading method. Resources are used intensively only when the business is submitted for operation, which easily causes the problem of resource preemption. During the period when the business is not running, the resource utilization rate is very low, resulting in a huge waste of resources. If the business volume is large, the business will be blocked due to insufficient resources.
[0005] In addition, the container preparation time in the native scheduling methods of K8s, Volcano and Transwarp solutions is relatively long. During the peak period of business operation, the excessively long container preparation time will lead to a long business waiting time, which will greatly affect the performance of the scheduler and prolong the overall time of business operation. Summary of the invention
[0006] The main purpose of the embodiments of the present application is to propose a container preloading method, an electronic device and a storage medium, which can load the container in advance in a predictive manner, reduce the preparation time of the container when the business is running, and avoid business congestion during business peak hours.
[0007] To at least achieve the above-mentioned purpose, an embodiment of the present application provides a container preloading method, comprising: confirming the operating cycle of the service requested by the client; extracting the historical performance indicator data of the service in the previous cycle or predicting the expected performance indicator data when the service is running; determining the corresponding target container that needs to be preloaded based on the determined operating cycle, and the extracted historical performance indicator data or the predicted expected performance indicator data; and preloading the target container.
[0008] To at least achieve the above-mentioned purpose, an embodiment of the present application further provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned container preloading method.
[0009] To at least achieve the above-mentioned purpose, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which implements the above-mentioned container preloading method when executed by a processor.
[0010] The container preloading method proposed in the present application, by confirming the operation cycle of the service applied by the client, extracting the historical performance index data of the service in the previous cycle or predicting the expected performance index data when the service is running, and determining the corresponding target container that needs to be preloaded according to the determined operation cycle, and the extracted historical performance index data or the predicted expected performance index data, and then preloading the target container. By extracting the historical performance index data of the service in the previous cycle, determining the corresponding target container that needs to be preloaded, or determining the corresponding target container that needs to be preloaded according to the predicted expected performance index data when the service is running, the target container required by the service can be preloaded when the service requests the container, and then when the service starts, the preloaded container can be directly scheduled to the service node of the service to enable the service to run normally. The embodiment of the present application can load the container in advance by predicting, effectively reducing the preparation time of the container when the service is running, so as to avoid the service blocking problem caused by long service waiting time and resource preemption during the peak period of the service. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0012] Figure 1 is a flow chart of a container preloading method provided according to an embodiment of the present invention;
[0013] Figure 2 is a structural diagram of a VPA provided according to an embodiment of the present invention;
[0014] Figure 3 This is a K8s operation flow chart provided according to an embodiment of the present invention;
[0015] Figure 4 is a schematic diagram of a yarn operation provided according to an embodiment of the present invention;
[0016] Figure 5 is a schematic diagram of a container preloading device provided according to another embodiment of the present invention;
[0017] Figure 6 It is a schematic structural diagram of an electronic device provided according to another embodiment of the present invention. DETAILED DESCRIPTION
[0018] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not be construed as any limitation, and the various embodiments can be combined and referenced with each other under the premise of no contradiction.
[0019] An embodiment of the present invention relates to a container preloading method. The embodiment of the present invention is mainly applied to the big data container platform scenario, and the application object is the container in the big data container platform, for example, the container in the container cluster of yarn, the container in the container cluster of k8s. The specific implementation flow chart of the embodiment of the present invention is as follows: Figure 1 As shown, including:
[0020] Step 101: confirm the operation cycle of the service requested by the client.
[0021] Step 102: extract historical performance indicator data of the service in the previous cycle or predict expected performance indicator data when the service is running.
[0022] Step 103 , according to the determined operation cycle and the extracted historical performance indicator data or the predicted expected performance indicator data, determine the corresponding target container that needs to be preloaded, and preload the target container.
[0023] In this embodiment, by confirming the operation cycle of the service applied by the client, extracting the historical performance index data of the service in the previous cycle or predicting the expected performance index data when the service is running, according to the determined operation cycle, and the extracted historical performance index data or the predicted expected performance index data, determine the corresponding target container that needs to be preloaded, and then preload the target container. By extracting the historical performance index data of the service in the previous cycle, determining the corresponding target container that needs to be preloaded, or determining the corresponding target container that needs to be preloaded according to the predicted expected performance index data when the service is running, the target container required by the service can be preloaded when the service requests the container, and then when the service starts, the preloaded container can be directly scheduled to the service node of the service to enable the service to run normally. The embodiment of the present application can load the container in advance by predicting, effectively reducing the preparation time of the container when the service is running, so as to avoid the service blocking problem caused by long service waiting time and resource preemption during the peak period of the service.
[0024] The implementation details of the container preloading method of this embodiment are described in detail below. The following content is only provided for easy understanding of the implementation details and is not necessary for implementing this solution.
[0025] In step 101, the operation cycle of the service applied for by the client is confirmed, specifically, the length of the operation cycle of the service is confirmed, wherein the length of the operation cycle of the service is set by the client when applying for the service.
[0026] In step 102, historical performance indicator data of the service in the previous cycle is extracted or expected performance indicator data when the service is predicted to be running is predicted.
[0027] Specifically, when the operating cycle is less than or equal to the preset threshold, that is, when the length of the operating cycle is less than or equal to the preset threshold, the historical performance indicator data of the business in the previous cycle is extracted; or, when the operating cycle is greater than the preset threshold, that is, when the length of the operating cycle is greater than the preset threshold, the expected performance indicator data during the operation of the business is predicted.
[0028] In step 103, the target container to be preloaded is determined based on the determined operation cycle and the extracted historical performance index data or the predicted expected performance index data, and the target container is preloaded. The performance index data may include but is not limited to the index of the container and the number of containers.
[0029] Specifically, when the operation cycle is less than or equal to the preset threshold, the number and index of the target containers to be preloaded are determined based on the historical performance index data; when the operation cycle is greater than the preset threshold, the number and index of the target containers to be preloaded within the subsequent preset time are determined based on the predicted expected performance index data. The preset threshold value is an empirical value taken by the client.
[0030] In one embodiment, when the operation cycle is less than or equal to the preset threshold, the preloading time point of the target container is selected according to the extracted historical performance indicator data of the business in the previous cycle, and then the target container is preloaded according to the selected preloading time point of the target container and the historical performance indicator data. The historical performance indicator data of the business in the previous cycle is obtained by a cluster performance detection tool.
[0031] Specifically, the method of obtaining the preloading time point of the target container is as follows:
[0032] Divide the running time T of the business in the previous cycle into n time periods t, obtain the change point S in each time period t, and the number of containers P in each time period t, and then obtain the latest loading time LT based on the change point S, time period t, number of containers P, and the preset number of containers allowed to be loaded in parallel in the container cluster N. Among them, the change point S is the point where the performance indicator data suddenly changes in the time period t. The specific calculation formula is:
[0033]
[0034] It is understandable that those skilled in the art may select the preloading time point of the target container according to the latest loading time point, specifically, select the time point before the latest loading time point as the preloading time point.
[0035] In one example, before extracting the historical performance indicator data of the service in the previous cycle, it is necessary to add resource control items to all containers in the container cluster. After extracting the historical performance indicator data of the service in the previous cycle, the content of the resource control items of the container can be set according to the historical performance indicator data, and the state of the target container can be set to a pending state to obtain a preloaded target container, and then the preloaded target container in the pending state is moved to the service node of the service, that is, the preloading and scheduling operations of the container are completed. Among them, the resource control items may include: request, limit, cpu and memory.
[0036] In another embodiment, when the operation cycle is greater than a preset threshold, the number and index of target containers required to be preloaded within a subsequent preset time are determined according to the expected performance index data of the predicted service operation, and the target containers are preloaded.
[0037] In one example, before predicting the expected performance indicator data when the business is running, first divide the non-storage computing nodes from the container cluster, and preload some preset containers in advance for the business to start running first, and then determine the number and indicators of the target containers that need to be preloaded within the subsequent preset time based on the predicted expected performance indicator data, and push the determined indicators and quantity of the target containers to the container automatic expansion and contraction controller, so that the container automatic expansion and contraction controller can perform real-time expansion in the non-storage computing nodes based on the obtained indicators and quantities. Among them, the preset partial containers are the default configurations for all containers in the container cluster, that is, the default configured containers are first scheduled to the business nodes of the business, and then the containers of the non-storage computing nodes are expanded according to the predicted expected performance indicator data.
[0038] It should be noted that storage nodes are used to store resources required for business, and computing nodes are used to perform business calculations, that is, the business works on storage nodes and computing nodes. Therefore, adjusting containers on non-storage and computing nodes will not occupy job resources when expanding the capacity of containers, which can ensure the smooth operation of the business to the greatest extent. Among them, the preset configuration of the container is the default configuration of the container.
[0039] In one example, the container auto-scaling controller is located in the container vertical pod autoscaler (VPA), and the container can be adjusted by the VPA to achieve container expansion. Figure 2 As shown, it specifically includes: a container automatic expansion and contraction controller, a VPA updater, a VPA admission controller, a VPA recommender, a monitoring device, a container controller and a container, wherein the container includes resource control items of the container.
[0040] Specifically, the VPA updater is used to monitor the indicator recommendations of the container and delete the container; the VPA admission controller is used to obtain the indicator recommendations of the container and adapt the indicators of the container; the VPA recommender is used to read the default configuration of the container and the historical indicators of the container, and recommend the indicators of the container; the monitoring device is used to monitor the indicators of the container; the container controller is used to load the container.
[0041] In this embodiment, before predicting the expected performance indicator data during business operation, a performance prediction model for predicting the expected performance indicator data of the business is first established based on a time series data prediction algorithm, and then the expected performance indicator data during business operation can be predicted by combining the performance prediction model, wherein the time series data prediction algorithm can be a Prophet algorithm.
[0042] Specifically, the performance prediction model is established based on a combination of the following parameters, namely: a trend item, a season item, a residual item, and a holiday item.
[0043] In one example, the trend term, season term, residual term and holiday term parameters are the trend term model, season term model, residual term model and holiday term model respectively. That is, y(t)=g(t)+s(t)+h(t)+ε t , where y(t) represents the performance prediction model, g(t) represents the trend term model, s(t) represents the seasonal term model, h(t) represents the holiday term model, and ε t Represents the residual model.
[0044] Specifically, the trend term model includes two expressions. The first is a trend term model based on a logistic regression function, and the second is a trend term model based on a piecewise linear function.
[0045] In one example, the trend term model may be a trend term model based on a logistic regression function.
[0046] Among them, the basic form of the logistic regression function is:
[0047] f(x)=C / (1+e -k(x-m) )
[0048] C represents the maximum asymptotic value of the curve. For the central processing unit (CPU) or memory, the maximum is 1. The value can be set to a number less than or equal to 1. k represents the growth rate of the curve, that is, the growth rate of the CPU or memory usage. m represents the offset.
[0049] In the actual production environment, C, k, and m are not constants, so it is assumed that C, k, and m are expressed as C = C(t), k = k(t), and m = m(t). In the actual environment, the trend of the curve will change, that is, it is necessary to set change points to describe the trend of the curve. The number of change points can be set by yourself. Assuming that p change points have been placed, the change points can be represented by the set P = {P1, P2, P3, ..., Pj}. The position of the change point is on the timestamp Pj (1≤j≤p). Assuming that there is a vector
[0050] δ∈R p , where δ j represents the change in the CPU / memory growth rate at timestamp Pj, then the change in the CPU / memory growth rate Rcm at timestamp t is:
[0051]
[0052] Through an indicator function r(t)∈{0,1} PIndicates that:
[0053]
[0054] Then the CPU / memory growth rate at time point t is k+r T δ, then the boundary value γ j It is expressed as:
[0055]
[0056] Therefore, the expression of the trend term model based on the logistic regression function is
[0057]
[0058] where r(t)=(r1(t),…,r p (t) T ),δ=(δ1,…δ p ) T ,γ=(γ1,…,γ p ) T .
[0059] In another example, the trend term model may be a trend term model based on a piecewise linear function. The basic form of a linear function is y=kx+b, and the trend term model based on a piecewise linear function may be expressed as:
[0060] g(t)=(k+r(t)δ)*t+(m+r(t) T γ)
[0061] Where k represents the growth rate of CPU / memory; δ represents the change in the growth rate of CPU / memory; m represents the offset; γ=(γ1,…,γ p ) T , γ j =-P j δ j .
[0062] The seasonal term model is used to describe the periodic changes of performance indicator data. Specifically, the periodicity of performance indicator data is represented by Fourier series. Assuming that the performance change cycle of CPU / memory is X, the seasonal term model can be expressed as:
[0063]
[0064] The parameters can be represented by the column vector β = (a1, b1, ..., a N ,b N ) T Indicates that the initialization value of β is β~Normal(0,σ 2), where the value of σ can be set by yourself. The larger the value, the more obvious the periodic effect, and the smaller the value, the less obvious the periodic effect.
[0065] The holiday term model is used to describe the impact of weekends and holidays on performance indicator data in the real environment. Assume that D i It represents the period before and after the i-th holiday performance indicator data is affected in a business cycle. The parameter κ represents the scope of the holiday impact. Assuming there are Y holidays in a business cycle, the holiday item model can be expressed as:
[0066]
[0067] in, κ=(κ1,…,κ Y ),κ~Normal(0,ν 2 ), where the value of ν can be set by yourself. The larger the value, the greater the impact of holidays on the model, and the smaller the value, the smaller the impact of holidays on the model.
[0068] The container preloading method of the embodiment of the present application can be applied to but not limited to the following container scheduling schemes: K8s, yarn, Volcano and Transwarp.
[0069] Among them, the operation process of K8s is as follows Figure 3 As shown, including:
[0070] S301, the client initiates a request to create a container controller.
[0071] S302, the interactive management module apiserver in K8s receives the request and synchronizes the request message to the storage module etcd in K8s.
[0072] S303, etcd passes the creation event of the container controller in the request to the workload controller in K8s through the apiserver.
[0073] S304, the workload controller creates a container controller, wherein the container controller is used to load the container, and the container on the shelf is in a pending state.
[0074] S305, the workload controller passes the message that the container has been loaded to etcd through the apiserver.
[0075] S306, etcd reports the message to the scheduler in K8s through apiserver.
[0076] S307, the scheduler queries the unbound container in the pending state, selects the corresponding service node according to the scheduling strategy, schedules the container to the corresponding service node, and completes the binding of the service node and the container. The scheduling strategy includes a scheduling pre-selection strategy, a scheduling optimization strategy, and the like.
[0077] S308: The scheduler passes the scheduling completion information to etcd through apiserver.
[0078] S309, etcd reports the binding information between the business node and the container to the client through the apiserver.
[0079] The working diagram of yarn is as follows Figure 4 As shown, including:
[0080] S401, the client submits the service.
[0081] S402, the resource manager starts the container, allocates the container to the service, and communicates with the node manager where the container is located, so that the node manager starts the application manager corresponding to the service in the container.
[0082] S403, the application manager corresponding to the service in the container applies for registration to the application manager in the resource manager, and applies for resources to the resource scheduler in the application manager. After receiving the application, the application manager allocates resources to the application manager corresponding to the service in the container.
[0083] S404, the application manager corresponding to the service in the container obtains resources and communicates with the node manager, so that the node manager starts the service in the container.
[0084] S405, the service is started. The node manager configures the environment for the service, such as environment variables, runtime jar packages, other programs, etc., and runs the service through scripts.
[0085] S406, the service reports the service status to the application manager, wherein the service reports the service status to the application manager via a remote procedure call (RPC) protocol.
[0086] S407, after receiving the signal indicating that the service is completed, the application manager applies to the application manager in the resource manager for deregistration and closes itself.
[0087] For ease of understanding, the container preloading method of the embodiment of the present application is applied in K8s to implement container scheduling as an example for explanation:
[0088] In one example, when the service cycle is less than the preset threshold, the specific operation process is as follows, including:
[0089] Step 1: Receive the business submitted by the client and obtain the performance indicator data of the business.
[0090] Step 2: Obtain the latest loading time point of the container based on the performance indicator data.
[0091] Step 3: before the next latest loading time point, load the container according to the performance indicator data.
[0092] Step 4: The interactive management module apiserver in K8s receives the request and synchronizes the request message to the storage module etcd in K8s. etcd reports the message to the scheduler in K8s through the apiserver.
[0093] Step 5: The scheduler queries the unbound containers in the pending state and selects the corresponding service node according to the scheduling strategy, which includes the scheduling pre-selection strategy, the scheduling optimization strategy, etc.
[0094] Step 6: The scheduler schedules the container to the corresponding business node, completes the binding between the business node and the container, and passes the scheduling completion information to etcd through the apiserver.
[0095] Step 7: etcd reports the binding information between the business node and the container to the client through the apiserver.
[0096] In an example, when the service cycle is greater than a preset threshold, the specific implementation process is as follows, including:
[0097] Step 1: Receive the business submitted by the client and divide each container in the container cluster into storage nodes, computing nodes or non-storage and computing nodes.
[0098] Step 2: Schedule the container loaded with the preset configuration to the service node of the service, and predict the performance index data of the service for a period of time after that, that is, the index of the container and the number of containers, according to the pre-established performance prediction model.
[0099] Step 3: Push the predicted container index and container quantity to the VPA recommender in the VPA.
[0100] In step 4, the VPA recommender pushes the container index and the number of containers to the container automatic scaling controller, so that the container automatic scaling controller adjusts the containers of the non-storage and computing nodes according to the container index and the number of containers.
[0101] Step 5: The scheduler queries the unbound containers in the pending state and selects the corresponding service node according to the scheduling strategy, which includes the scheduling pre-selection strategy, the scheduling optimization strategy, etc.
[0102] Step 6: The scheduler schedules the container to the corresponding business node, completes the binding between the business node and the container, and passes the scheduling completion information to etcd through the apiserver.
[0103] Step 7: etcd reports the binding information between the business node and the container to the client through the apiserver.
[0104] It should be noted that the above examples in this embodiment are all illustrative for easy understanding and do not constitute a limitation on the technical solution of the present invention.
[0105] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.
[0106] Another embodiment of the present invention relates to a container preloading device. The details of the container preloading device of this embodiment are described in detail below. The following content is only for the convenience of understanding the implementation details provided, and is not necessary for implementing this embodiment. Figure 5 is a schematic diagram of the container preloading device according to this embodiment, comprising: a confirmation module 501 , a data acquisition module 502 , and a prediction module 503 .
[0107] Specifically, the confirmation module 501 is used to confirm the operation cycle of the service requested by the client.
[0108] The data acquisition module 502 is used to extract the historical performance indicator data of the service in the previous cycle or predict the expected performance indicator data when the service is running.
[0109] In one example, the data acquisition module 502 is also used to extract the historical performance indicator data of the business in the previous cycle when the operating cycle is less than or equal to the preset threshold; or to predict the expected performance indicator data of the business during operation when the operating cycle is greater than the preset threshold.
[0110] In one example, the data acquisition module 502 is also used to establish a performance prediction model based on a time series data prediction algorithm; and to predict expected performance indicator data during business operation in combination with the performance prediction model.
[0111] The prediction module 503 is used to determine the corresponding target container that needs to be preloaded according to the determined operation cycle and the extracted historical performance indicator data or the predicted expected performance indicator data, and preload the target container.
[0112] In one example, the prediction module 503 is also used to determine the number and indicators of target containers that need to be preloaded based on historical performance indicator data when the operating cycle is less than or equal to a preset threshold, and preload the target containers; or when the operating cycle is greater than the preset threshold, determine the number and indicators of target containers that need to be preloaded within a subsequent preset time based on the predicted expected performance indicator data, and preload the target containers.
[0113] In one example, the prediction module 503 is further configured to determine the number and index of target containers to be preloaded according to the historical performance indicator data, and before preloading the target container, select a preloading time point of the target container according to the historical performance indicator data, and preload the target container according to the selected preloading time point of the target container.
[0114] In an example, the prediction module 503 is also used to divide the running time T of the business in the previous cycle into n time periods t according to historical performance indicator data; obtain the change point S in each time period t, and the number of containers P in each time period t; according to the change point S, time period t, the number of containers P and the preset number N of containers allowed to be loaded in parallel in the container cluster, obtain the latest loading time point LT to select the preloading time point of the target container.
[0115] In one example, the prediction module 503 is also used to set the content of the resource control item of the target container according to historical performance indicator data after adding resource control items to all containers in the container cluster, and set the status of the target container to a pending state, so as to schedule the target container in a pending state to the business node of the business.
[0116] In one example, the prediction module 503 is also used to push the indicators and quantity of the target container to the container automatic scaling controller after dividing the non-storage computing nodes from the container cluster and preloading some preset containers in advance, so that the container automatic scaling controller can perform real-time expansion on the non-storage computing nodes according to the obtained indicators and quantities.
[0117] It is not difficult to find that this embodiment is a device embodiment corresponding to the above method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. The relevant technical details and technical effects mentioned in the above embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiment.
[0118] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.
[0119] It should be noted that the embodiment of the present device is mainly a description of the container preloading method provided by the method embodiment at the software implementation level, and its implementation also needs to rely on hardware support. For example, the functions of related modules can be deployed on the processor so that the processor can run to implement the corresponding functions. In particular, the data generated by the operation can be stored in the memory for subsequent inspection and use.
[0120] Based on this, another embodiment of the present invention relates to an electronic device, such as Figure 6 As shown, it includes: at least one processor 601; and a memory 602 that is communicatively connected to the at least one processor 601; wherein the memory 602 stores instructions that can be executed by the at least one processor 601, and the instructions are executed by the at least one processor 601 so that the at least one processor 601 can execute the container preloading method in the above-mentioned embodiments.
[0121] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0122] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0123] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0124] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0125] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A container preloading method, It is characterized in that include: Confirm the operation cycle of the service requested by the client; When the operation cycle is less than or equal to the preset threshold, extracting historical performance indicator data of the service in the previous cycle, and determining the number and index of target containers that need to be preloaded according to the historical performance indicator data, and preloading the target containers; When the operation cycle is greater than the preset threshold, the expected performance indicator data of the service during operation is predicted, and based on the predicted expected performance indicator data, the number and index of target containers required to be preloaded within a subsequent preset time are determined, and the target containers are preloaded.
2. The container preloading method according to claim 1, It is characterized in that Before determining the number and index of target containers to be preloaded according to the historical performance index data and preloading the target containers, the method further includes: Selecting a preloading time point for the target container according to the historical performance indicator data; The target container is preloaded according to the selected preloading time point of the target container.
3. The container preloading method according to claim 2, It is characterized in that Selecting a preloading time point of the target container according to the historical performance indicator data includes: According to the historical performance indicator data, the running time T of the business in the previous cycle is divided into n time periods t; Obtaining a change point S in each time period t and the number P of containers in each time period t; According to the change point S, the time period t, the number P of the containers, and the preset number N of containers allowed to be loaded in parallel in the container cluster, the latest loading time point LT is obtained to select the preloading time point of the target container.
4. The container preloading method according to claim 1, It is characterized in that When the operation cycle is less than or equal to the preset threshold, before extracting the historical performance indicator data of the service in the previous cycle, the method further includes: Add resource control items to all containers in the container cluster; And when the operation cycle is less than or equal to the preset threshold, determining the number and index of target containers to be preloaded according to the historical performance index data, and preloading the target containers, including: According to the historical performance indicator data, the content of the resource control item of the target container is set, and the state of the target container is set to a pending state, so as to schedule the target container in the pending state to the service node of the service.
5. The container preloading method according to claim 1, It is characterized in that When the operation period is greater than the preset threshold, predicting the expected performance indicator data when the service is running; including: Separate non-storage and computing nodes from the container cluster and preload some preset containers in advance; and In the case where the operation cycle is greater than the preset threshold, determining the number and index of target containers to be preloaded within a subsequent preset time according to the predicted expected performance index data, and preloading the target containers, including: The index and quantity of the target container are pushed to the container automatic expansion and contraction controller, so that the container automatic expansion and contraction controller performs real-time expansion on the non-storage computing node according to the obtained index and quantity.
6. The container preloading method according to claim 1, It is characterized in that The predicted expected performance indicator data when the service is running includes: Establish performance prediction model based on time series data prediction algorithm; Combined with the performance prediction model, the expected performance indicator data when the business is running is predicted.
7. The container preloading method according to claim 6, It is characterized in that The performance prediction model is established based on a combination of the following parameters, specifically: a trend item, a season item, a residual item, and a holiday item.
8. An electronic device, It is characterized in that include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the container preloading method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the container preloading method according to any one of claims 1 to 7 is implemented.
