Application deployment method and device, storage medium and electronic equipment
By obtaining and analyzing the historical data of the application in the container, the container data within the target time period solves the problem of resource waste caused by artificial distribution, and realizes the precise allocation of containers and servers and the efficient use of resources.
Patent Information
- Application Number
- CN202310933362.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-27
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art application deployment, servers and containers are manually allocated, resulting in inaccurate allocation results and waste of resources.
By obtaining the historical data of the target application in the container, including the operating status of the server, the network load, the bill data and the resource occupation data, the container data within the target time period, and then the container and server are accurately allocated.
When deploying applications on containers, accurately allocate containers and servers to avoid waste of resources and improve the efficiency of resource utilization.
Smart Images

Figure CN119376848A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to an application deployment method, device, storage medium, and electronic device. Background Art
[0002] In the prior art, applications can be deployed in containers on servers. However, in the deployment of existing applications, the server hardware data and the number of containers occupied are allocated based on human experience, and the allocated server hardware and number of containers may not be optimal, resulting in a waste of server and container resources. Summary of the invention
[0003] The present application provides an application deployment method, device, storage medium and electronic device to solve the technical problem of inaccurate allocation results caused by manual allocation of servers and containers when deploying application programs.
[0004] In a first aspect, the present application provides an application deployment method, comprising: when a target application is deployed on a container, obtaining historical data of the target application running in the container, wherein the historical data includes server operation status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource occupancy data of the server; predicting container data of the target application based on the historical data, wherein the container data is used to indicate the number of containers used by the target application and hardware parameter data of the server where the container is located within a target time period; and allocating containers and servers to the target application based on the container data within the target time period.
[0005] In a second aspect, the present application provides an application deployment device, comprising: an acquisition module, for acquiring historical data of the target application running in the container when the target application is deployed on the container, wherein the historical data includes server operation status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource occupancy data of the server; a prediction module, for predicting container data of the target application based on the historical data, wherein the container data is used to indicate the number of containers used by the target application within a target time period and hardware parameter data of the server where the container is located; a first allocation module, for allocating containers and servers to the target application based on the container data within the target time period.
[0006] As an optional example, the above-mentioned acquisition module includes: an acquisition unit, which is used to obtain the server operation status data, the network load data of the server, the billing data and the resource occupancy data of the server in each time period as a copy of the historical data within multiple time periods, with a predetermined time length as a time period, thereby obtaining multiple copies of the historical data corresponding to the multiple time periods.
[0007] As an optional example, the prediction module includes: a training unit, for selecting, from multiple copies of the historical data, historical data in which the server operation status data is in operation, the network load data is less than the network threshold, the bill data is less than the bill threshold, and the resource occupancy data of the server is less than the occupancy threshold as the first historical data, and determining the first historical data and the number of containers corresponding to the first historical data and the hardware parameter data of the server as positive sample data; selecting, from multiple copies of the historical data, historical data in which the server operation status data is not in operation, or the network load data is greater than the network threshold, or the bill data is greater than the bill threshold, or the resource occupancy data of the server is greater than the occupancy threshold as the second historical data, and determining the second historical data and the number of containers corresponding to the second historical data and the hardware parameter data of the server as negative sample data; using the positive sample data and the negative sample data to train the original prediction model to obtain a target prediction model; a prediction unit, for predicting the container data of the target application based on the historical data and the target prediction model.
[0008] As an optional example, the prediction unit includes: a prediction subunit, used to predict the server operation status data of the server where the container is located, the network load data of the server, the billing data of the target application using the container, and the resource occupancy data of the server within the target time period based on the historical data; input the predicted server operation status data of the server where the container is located, the network load data of the server, the billing data of the target application using the container, and the resource occupancy data of the server within the target time period into the target prediction model; and determine the output result of the target prediction model as the container data of the target application.
[0009] As an optional example, the prediction subunit is also used to: upon receiving at least one of the input data including server operating status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource occupancy data of the server, replace the predicted data with the input data; and input the replaced data into the target prediction model.
[0010] As an optional example, the above-mentioned first allocation module includes: an allocation unit, used to allocate servers and containers to the target application according to the number of containers in the container data and the number of central processing unit cores and memory size of the server; after running the container on the allocated server and deploying the target application on the container, if the response rate of the target application is lower than the response threshold, allocate a server with a central processing unit core number greater than the number of central processing unit cores in the container data and a memory size greater than the memory size in the container data to the target application from a backup server, or allocate a number of containers greater than the number of containers in the container data.
[0011] As an optional example, the above-mentioned device also includes: a second allocation module, which is used to allocate containers and servers to the above-mentioned target application according to the above-mentioned container data within the above-mentioned target time period, and then allocate containers and servers to the first application according to the above-mentioned container data within the above-mentioned target time period, wherein the application tag of the above-mentioned first application is the same as the application tag of the above-mentioned target application.
[0012] In a third aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement any one of the above-mentioned application deployment methods when executing the computer program.
[0013] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute any of the above-mentioned application deployment methods of the present application.
[0014] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application can predict the number of containers to be used by the target application within the target time period and the hardware parameter data of the server where the container is located through data such as the server operation status data of the server where the container of the target application is deployed, the network load data of the above server, the billing data of the above target application using the above container, and the resource occupancy data of the above server, so that the containers and servers can be allocated according to actual needs, thereby achieving the effect of accurately allocating containers and servers when deploying applications on containers. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] 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.
[0018] Figure 1 A flowchart of an application deployment method provided in an embodiment of the present application;
[0019] Figure 2 A flowchart of another application deployment method provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of obtaining historical data of an application deployment method provided in an embodiment of the present application;
[0021] Figure 4 A flowchart of another application deployment method provided in an embodiment of the present application;
[0022] Figure 5 A flowchart of another application deployment method provided in an embodiment of the present application;
[0023] Figure 6 A model structure diagram of an application deployment method provided in an embodiment of the present application;
[0024] Figure 7 A flowchart of another application deployment method provided in an embodiment of the present application;
[0025] Figure 8 A schematic diagram of the structure of an application deployment device provided in an embodiment of the present application;
[0026] Fig. 9 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0028] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0029] Figure 1 A flowchart of an application deployment method provided in an embodiment of the present application. Figure 1 As shown, the above application deployment method includes:
[0030] S102, when a target application is deployed on the container, obtaining historical data of the target application running in the container, wherein the historical data includes server running status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource usage data of the server;
[0031] S104, predicting container data of the target application based on historical data, wherein the container data is used to indicate the number of containers used by the target application in a target time period and hardware parameter data of a server where the containers are located;
[0032] S106, allocating containers and servers to the target application according to the container data within the target time period.
[0033] Optionally, the above application deployment method can be used in the adjustment phase after the containerized deployment of the application. After the containerized deployment of the application, the data of the container and the server can be obtained to predict the optimal container data and server data of the application.
[0034] The above container refers to the technology used to bundle an application and all its necessary files into a running environment. As a unit, the container can be easily moved and run on any operating system in any environment.
[0035] The target application mentioned above can be deployed on the container for a period of time. During this period, data of the application running process after the application is deployed in the container is obtained. This part of data is the historical data.
[0036] In this embodiment, the container data and server data during the application operation process can be collected after each application is deployed, or the container data and server data during the application operation process can be collected for a specific application. Whether to collect data and which application data to collect can be set at any time. For example, after the containerized deployment of application 1, the data of application 1 is collected. After collecting data for two days, it is set to stop collecting data for application 1. After an interval of one day, it is set to continue collecting data for one day. Then the data of application 1 for the first, second, and fourth days are collected.
[0037] In this embodiment, the collected data is divided into several types. The first is the operating status data of the server, including whether the server is running or not running. If the server is not running, it may be a server failure. The second is the network load data, including the network load of the server. The third is the billing data of the target application using the container, including the fees generated by the container used by the target application. The fourth is the resource usage data of the server, that is, the number of central processing units (CPUs) and memory size occupied by the target program deployed in the container.
[0038] After collecting the above data, the container data of the target application in the next target time period can be predicted based on the above data. The target time period can be a subsequent time period immediately adjacent to the current time, or a time period in the future. For example, if the current time point is 12:00, the target time period can be from 12:00 to 18:00, or from 18:00 to 20:00. The next containerized deployment cycle of the target application can be used as the target time period.
[0039] The container data may include the optimal number of containers for containerized deployment of the target application and the number of CPUs and memory size of the server used. The number of CPUs and memory size of the server allocated to the target application within the target time period are determined through prediction, so as to deploy the target application.
[0040] The method provided in the embodiment of the present application can predict the number of containers to be used by the target application within a target time period and the hardware parameter data of the server where the container is located by using data such as the server operation status data of the server where the container of the target application is deployed, the network load data of the server, the billing data of the target application using the container, and the resource usage data of the server, so that the containers and servers can be allocated according to actual needs, thereby achieving the effect of accurately allocating containers and servers when deploying applications on containers.
[0041] As an alternative example, Figure 2As shown, when a target application is deployed on a container, obtaining historical data of the target application running in the container includes:
[0042] S202, taking a predetermined time length as a time period, within multiple time periods, obtaining the server operation status data, the server network load data, the billing data and the server resource occupancy data within each of the time periods as a copy of the historical data, thereby obtaining multiple copies of the historical data corresponding to the multiple time periods.
[0043] In this embodiment, after the application is deployed in the container, data acquisition can be started at any time. At the beginning of any time, a predetermined time length is used as a time period, and the server operation status data, the server network load data, the billing data, and the server resource occupancy data within the time period are acquired in each time period. When acquiring the server operation status data, the server network load data, the billing data, and the server resource occupancy data within the time period, the server operation status data, the server network load data, the billing data, and the server resource occupancy data can be acquired once within the time period, or the server operation status data, the server network load data, the billing data, and the server resource occupancy data can be acquired continuously within the time period and the average value can be calculated.
[0044] The multiple time periods may be adjacent time periods or non-adjacent time periods. For example, one hour is a time period. Figure 3 As shown, Figure 3 Schematic diagram of acquiring data for multiple time periods. Acquire data from 12:00 to 13:00 as a time period, acquire data from 13:00 to 14:00 as a time period, acquire data from 15:00 to 16:00 as a time period, and do not acquire data from 14:00 to 15:00. Alternatively, do not acquire data from 16:00 to 16:20, and continue to acquire data from 16:20 to 17:20 as a time period.
[0045] The data obtained in each time period is regarded as a piece of historical data, and multiple pieces of historical data can be obtained in multiple time periods.
[0046] Data acquisition can be achieved through monitoring systems or cloud platforms. After data is collected, it is stored in a data warehouse.
[0047] Before or after data collection and storage in the data warehouse, the data can be preprocessed. Preprocessing includes data cleaning, deduplication, normalization and other processing methods.
[0048] As an alternative example, Figure 4 As shown, the container data of the target application predicted based on historical data includes:
[0049] S402, from multiple historical data, select historical data in which server operation status data is running, network load data is less than a network threshold, bill data is less than a bill threshold, and server resource occupancy data is less than an occupancy threshold as first historical data, and determine the first historical data and the number of containers corresponding to the first historical data and the hardware parameter data of the server as positive sample data;
[0050] S404, selecting, from the plurality of historical data, historical data in which the server operation status data is non-operating, or the network load data is greater than the network threshold, or the bill data is greater than the bill threshold, or the resource occupancy data of the server is greater than the occupancy threshold as the second historical data, and determining the second historical data and the number of containers corresponding to the second historical data and the hardware parameter data of the server as negative sample data;
[0051] S406, using the positive sample data and the negative sample data to train the original prediction model to obtain a target prediction model;
[0052] S408: Predict container data of the target application according to historical data and the target prediction model.
[0053] In this embodiment, after the historical data is acquired, the historical data may be input into the original prediction model to train the original prediction model, thereby obtaining a trained target prediction model.
[0054] The historical data needs to be sorted to obtain positive sample data and negative sample data for training the model. In the process of sorting data, first, the historical data is screened according to different requirements. Considering the server's running state or abnormal non-running state, as well as parameters such as network load, the server running state data is running, the network load data is less than the network threshold, the bill data is less than the bill threshold, and the server's resource occupancy data is less than the occupancy threshold. It is determined as normal historical data, and this part of historical data is used as the first historical data, and the number of containers when the first historical data is collected and the server's hardware parameter data are determined as positive sample data. The significance of positive sample data is that the server running state data is running, the network load data is less than the network threshold, the bill data is less than the bill threshold, and the server's resource occupancy data is less than the occupancy threshold. The state is the best state, so the number of containers used in this state and the server's hardware parameter data have reference significance. The above network threshold is the network threshold when the target application has the best performance. The bill threshold is the bill for the overhead caused by the server occupied by the target application when the target application has the best performance. The occupancy threshold is the number of CPU cores and memory size of the server occupied by the target application when the target application has the best performance. The higher the response rate of the application, the better the performance. The best performance can be regarded as a response rate greater than a specified value.
[0055] If the server operating status data is not in operation, or the network load data is greater than the network threshold, or the billing data is greater than the billing threshold, or the server resource occupancy data is greater than the occupancy threshold, then this part of the historical data is considered to be data in an abnormal state, and this part of the data and the corresponding container quantity and server hardware parameter data are determined as negative sample data.
[0056] As an alternative example, Figure 5 As shown, the container data of the target application predicted based on historical data and the target prediction model includes:
[0057] S502, predicting server operation status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource usage data of the server within the target time period based on historical data;
[0058] S504, inputting server operation status data of the server where the container is located within the predicted target time period, network load data of the server, billing data of the target application using the container, and resource usage data of the server into the target prediction model;
[0059] S506: Determine the output result of the target prediction model as the container data of the target application.
[0060] In this embodiment, after obtaining the positive sample data and the negative sample data, the original prediction model can be trained. The original prediction model can be a machine learning algorithm model, such as a linear regression model, a decision tree model, a support vector machine model, and the like. Figure 6 FIG. 1 is an exemplary structural diagram of a model. Figure 6 As shown in the figure, the model includes multiple convolutional layers and multiple fully connected layers. After the input data passes through the convolutional layer and the fully connected layer of the model, the model outputs the data.
[0061] As an optional example, inputting server operation status data of the server where the container is located within the predicted target time period, network load data of the server, billing data of the target application using the container, and resource usage data of the server into the target prediction model includes:
[0062] When receiving at least one of the input server operation status data of the server where the container is located, the network load data of the server, the billing data of the target application using the container, and the resource usage data of the server, replacing the predicted data with the input data;
[0063] The replaced data is input into the target prediction model.
[0064] In this embodiment, when the server operation status data of the server where the container is located within the predicted target time period, the server's network load data, the target application's billing data for using the container, and the server's resource occupancy data are input into the target prediction model, since the input data is predicted, the user can input the data by himself. The user can input one or more of the server operation status data, the server's network load data, the target application's billing data for using the container, and the server's resource occupancy data. The input data will replace the predicted data, and the predicted data will still be used if the user does not input the data. The target prediction model uses this part of the data to predict the number of containers and the server hardware parameter data.
[0065] Users can save the data they want to enter as a template. For example, Template 1 includes the server occupancy input, but other data is not entered; Template 2 includes the server resource occupancy data and billing data, but other data is not entered. Templates can be used to quickly select what data to enter.
[0066] As an optional example, allocating containers and servers to target applications according to container data within a target time period includes:
[0067] Allocate a server and a container for the target application according to the number of containers in the container data and the number of CPU cores and memory size of the server;
[0068] After the container is run on the allocated server and the target application is deployed on the container, if the response rate of the target application is lower than a response threshold, a server having a greater number of central processing unit cores than the number of central processing unit cores in the container data and a greater memory size than the memory size in the container data is allocated to the target application from a standby server, or a number of containers greater than the number of containers in the container data is allocated.
[0069] In this embodiment, since the target prediction model predicts the optimal number of containers and the hardware parameter data of the server for the target application within the target time period, the number of containers and the hardware parameter data of the server within the target time period can be allocated to the target application based on this data, thereby deploying the target application.
[0070] If the response rate of the target application is lower than the response threshold after the containers and servers are allocated according to the number of containers and the server's hardware parameter data and the target application is deployed, it means that the currently allocated number of containers and the server's hardware parameter data are not suitable and need to be allocated again. When reallocating again, the number of allocated containers is larger or the server's hardware parameter data is larger, so as to meet the requirements of the deployed target application and improve the response rate.
[0071] For example, the number of containers predicted by the target prediction model is 10, and the hardware parameter data of the server is 8 CPU cores and 16G memory. After the target application is deployed according to the data, the response rate of the target application is not high, such as 50%, which is lower than the response threshold. Therefore, a number of containers greater than 10 is allocated from the backup server, such as 15, or a server with 16 CPU cores and 32G memory is allocated to deploy the target application, thereby improving the response rate.
[0072] As an optional example, after allocating containers and servers to the target application according to the container data within the target time period, the method further includes:
[0073] A container and a server are allocated to a first application according to the container data within a target time period, wherein an application tag of the first application is the same as an application tag of the target application.
[0074] In this embodiment, the target application can be classified and tagged with an application label, and other applications can also be classified and tagged with application labels. If the application label of a first application is consistent with the application label of the target application, the first application can be allocated the same number of containers and server hardware parameter data as the target application.
[0075] The method of classifying and labeling applications can be to classify them according to the running status data of the server where the application is located, the network load data of the server, the billing data, and the resource usage data of the server, and classify applications with similar running status data, network load data of the server, billing data, and resource usage data of the server into one category, and classify applications with large differences in running status data, network load data of the server, billing data, and resource usage data of the server into other categories. Whether the specific data is similar can be determined by whether the data is in the same interval.
[0076] The following combination Figure 7 and one The main steps are divided into 4 steps.
[0077] The first step is data collection. After deploying a target application on the server, collect the target application's running status data (whether the server is running or not running), the server's network load data (specific values of the network load), billing data (daily server bills), and server resource usage data (how many CPU cores and memory are occupied by the server, which is different from the server's hardware parameter data, which is how many CPU cores and memory the server has).
[0078] The second step is data cleaning, such as filtering, deduplication, normalization, etc. The collected data is cleaned before proceeding to the next step.
[0079] The third step is to train the model. The above data of each time period is used as a historical data. The historical data is assigned positive sample data and negative sample data according to the above method. For example, if the network load data in a historical data exceeds the network threshold, the historical data and the corresponding container quantity and server hardware parameter data are used as negative sample data. The positive sample data and negative sample data are input as follows: Figure 6 The model structure shown is used to train the model.
[0080] The fourth step is to use the model. The model is deployed through the Application Programming Interface (API) to provide model services. The server operation status data, server network load data, billing data, and server resource usage data of the target application within the target time period are predicted based on the historical data of the target application, and the predicted data is input into the target prediction model. The target prediction model predicts the optimal number of containers and the number of CPU cores and memory size of the server for the target application within the target time period. According to the optimal number of containers, the number of CPU cores and memory size of the server, servers are provided within the target time period to deploy the target application. After the target time period is exceeded, servers are allocated according to the new number of containers and server hardware parameter data predicted by the target prediction model.
[0081] Figure 8 A schematic diagram of the structure of an application deployment device provided in an embodiment of the present application. Figure 8 As shown, the above application deployment device includes:
[0082] An acquisition module 802 is used to acquire historical data of the target application running in the container when the target application is deployed on the container, wherein the historical data includes server operation status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource usage data of the server;
[0083] A prediction module 804 is used to predict the container data of the target application based on the historical data, wherein the container data is used to indicate the number of containers used by the target application in the target time period and the hardware parameter data of the server where the container is located;
[0084] The first allocation module 806 is configured to allocate containers and servers to the target application according to the container data within a target time period.
[0085] Optionally, the application deployment device may be used in an adjustment phase after containerized deployment of the application. After the application is containerized, data of the container and the server may be obtained to predict optimal container data and server data for the application.
[0086] The above container refers to the technology used to bundle an application and all its necessary files into a running environment. As a unit, the container can be easily moved and run on any operating system in any environment.
[0087] The target application mentioned above can be deployed on the container for a period of time. During this period, data of the application running process after the application is deployed in the container is obtained. This part of data is the historical data.
[0088] In this embodiment, the container data and server data during the application operation process can be collected after each application is deployed, or the container data and server data during the application operation process can be collected for a specific application. Whether to collect data and which application data to collect can be set at any time. For example, after the containerized deployment of application 1, the data of application 1 is collected. After collecting data for two days, it is set to stop collecting data for application 1. After an interval of one day, it is set to continue collecting data for one day. Then the data of application 1 for the first, second, and fourth days are collected.
[0089] In this embodiment, the collected data is divided into several types. The first is the operating status data of the server, including whether the server is running or not running. If the server is not running, it may be a server failure. The second is the network load data, including the network load of the server. The third is the billing data of the target application using the container, including the fees generated by the container used by the target application. The fourth is the resource usage data of the server, that is, the number of central processing units (CPUs) and memory size occupied by the target program deployed in the container.
[0090] After collecting the above data, the container data of the target application in the next target time period can be predicted based on the above data. The target time period can be a subsequent time period immediately adjacent to the current time, or a time period in the future. For example, if the current time point is 12:00, the target time period can be from 12:00 to 18:00, or from 18:00 to 20:00. The next containerized deployment cycle of the target application can be used as the target time period.
[0091] The container data may include the optimal number of containers for containerized deployment of the target application and the number of CPUs and memory size of the server used. The number of CPUs and memory size of the server allocated to the target application within the target time period are determined through prediction, so as to deploy the target application.
[0092] The method provided in the embodiment of the present application can predict the number of containers to be used by the target application within a target time period and the hardware parameter data of the server where the container is located by using data such as the server operation status data of the server where the container of the target application is deployed, the network load data of the server, the billing data of the target application using the container, and the resource usage data of the server, so that the containers and servers can be allocated according to actual needs, thereby achieving the effect of accurately allocating containers and servers when deploying applications on containers.
[0093] For other examples of this embodiment, please refer to the above examples and will not be described in detail here.
[0094] like Fig. 9 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0095] Memory 113, used for storing computer programs;
[0096] In one embodiment of the present application, the processor 111 is used to execute the program stored in the memory 113 to implement the application deployment method provided by any of the above method embodiments, including:
[0097] When a target application is deployed on the container, historical data of the target application running in the container is obtained, wherein the historical data includes server running status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource usage data of the server;
[0098] Predicting container data of the target application based on historical data, wherein the container data is used to indicate the number of containers used by the target application in a target time period and hardware parameter data of the server where the containers are located;
[0099] Allocate containers and servers to target applications based on container data during a target time period.
[0100] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the application deployment method provided in any of the aforementioned method embodiments are implemented.
[0101] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0103] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0104] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. An application deployment method, characterized in that: include: When a target application is deployed on a container, historical data of the target application running in the container is obtained, wherein the historical data includes server running status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource usage data of the server; Predicting container data of the target application based on the historical data, wherein the container data is used to indicate the number of containers used by the target application and hardware parameter data of a server where the containers are located within a target time period; A container and a server are allocated to the target application according to the container data within the target time period.
2. The method according to claim 1, characterized in that In the case where the target application is deployed on the container, obtaining the historical data of the target application running in the container includes: Taking a predetermined time length as a time period, within multiple time periods, the server operation status data, the server network load data, the billing data and the server resource occupancy data within each time period are obtained as a copy of the historical data, thereby obtaining multiple copies of the historical data corresponding to the multiple time periods.
3. The method according to claim 2, characterized in that The predicting the container data of the target application according to the historical data includes: From the multiple copies of the historical data, select historical data in which the server operation status data is running, the network load data is less than a network threshold, the bill data is less than a bill threshold, and the resource occupancy data of the server is less than an occupancy threshold as first historical data, and determine the first historical data and the number of containers corresponding to the first historical data and the hardware parameter data of the server as positive sample data; From the multiple copies of the historical data, select historical data in which the server operation status data is non-operating, or the network load data is greater than the network threshold, or the bill data is greater than the bill threshold, or the resource occupancy data of the server is greater than the occupancy threshold as the second historical data, and determine the second historical data and the number of containers corresponding to the second historical data and the hardware parameter data of the server as negative sample data; Using the positive sample data and the negative sample data to train the original prediction model to obtain a target prediction model; The container data of the target application is predicted according to the historical data and the target prediction model.
4. The method according to claim 3, characterized in that The predicting the container data of the target application according to the historical data and the target prediction model includes: Predicting, based on the historical data, server operation status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource usage data of the server within the target time period; Inputting the server operation status data of the server where the container is located, the network load data of the server, the billing data of the target application using the container, and the resource occupancy data of the server predicted within the target time period into the target prediction model; The output result of the target prediction model is determined as the container data of the target application.
5. The method according to claim 4, characterized in that Inputting the server running status data of the server where the container is located within the predicted target time period, the network load data of the server, the billing data of the target application using the container, and the resource occupation data of the server into the target prediction model includes: When receiving at least one of the input data of server operation status of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource usage data of the server, replacing the predicted data with the input data; The replaced data is input into the target prediction model.
6. The method according to claim 1, characterized in that The allocating a container and a server to the target application according to the container data within the target time period includes: Allocate a server and a container for the target application according to the number of containers in the container data and the number of CPU cores and memory size of the server; After the container is run on the allocated server and the target application is deployed on the container, if the response rate of the target application is lower than a response threshold, a server having a greater number of central processing unit cores than the number of central processing unit cores in the container data and a greater memory size than the memory size in the container data is allocated to the target application from a standby server, or a number of containers greater than the number of containers in the container data is allocated.
7. The method according to claim 1, characterized in that After allocating a container and a server to the target application according to the container data within the target time period, the method further includes: A container and a server are allocated to a first application according to the container data within the target time period, wherein an application tag of the first application is the same as an application tag of the target application.
8. An application deployment device, characterized in that: include: an acquisition module, configured to, when a target application is deployed on a container, acquire historical data of the target application running in the container, wherein the historical data includes server operation status data of the server where the container is located, network load data of the server, billing data of the target application using the container, and resource usage data of the server; A prediction module, used to predict container data of the target application based on the historical data, wherein the container data is used to indicate the number of containers used by the target application and hardware parameter data of the server where the containers are located within a target time period; The first allocation module is used to allocate a container and a server to the target application according to the container data within the target time period.
9. An electronic device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, wherein the storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to execute the method described in any one of claims 1 to 7 of the present application.