Java back-end service automatic scaling management method and device, storage medium and intelligent terminal
By using machine learning and reinforcement learning models, the number of best service instances for Java back-end services is automatically determined, and the problem that traditional automatic scaling mechanism relies on manual threshold setting is solved, and intelligent and refined automatic scaling is realized, which improves services Efficiency and resource utilization.
Patent Information
- Application Number
- CN202411187846.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-06
AI Technical Summary
The automatic scaling mechanism of traditional Java back-end services relies on manually setting preset thresholds and simple rules, making it difficult to accurately match complex and changeable business needs, resulting in response delays and over-allocation of resources.
By obtaining performance indicator data and business application scenarios of Java back-end services, using pre-trained machine learning models for load prediction, and combining reinforcement learning models to determine the best number of service instances, realizing automatic scaling management and reducing dependence on humans.
It realizes an intelligent and refined automatic scaling mechanism, improves the effectiveness of Java back-end services, reduces response delays and over-allocation of resources, and adapts to match complex and changeable business needs.
Smart Images

Figure CN119088658A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a Java backend service automatic scaling management method, device, storage medium and intelligent terminal. Background Art
[0002] At present, cloud computing technology is widely used, and the resource load changes of cloud computing backend servers are becoming more and more complex. In Java backend services, automatic scaling mechanisms can be used to ensure that services can be automatically adjusted according to load.
[0003] However, the automatic scaling mechanism of traditional Java backend services relies on manually set preset thresholds and simple rules, which makes it difficult to accurately match complex and changing business needs, resulting in response delays or over-allocation of resources. How to match complex and changing business needs, reduce the dependence of the automatic scaling mechanism in Java backend services on manual work, avoid response delays and over-allocation of resources as much as possible, and realize an intelligent and refined automatic scaling mechanism are technical problems that need to be solved at present. Summary of the invention
[0004] The embodiments of the present application provide a Java backend service automatic scaling management method, device, storage medium and intelligent terminal, which can match complex and changeable business needs, reduce the dependence of the automatic scaling mechanism in the Java backend service on manual work, avoid response delays and excessive resource allocation as much as possible, and realize an intelligent and refined automatic scaling mechanism.
[0005] In a first aspect, an embodiment of the present application provides a Java backend service automatic scaling management method, the method comprising:
[0006] Obtain the performance indicator data of the Java backend service during operation, as well as the business application scenarios of the Java backend service;
[0007] Obtain a load prediction result of the Jave backend service according to the performance indicator data, the business application scenario and the target machine learning model, wherein the target machine learning model is a pre-trained machine learning model used to predict the service load of the Jave backend service;
[0008] Determine the optimal number of service instances of the Java backend service based on the load prediction result and the target reinforcement learning model;
[0009] Based on the optimal number of service instances, automatic scaling management is performed on the Jave backend service.
[0010] In a possible implementation manner of the first aspect, the step of obtaining a load prediction result of the Jave backend service according to the performance indicator data, the business application scenario, and the target machine learning model includes:
[0011] Based on the business application scenario, determine the size of the time window;
[0012] Dividing the performance indicator data based on sliding the time window;
[0013] Construct target features for the divided performance indicator data;
[0014] The target features are input into the target machine learning model, and the target machine learning model is used to predict the load of the Jave backend service in the future period of time to obtain the load prediction result of the Jave backend service.
[0015] In a possible implementation manner of the first aspect, the target features include performance features, seasonal change features, special event features, and time series features, and the step of constructing the target features for the divided performance indicator data includes:
[0016] Extracting performance features from the performance indicator data within each of the time windows;
[0017] According to the business application scenario, extract seasonal variation characteristics and special event characteristics from the divided performance indicator data;
[0018] Calculate the change rate and change acceleration of the performance indicator data in adjacent time windows;
[0019] Based on the change rate and the change acceleration, construct a time series feature;
[0020] Target features are constructed according to the performance features, the seasonal variation features, the special event features and the time series features.
[0021] In a possible implementation manner of the first aspect, the step of determining the optimal number of service instances of the Java backend service according to the load prediction result and the target reinforcement learning model includes:
[0022] Get the current number of service instances;
[0023] Acquisition cost requirements and service quality requirements;
[0024] Designing a state space according to the performance indicator data, the current number of service instances, the load prediction result, and the cost requirement and service quality requirement;
[0025] The load prediction result is used as the input of the target reinforcement learning model, and the target reinforcement learning model is used to output the optimal number of service instances of the Jave backend service based on the state space.
[0026] In a possible implementation manner of the first aspect, after the step of automatically scaling the Java backend service based on the optimal number of service instances, the method includes:
[0027] Monitor the load and cost changes of the Java backend service after the automatic scaling management;
[0028] Iteratively updating the target machine learning model according to the monitored load conditions;
[0029] The target reinforcement learning model is optimized according to the load condition and the cost change.
[0030] In a possible implementation manner of the first aspect, before the step of obtaining the load prediction result of the Java backend service according to the performance indicator data, the business application scenario, and the target machine learning model, the step includes:
[0031] Collect historical performance indicator data and historical business application scenarios of the Java backend service operation;
[0032] Constructing a historical feature data set based on the historical performance indicator data and the historical business application scenarios;
[0033] Based on the historical feature data set, training a preset machine learning model;
[0034] When the performance evaluation result of the machine learning model meets the preset evaluation criteria, the target machine learning model is obtained.
[0035] In a second aspect, an embodiment of the present application provides a Java backend service automatic scaling management device, the device comprising:
[0036] An information acquisition unit, used to acquire performance indicator data of the Java backend service when it is running, and the business application scenario of the Java backend service;
[0037] A load prediction unit, used to obtain a load prediction result of the Jave backend service according to the performance indicator data, the business application scenario and the target machine learning model, wherein the target machine learning model is a pre-trained machine learning model used to predict the service load of the Jave backend service;
[0038] An optimal instance determination unit, used to determine the optimal number of service instances of the Java backend service according to the load prediction result and the target reinforcement learning model;
[0039] The automatic scaling management unit is used to perform automatic scaling management on the Jave backend service based on the optimal number of service instances.
[0040] In a third aspect, an embodiment of the present application provides an intelligent terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the Java backend service automatic scaling management method as described in the first aspect above is implemented.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the Java backend service automatic scaling management method as described in the first aspect above is implemented.
[0042] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a smart terminal, the smart terminal executes the Java backend service automatic scaling management method as described in the first aspect above.
[0043] In an embodiment of the present application, the intelligent terminal first obtains the performance indicator data of the Jave back-end service during operation, as well as the business application scenarios of the Jave back-end service, and then obtains the load prediction results of the Jave back-end service based on the performance indicator data, the business application scenarios and the target machine learning model, which can effectively predict the load of the Jave back-end service under each business scenario, and then intelligently determines the optimal number of service instances of the Jave back-end service based on the load prediction results and the target reinforcement learning model, which can adaptively match complex and changeable business needs, and finally, based on the optimal number of service instances, automatically scales the Jave back-end service, effectively reducing the dependence of the automatic scaling mechanism in the Java back-end service on manual labor, avoiding response delays and excessive resource allocation as much as possible, thereby realizing an intelligent and refined automatic scaling mechanism and improving the effectiveness of the Java back-end service. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0045] Figure 1 It is a flowchart of the implementation of the Java backend service automatic scaling management method provided in the embodiment of the present application;
[0046] Figure 2 It is a specific implementation flow chart of step S102 in the Java backend service automatic scaling management method provided in an embodiment of the present application;
[0047] Figure 3 It is a specific implementation flow chart of obtaining a target machine learning model in the Java backend service automatic scaling management method provided in an embodiment of the present application;
[0048] Figure 4 This is a specific implementation flow chart of step S103 in the Java backend service automatic scaling management method provided in an embodiment of the present application;
[0049] Figure 5 It is a specific implementation flow chart of the monitoring optimization model in the Java backend service automatic scaling management method provided in the embodiment of the present application;
[0050] Figure 6 It is a structural block diagram of a Java backend service automatic scaling management device provided in an embodiment of the present application;
[0051] Figure 7 It is a schematic diagram of a smart terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0053] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0054] It should also be understood that the term “and / or” used in the specification and appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0055] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0056] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0057] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0058] The voice information processing method provided in the embodiment of the present application can be applied to intelligent terminals such as servers and ultra-mobile personal computers (UMPCs). The embodiment of the present application does not impose any restrictions on the specific types of intelligent terminals.
[0059] Figure 1 The implementation process of the Java backend service automatic scaling management method provided by the embodiment of the present application is shown, and the method flow includes steps S101 to S104. The specific implementation principle of each step is as follows:
[0060] Step S101: Obtain performance indicator data of the Java backend service during operation, as well as the business application scenarios of the Java backend service.
[0061] The above performance indicator data is data related to the load of the Java backend service. The performance indicator data includes CPU usage, memory usage, request response time, network traffic, number of requests, number of concurrent users, etc. In some implementations, the performance indicator data also includes log information for a specific time period.
[0062] Jave backend services can be applied to e-commerce platforms, financial service platforms, online education platforms, medical and health systems, social media platforms, online games, etc. The business application scenarios of Jave backend services are extensive, for example, product management scenarios such as the addition, deletion, query and modification of goods, inventory update, etc. in e-commerce platforms; account management scenarios such as account opening, balance inquiry, transfer and remittance, transaction record inquiry, etc. in financial service platforms; investment and financial management scenarios such as the purchase, redemption, and return calculation of financial products such as funds, stocks, and bonds; course management scenarios such as course creation, publishing, updating, and delisting in online education platforms; patient information management scenarios such as medical records, appointment registration, and examination result inquiry in medical and health systems. Content publishing and sharing scenarios such as posting, commenting, liking, and sharing of posts, pictures, videos, etc. on social media platforms.
[0063] In this embodiment, the performance indicator data of the Java backend service at runtime are different in different business application scenarios. The performance indicator data of the Java backend service at runtime is obtained in real time, and the business application scenario of the Java backend service is also obtained, so that the load can be predicted in combination with the business application scenario later, which can improve the effectiveness of load prediction.
[0064] Step S102: Obtain the load prediction result of the Jave backend service based on the performance indicator data, the business application scenario and the target machine learning model.
[0065] The target machine learning model is a pre-trained machine learning model used to predict the service load of the Java backend service. The load prediction results include CPU usage, memory usage, request response time, network traffic, number of requests, number of concurrent users and other predicted performance indicator data in the future.
[0066] In an embodiment of the present application, a pre-trained machine learning model is used to predict the load of a Java backend service based on the performance indicator data of the Java backend service and its business application scenarios. This does not rely on preset thresholds and manually defined simple rules, and can realize intelligent load prediction of the Java backend service. At the same time, load prediction is performed in combination with business application scenarios to improve the accuracy and effectiveness of load prediction.
[0067] As an embodiment of the present application, Figure 2 The specific implementation process of step S102 of the Java backend service automatic scaling management method provided in the embodiment of the present application is shown, and is described in detail as follows:
[0068] A1: Determine the size of the time window based on the business application scenario.
[0069] The size of the time window is determined according to the business application scenario, for example, 1 hour, 1 day, 1 week, etc. In this embodiment, the size of the time window is determined according to the characteristics of the business application scenario and the granularity of the data.
[0070] A2: Divide the performance indicator data based on sliding the time window.
[0071] Exemplarily, the time window is 1 hour, and the 24 hours including the current time are divided into 24 time intervals. The sliding average of the data in different time windows is calculated, which can be a simple sliding average or a weighted sliding average.
[0072] In some embodiments, a sliding median and a sliding standard deviation are also calculated. The sliding median and the sliding mean are similar, but more robust to outliers. The sliding standard deviation is used to measure the volatility of time series features in different time windows.
[0073] A3: Construct target features for the divided performance indicator data.
[0074] In the embodiment of the present application, the target characteristics include performance characteristics, seasonal change characteristics, special event characteristics and time series characteristics.
[0075] Extract performance features from the performance indicator data in each of the time windows, where the performance features refer to data values of the performance indicator data. Performance features include peak values and valley values, which can be identified by comparing continuous sliding window values, and rolling maximum and minimum functions can be used to assist in identifying peak values and valley values.
[0076] According to the business application scenario, seasonal change characteristics and special event characteristics are extracted from the divided performance indicator data. Seasonal change characteristics refer to characteristics of seasonal changes according to business application scenarios. It should be noted that the seasonal changes are periodic changes determined according to the characteristics of the business application scenario, for example, periodic changes by week, month or year. Different business application scenarios may have different corresponding change cycles. Create a designated calendar for holidays or designated events, and mark these dates as special time features. Extract special event features by determining the date to which the performance indicator data is obtained. When the date to which the performance indicator data is obtained is not in the above-mentioned designated calendar, the special event feature is a null value.
[0077] Calculate the change rate and change acceleration of the performance indicator data of adjacent time windows. Based on the change rate and change acceleration, construct the time series features. Use the change rate and change acceleration to capture the dynamic characteristics of the time series.
[0078] In this embodiment, a target feature is constructed based on the performance feature, the seasonal variation feature, the special event feature and the time series feature. The target feature is a feature that includes a time series.
[0079] A4: Input the target feature into the target machine learning model, use the target machine learning model to predict the load of the Jave backend service in the future, and obtain the load prediction result of the Jave backend service. The length of the future period of time can be set according to the characteristics of the business application scenario, or customized according to user needs.
[0080] In an embodiment of the present application, the intelligent terminal integrates and deploys a target machine learning model, inputs target features including time series into the target machine learning model, and uses the target machine learning model to intelligently and real-time predict the load of the Java backend service in the future, thereby improving the effectiveness and accuracy of the load prediction.
[0081] As a possible implementation of this application, Figure 3 A specific implementation process of obtaining a target machine learning model in the Java backend service automatic scaling management method provided in an embodiment of the present application is shown, and is described in detail as follows:
[0082] B1: Collect historical performance indicator data and historical business application scenarios of the Java backend service operation.
[0083] In some implementations, data preprocessing is performed on the collected historical performance indicator data, such as data standardization or normalization, to eliminate marketing of different dimensions.
[0084] B2: Construct a historical feature data set based on the historical performance indicator data and the historical business application scenarios. The historical feature data set includes historical performance features, historical seasonal change features, historical special event features, and historical time series features.
[0085] In some implementations, historical activity event features, historical trend features, and hysteresis features are also included. Historical activity event features are used to identify historical activity events corresponding to historical performance indicator data. For example, obtain promotional activity events corresponding to historical performance indicator data. Use time series decomposition methods, such as STL (Loess method for seasonal trend decomposition) to separate historical trend features such as trends, seasonality, and random components. Construct hysteresis features to reflect the impact of data in the past time period on the present or future.
[0086] B3: Based on the historical feature data set, a preset machine learning model is trained. The preset machine learning model is a model suitable for time series prediction, such as a Long Short-Term Memory (LSTM) model, an Autoregressive Integrated Moving Average Model (ARIMA) or an open source prediction tool Prophet.
[0087] In this embodiment, the historical feature data set can be divided into a training set, a validation set and a test set. The training set is used to train the above-mentioned preset machine learning model, the test set is used to test and tune the model, and the validation set is used to evaluate the performance of the model to ensure the generalization ability of the model.
[0088] B4: When the performance evaluation result of the machine learning model meets the preset evaluation criteria, the target machine learning model is obtained.
[0089] In this embodiment, the evaluation index of the model may be determined according to the business application scenario or user needs, such as mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), etc. The performance of the learning model is evaluated based on the evaluation index to determine whether the result of the performance evaluation meets the preset evaluation standard, for example, whether the mean square error is within the preset error threshold range.
[0090] In an embodiment of the present application, the machine learning model is trained, tested and verified based on historical performance indicator data, and the model hyperparameters are optimized, which can effectively ensure the prediction accuracy of the machine learning model.
[0091] Step S103: Determine the optimal number of service instances of the Jave backend service according to the load prediction result and the target reinforcement learning model.
[0092] The target reinforcement learning model is a pre-trained reinforcement learning model used to determine the optimal number of service instances. The so-called optimal number of service instances refers to the optimal number that satisfies the normal operation of the Java backend service and meets business requirements such as cost and service quality.
[0093] As an embodiment of the present application, Figure 4 The specific implementation process of step S103 of the Java backend service automatic scaling management method provided in the embodiment of the present application is shown, and is described in detail as follows:
[0094] C1: Get the current number of service instances, that is, get the real-time number of service instances of the Java backend service.
[0095] C2: Acquisition cost requirements and service quality requirements.
[0096] C3: Designing a state space according to the performance indicator data, the current number of service instances, the load prediction result, and the cost requirements and service quality requirements.
[0097] C4: Using the load prediction result as the input of the target reinforcement learning model, and using the target reinforcement learning model to output the optimal number of service instances of the Jave backend service based on the state space.
[0098] In this embodiment, a reinforcement learning model is pre-built and trained to obtain the target reinforcement learning model for automatically deciding the optimal number of service instances of the Java backend service. The construction of the reinforcement learning model includes environment definition and model architecture selection and construction.
[0099] For example, the target reinforcement learning model finds that the data traffic surged during a holiday last year based on historical data, and it is very likely that this holiday will also be a peak period this year. A reasonable service instance value is calculated before the holiday, and a few more service applications are added to ensure service quality. After the peak period, the number of service instances will be reduced. The service quality is evaluated based on the stability of the service and its ability to withstand pressure during peak traffic.
[0100] Environment definition and construction, environment definition includes state, action and reward. Among them, state refers to performance indicator data. In this embodiment, the state space can be designed according to the performance indicator data and business application scenarios; action is to adjust the number of service instances. Define the scope of the action space, that is, define the number of instances that can be increased or decreased. The action space is discrete because the number of instances is usually an integer. The reward function should comprehensively consider the cost (number of instances) and service quality (response time, error rate). For example, a decrease in service response time under high load (that is, a decrease in service quality) can be given a negative reward, and an increase in cost can also be given a negative reward. In one possible implementation, a reward function is defined that combines cost and service quality, as shown in the following formula (1):
[0101] Reward=a*Quality-b*Cost (1)
[0102] Among them, Reward represents reward, Quality represents quality, Cost represents loss, and a and b are weight coefficients that can be adjusted according to business needs.
[0103] In this embodiment, the choice of model architecture can consider the deep Q network (DQN). DQN combines Q learning algorithm and deep learning to handle complex decision-making problems. Use deep learning frameworks such as TensorFlow or PyTorch to build a DQN model. The DQN model includes an input layer, a hidden layer, and an output layer. Among them, the input layer is used to receive the state space, the hidden layer is a fully connected layer using the ReLU activation function, and the output layer is used to output the Q value of each possible action.
[0104] Before training the reinforcement learning model, collect historical data, including historical load, historical number of instances, cost, and service quality indicators. Use time difference error as the loss function, choose optimizers such as Adam or RMSprop, and use priority experience replay to improve learning efficiency. Use a periodically updated target network to stabilize training.
[0105] During the training of the reinforcement learning model, the neural network weights are randomly initialized. The ε-greedy strategy is used for exploration, and iterative training is adopted. At each time step, an action is selected according to the current strategy. When performing an action, the next state and reward are observed, and the experience is stored in the replay buffer using the observed transitions. Experience is sampled from the replay buffer and the network is updated. The target network is updated periodically. The performance of the model can be evaluated using historical data.
[0106] In an embodiment of the present application, a cloud service platform or other intelligent terminal integrates the above-mentioned target reinforcement learning model, and uses the load prediction result output by the target machine learning model as the input of the target reinforcement learning model. The target reinforcement learning model is used to intelligently decide the number of service instances that are most suitable for the Java backend based on the load prediction result. This can adaptively match complex and changeable business needs, effectively reduce the dependence of the automatic scaling mechanism in the Java backend service on manual work, and avoid response delays and excessive resource allocation as much as possible, thereby realizing an intelligent and refined automatic scaling mechanism and improving the effectiveness of Java backend services.
[0107] Step S104: Based on the optimal number of service instances, automatically scale the Java backend service.
[0108] Based on the optimal number of service instances, the number of real-time service instances of the Jave backend service is adjusted, that is, the number of real-time service instances of the Jave backend service is increased or decreased.
[0109] In this embodiment, the target reinforcement learning model is integrated with the cloud service platform, and the number of real-time instances is automatically adjusted based on the optimal number of service instances output by the target reinforcement learning model to ensure a smooth transition and avoid service interruption.
[0110] As an embodiment of the present application, Figure 5As shown, after the step of automatically scaling the Java backend service based on the optimal number of service instances, the following steps are included:
[0111] D1: Monitor the load and cost change of the Java backend service after the automatic scaling management. The cost change refers to the difference between the current cost and the cost before the automatic scaling management of the Java backend service.
[0112] D2: Iteratively update the target machine learning model according to the monitored load conditions.
[0113] D3: Optimizing the target reinforcement learning model according to the load condition and the cost change.
[0114] In this implementation, the actual load and resource usage after the execution of automatic scaling management are monitored, the actual load is compared with the load prediction results, the source of errors is analyzed, and the machine learning model and reinforcement learning model are retrained regularly with new data to continuously iterate and optimize the prediction accuracy and decision quality.
[0115] In an embodiment of the present application, the intelligent terminal first obtains the performance indicator data of the Jave back-end service during operation, as well as the business application scenario of the Jave back-end service, and then obtains the load prediction result of the Jave back-end service based on the performance indicator data, the business application scenario and the target machine learning model, which can effectively predict the load of the Jave back-end service under each business scenario, and then intelligently determines the optimal number of service instances of the Jave back-end service based on the load prediction result and the target reinforcement learning model, which can adaptively match complex and changeable business needs, and finally, based on the optimal number of service instances, automatically scales the Jave back-end service, effectively reducing the dependence of the automatic scaling mechanism in the Java back-end service on manual labor, avoiding response delays and excessive resource allocation as much as possible, thereby realizing an intelligent and refined automatic scaling mechanism, effectively coping with traffic fluctuations, and optimizing resource utilization efficiency and cost control.
[0116] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0117] Corresponding to the Java backend service automatic scaling management method described in the above embodiment, Figure 6 The structural block diagram of the Java backend service automatic scaling management device provided in the embodiment of the present application is shown. For the convenience of description, only the part related to the embodiment of the present application is shown.
[0118] Reference Figure 6The Java backend service automatic scaling management device includes: an information acquisition unit 61, a load prediction unit 62, a best instance determination unit 63, and an automatic scaling management unit 64, wherein:
[0119] The information acquisition unit 61 is used to acquire the performance indicator data of the Java backend service when it is running, and the business application scenario of the Java backend service;
[0120] A load prediction unit 62 is used to obtain a load prediction result of the Jave backend service according to the performance indicator data, the business application scenario and the target machine learning model, wherein the target machine learning model is a pre-trained machine learning model used to predict the service load of the Jave backend service;
[0121] An optimal instance determination unit 63, configured to determine the optimal number of service instances of the Java backend service according to the load prediction result and the target reinforcement learning model;
[0122] The automatic scaling management unit 64 is used to perform automatic scaling management on the Java backend service based on the optimal number of service instances.
[0123] As a possible implementation manner of the present application, the load prediction unit includes:
[0124] A window determination module, used to determine the size of the time window based on the business application scenario;
[0125] A data partitioning module, used for partitioning the performance indicator data based on sliding the time window;
[0126] A target feature construction module is used to construct target features for the divided performance indicator data;
[0127] The load prediction module is used to input the target features into the target machine learning model, use the target machine learning model to predict the load of the Jave backend service in the future, and obtain the load prediction result of the Jave backend service.
[0128] As a possible implementation of the present application, the target features include performance features, seasonal change features, special event features, and time series features. The target feature construction module is specifically used for:
[0129] Extracting performance features from the performance indicator data within each of the time windows;
[0130] According to the business application scenario, extract seasonal variation characteristics and special event characteristics from the divided performance indicator data;
[0131] Calculate the change rate and change acceleration of the performance indicator data in adjacent time windows;
[0132] Based on the change rate and the change acceleration, a time series feature is constructed.
[0133] Target features are constructed according to the performance features, the seasonal variation features, the special event features and the time series features.
[0134] As a possible implementation of the present application, the best example determination unit 63 includes:
[0135] The instance quantity acquisition module is used to obtain the current number of service instances;
[0136] Demand acquisition module, used to obtain cost requirements and service quality requirements;
[0137] A state space design module, used to design a state space according to the performance indicator data, the current number of service instances, the load prediction result, and the cost requirement and service quality requirement;
[0138] The optimal instance determination module is used to use the load prediction result as the input of the target reinforcement learning model, and use the target reinforcement learning model to output the optimal number of service instances of the Jave backend service based on the state space.
[0139] As a possible implementation mode of the present application, the above-mentioned Java backend service automatic scaling management device further includes:
[0140] A scaling management detection unit, used to monitor the load and cost changes of the Java backend service after the automatic scaling management;
[0141] A first model updating unit, configured to iteratively update the target machine learning model according to the monitored load condition;
[0142] The second model updating unit is used to optimize the target reinforcement learning model according to the load condition and the cost change.
[0143] As a possible implementation manner of the present application, the above-mentioned Java backend service automatic scaling management device further includes a first model training unit, which is used to:
[0144] Collect historical performance indicator data and historical business application scenarios of the Java backend service operation;
[0145] Constructing a historical feature data set based on the historical performance indicator data and the historical business application scenarios;
[0146] Based on the historical feature data set, training a preset machine learning model;
[0147] When the performance evaluation result of the machine learning model meets the preset evaluation criteria, the target machine learning model is obtained.
[0148] In an embodiment of the present application, the intelligent terminal first obtains the performance indicator data of the Jave back-end service during operation, as well as the business application scenario of the Jave back-end service, and then obtains the load prediction result of the Jave back-end service based on the performance indicator data, the business application scenario and the target machine learning model, which can effectively predict the load of the Jave back-end service under each business scenario, and then intelligently determines the optimal number of service instances of the Jave back-end service based on the load prediction result and the target reinforcement learning model, which can adaptively match complex and changeable business needs, and finally, based on the optimal number of service instances, automatically scales the Jave back-end service, effectively reducing the dependence of the automatic scaling mechanism in the Java back-end service on manual work, avoiding response delays and excessive resource allocation as much as possible, thereby realizing an intelligent and refined automatic scaling mechanism and improving the effectiveness of the Java back-end service.
[0149] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0150] The present application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, Figures 1 to 5 Any step of a Java backend service automatic scaling management method.
[0151] The embodiment of the present application also provides an intelligent terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, Figures 1 to 5 Any step of a Java backend service automatic scaling management method.
[0152] The present application also provides a computer program product, which, when executed on a server, enables the server to execute the following Figures 1 to 5 Any step of a Java backend service automatic scaling management method.
[0153] Figure 7 is a schematic diagram of a smart terminal provided by an embodiment of the present application. Figure 7As shown, the intelligent terminal 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. When the processor 70 executes the computer program 72, the steps in the above-mentioned various Java backend service automatic scaling management method embodiments are implemented, such as Figure 1 Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 6 The functions of the units 61 to 64 are shown.
[0154] Exemplarily, the computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 72 in the smart terminal 7.
[0155] The intelligent terminal 7 may be an intelligent robot. The intelligent terminal 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of the intelligent terminal 7 and does not constitute a limitation on the intelligent terminal 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the intelligent terminal 7 may also include input and output devices, network access devices, buses, etc.
[0156] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0157] The memory 71 may be an internal storage unit of the smart terminal 7, such as a hard disk or memory of the smart terminal 7. The memory 71 may also be an external storage device of the smart terminal 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the smart terminal 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the smart terminal 7. The memory 71 is used to store the computer program and other programs and data required by the smart terminal. The memory 71 may also be used to temporarily store data that has been output or is to be output.
[0158] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0159] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0160] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0161] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0162] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A Java backend service automatic scaling management method, characterized in that: The method comprises: Obtain the performance indicator data of the Java backend service during operation, as well as the business application scenarios of the Java backend service; Obtain a load prediction result of the Jave backend service according to the performance indicator data, the business application scenario and the target machine learning model, wherein the target machine learning model is a pre-trained machine learning model used to predict the service load of the Jave backend service; Determine the optimal number of service instances of the Java backend service based on the load prediction result and the target reinforcement learning model; Based on the optimal number of service instances, automatic scaling management is performed on the Jave backend service.
2. The Java backend service automatic scaling management method according to claim 1, characterized in that: The step of obtaining the load prediction result of the Java backend service according to the performance indicator data, the business application scenario and the target machine learning model includes: Based on the business application scenario, determine the size of the time window; Dividing the performance indicator data based on sliding the time window; Construct target features for the divided performance indicator data; The target features are input into the target machine learning model, and the target machine learning model is used to predict the load of the Jave backend service in the future period of time to obtain the load prediction result of the Jave backend service.
3. The Java backend service automatic scaling management method according to claim 2, characterized in that: The target features include performance features, seasonal change features, special event features, and time series features. The step of constructing target features for the divided performance indicator data includes: Extracting performance features from the performance indicator data within each of the time windows; According to the business application scenario, extract seasonal variation characteristics and special event characteristics from the divided performance indicator data; Calculate the change rate and change acceleration of the performance indicator data in adjacent time windows; Based on the change rate and the change acceleration, construct a time series feature; Target features are constructed according to the performance features, the seasonal variation features, the special event features and the time series features.
4. The Java backend service automatic scaling management method according to claim 1, characterized in that: The step of determining the optimal number of service instances of the Java backend service according to the load prediction result and the target reinforcement learning model includes: Get the current number of service instances; Acquisition cost requirements and service quality requirements; Designing a state space according to the performance indicator data, the current number of service instances, the load prediction result, and the cost requirement and service quality requirement; The load prediction result is used as the input of the target reinforcement learning model, and the target reinforcement learning model is used to output the optimal number of service instances of the Jave backend service based on the state space.
5. The Java backend service automatic scaling management method according to claim 1, characterized in that: After the step of automatically scaling the Java backend service based on the optimal number of service instances, the following steps are included: Monitor the load and cost changes of the Java backend service after the automatic scaling management; Iteratively updating the target machine learning model according to the monitored load conditions; The target reinforcement learning model is optimized according to the load condition and the cost change.
6. The Java backend service automatic scaling management method according to any one of claims 1 to 5, characterized in that: Before the step of obtaining the load prediction result of the Java backend service according to the performance indicator data, the business application scenario and the target machine learning model, it includes: Collect historical performance indicator data and historical business application scenarios of the Java backend service operation; Constructing a historical feature data set based on the historical performance indicator data and the historical business application scenarios; Based on the historical feature data set, training a preset machine learning model; When the performance evaluation result of the machine learning model meets the preset evaluation criteria, the target machine learning model is obtained.
7. A Java backend service automatic scaling management device, characterized in that: The device comprises: An information acquisition unit, used to acquire performance indicator data of the Java backend service when it is running, and the business application scenario of the Java backend service; A load prediction unit, used to obtain a load prediction result of the Jave backend service according to the performance indicator data, the business application scenario and the target machine learning model, wherein the target machine learning model is a pre-trained machine learning model used to predict the service load of the Jave backend service; An optimal instance determination unit, used to determine the optimal number of service instances of the Java backend service according to the load prediction result and the target reinforcement learning model; The automatic scaling management unit is used to perform automatic scaling management on the Jave backend service based on the optimal number of service instances.
8. The Java backend service automatic scaling management device according to claim 7, characterized in that: The load prediction unit comprises: A window determination module, used to determine the size of the time window based on the business application scenario; A data partitioning module, used for partitioning the performance indicator data based on sliding the time window; A target feature construction module is used to construct target features for the divided performance indicator data; The load prediction module is used to input the target features into the target machine learning model, use the target machine learning model to predict the load of the Jave backend service in the future, and obtain the load prediction result of the Jave backend service.
9. An intelligent terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the Java backend service automatic scaling management method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the Java backend service automatic scaling management method according to any one of claims 1 to 6 is implemented.
