Container elasticity method, apparatus, device, and medium

By monitoring user data and predictive models, the size of the container cluster can be adjusted in advance, solving the problem that existing technologies cannot respond to sudden increases in access volume in a timely manner, and achieving more efficient resource management and system performance.

CN115981796BActive Publication Date: 2026-07-21INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-02-10
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing elastic scaling methods cannot cope with sudden increases in access volume in a timely manner, resulting in untimely expansion or unnecessary waste of resources, and failing to meet instantaneous computing needs.

Method used

By monitoring user data, predicting future access volume, and scaling up or down the container cluster in advance, the computing resources of the system's services can be refined using user behavior prediction models, and the size of the container cluster can be dynamically adjusted.

Benefits of technology

It enables a more rational allocation of computing resources under limited resources, reduces resource consumption, meets business needs, and improves system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115981796B_ABST
    Figure CN115981796B_ABST
Patent Text Reader

Abstract

Provided is a container elastic scaling method, relating to the field of cloud computing. The method comprises: monitoring login user data of N channel ends, N being greater than or equal to 1; predicting, according to the login user data, a first user access amount of each system service in M system services in a future first time period, wherein each system service corresponds to a separately established container cluster, and M is greater than or equal to 2; for each system service, performing a computing resource evaluation on a current container cluster according to the first user access amount to obtain an evaluation result; and when the evaluation result of any one of the M system services meets an expansion or contraction condition, performing an expansion or contraction processing on the container cluster of the system service in advance. Also provided are a container elastic scaling device, equipment, a storage medium and a program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of cloud computing, and more specifically to container elastic scaling methods, apparatus, devices, media, and program products. Background Technology

[0002] Elastic scaling is a service that automatically adjusts computing capacity (such as the number of container instances) based on business needs and strategies. In other words, it automatically adds and reduces the number of service container instances based on server usage.

[0003] Current elastic scaling methods are typically based on timed rules or settings that adjust according to changes in computer resources. Timed rules involve configuring elastic scaling to be executed once or repeatedly at fixed time points. Adjusting according to changes in computer resources involves monitoring changes in system resources such as CPU and memory, and triggering elastic scaling when the changes reach a certain threshold.

[0004] In realizing the concept of this invention, the inventors discovered that when access volume surges, computing resources increase instantaneously, and elastic scaling cannot cope with this situation in time. If concurrency surges, the system's CPU and memory usage may increase instantaneously, and only then is expansion triggered. Container startup takes time, thus the elastic scaling does not actually achieve its intended purpose of firefighting. Furthermore, untimely elastic scaling down also leads to resource waste. Summary of the Invention

[0005] In view of the above problems, this disclosure provides methods, apparatus, devices, media and procedures for the elastic stretching of containers.

[0006] One aspect of this disclosure provides a container elastic scaling method, comprising: monitoring login user data from N channels, where N is greater than or equal to 1; predicting the first user access volume of each of M system services within a future first time period based on the login user data, wherein each system service corresponds to a separate container cluster, and M is greater than or equal to 2; for each system service, evaluating the computing resources of the current container cluster based on the first user access volume to obtain an evaluation result; and when the evaluation result of any of the M system services meets the conditions for expansion or contraction, performing expansion or contraction processing on the container cluster of that system service in advance.

[0007] In some embodiments, predicting the first user access volume of each of the M system services in a future first time period includes: obtaining S user features for each logged-in user based on the logged-in user data, where S is greater than or equal to 1; inputting the S user features of each logged-in user into a user behavior prediction model, wherein the user behavior prediction model is pre-trained based on the user features and access behaviors of historical logged-in users; and obtaining a first prediction result output by the user behavior prediction model, wherein the first prediction result includes the system services accessed by each logged-in user in the first time period.

[0008] In some embodiments, the user behavior prediction model is constructed based on a decision tree algorithm, and pre-training the user behavior prediction model includes: constructing a first-stage decision tree model based on S user features of each historical login user in the past second time period; and pruning the first-stage decision tree model to obtain the user behavior prediction model.

[0009] In some embodiments, before predicting the first user access volume, the method further includes: dividing K system services according to business categories to obtain M types of system services, wherein each system service includes at least one system service, and K is greater than or equal to 1; and establishing M container clusters that correspond one-to-one with the M types of system services.

[0010] In some embodiments, after obtaining the first prediction result output by the user behavior prediction model, the method further includes: obtaining real-time access data for each logged-in user, the real-time access data including the system services currently accessed by each logged-in user; comparing the real-time access data with the first prediction result to obtain a comparison result; and when the comparison result for a predetermined number of logged-in users is a prediction error, re-predicting the second user access volume of each system service in a future third time period, the third time period being less than or equal to the first time period.

[0011] In some embodiments, the re-predicting of the second user access volume of each system service in a future third time period includes: for each login user whose prediction is incorrect, inputting S user characteristics and real-time access data of each login user into the user behavior prediction model; obtaining a second prediction result output by the user behavior prediction model, wherein the second prediction result includes the system services accessed by each login user in the third time period.

[0012] In some embodiments, the real-time access data further includes the page path currently accessed by each logged-in user, and inputting the S user features and real-time access data of each logged-in user into the user behavior prediction model includes: inputting the S user features of each logged-in user, the currently accessed system service, and the currently accessed page path into the user behavior prediction model.

[0013] In some embodiments, after scaling up or down the container cluster of such system service in advance, the method further includes: periodically re-predicting the first user access volume in a future fourth time period; and / or re-predicting the first user access volume in a future fourth time period in response to the changing trend of the number of logged-in users in the logged-in user data.

[0014] Another aspect of this disclosure provides a container elastic scaling device, comprising: a data monitoring module for monitoring login user data from N channels, where N is greater than or equal to 1; an access prediction module for predicting, based on the login user data, the first user access volume of each of M system services within a future first time period, wherein each system service corresponds to a separate container cluster, and M is greater than or equal to 2; a resource evaluation module for performing a computational resource evaluation on the current container cluster for each system service based on the first user access volume, and obtaining an evaluation result; and a scaling up / down module for performing scaling up or scaling down processing on the container cluster of any of the M system services in advance when the evaluation result of any system service meets the scaling up or scaling down conditions.

[0015] The container elastic expansion device includes modules for performing each step of the method described above.

[0016] Another aspect of this disclosure provides an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the method as described above.

[0017] Another aspect of this disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method described above.

[0018] Another aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the method described above.

[0019] The above one or more embodiments have the following beneficial effects: by predicting the behavior of logged-in users, the first user access volume of each system service in the first time period in the future can be determined, the computing resource consumption data can be assessed, and the container clusters of one or more system services can be scaled up or down in advance. Compared with the method of elastic scaling based on time or changes in computer resources, it can not only achieve advance processing through prediction, but also is no longer an advance processing for the entire system. It can be divided into M types of system services, and the container clusters of one or more system services can be elastically scaled up and down in advance in a refined manner. Under limited computing resources, resources can be allocated more rationally and dynamically, while meeting business needs. It can effectively reduce resource consumption and achieve greater efficiency with less expenditure. Attached Figure Description

[0020] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0021] Figure 1 A schematic diagram of a resilient telescopic system according to an embodiment of the present disclosure is shown.

[0022] Figure 2 A flowchart illustrating a container elastic stretching method according to an embodiment of the present disclosure is shown schematically.

[0023] Figure 3 A flowchart illustrating service partitioning according to an embodiment of this disclosure is shown schematically;

[0024] Figure 4 A flowchart illustrating the prediction of first user visits according to an embodiment of this disclosure is shown schematically.

[0025] Figure 5 A flowchart illustrating the re-prediction process according to an embodiment of this disclosure is shown schematically;

[0026] Figure 6 A flowchart illustrating the prediction of a second number of visits according to an embodiment of the present disclosure is shown schematically;

[0027] Figure 7 A flowchart illustrating a pre-trained user behavior prediction model according to an embodiment of the present disclosure is shown schematically.

[0028] Figure 8 An architectural diagram of a decision tree according to an embodiment of the present disclosure is illustrated schematically;

[0029] Figure 9 A flowchart illustrating a method for elastically stretching a container according to another embodiment of the present disclosure is shown schematically.

[0030] Figure 10A schematic diagram illustrating the structure of a container elastic telescoping device according to an embodiment of the present disclosure; and

[0031] Figure 11 A block diagram schematically illustrates an electronic device suitable for implementing a container elastic stretching method according to an embodiment of the present disclosure. Detailed Implementation

[0032] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0033] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0034] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0035] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).

[0036] In the technical solutions disclosed herein, user authorization or consent is obtained before acquiring or collecting user personal information. The collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information comply with relevant laws and regulations, necessary confidentiality measures are taken, and they do not violate public order and good morals.

[0037] Figure 1 A schematic diagram of a resilient telescopic system according to an embodiment of the present disclosure is shown. However, the present disclosure is not limited to such... Figure 1 The system structure is shown.

[0038] like Figure 1 As shown, the elastic scaling system 100 according to this embodiment includes a channel layer 110, a monitoring layer 120, a service layer 130, and a container management layer 140.

[0039] Channel layer 110 is used to provide online service channels for banking institutions, such as WeChat banking, mobile banking apps, and online banking, as well as offline service channels, such as self-service machines in physical branches. Users can log in to each channel, click on the relevant section to conduct business, and exit the channel after completing the transaction.

[0040] The monitoring layer 120 is used to monitor the channel layer 110 to obtain login user data, and periodically predict and calculate capacity requirements and perform elastic scaling in advance.

[0041] Service layer 130 is used to provide M types of system services, such as the wealth column module, the lifestyle discount module, and the personal information query module, each corresponding to one type of system service.

[0042] The container management layer 140 is used to increase or decrease capacity by providing computing resources based on the number of container instances, for example, by accepting calls from the monitoring layer to run scaling modules for elastic scaling. Here, a container refers to the encapsulation of different services within corresponding containers on a cloud computing platform using container technology, and then combining these containers with scripts to enable them to collaborate as required.

[0043] It is understood that the elastic scaling processing of the monitoring layer 120 is only one embodiment of this disclosure, and this disclosure is not limited to this. For example, a control layer can be set separately to receive the monitoring data transmitted from the monitoring layer 120 and perform operations such as prediction, evaluation and elastic scaling.

[0044] The following will be based on Figure 1 The system described, through Figures 2-9 The container elastic expansion and contraction method according to the embodiments of this disclosure will be described in detail.

[0045] Figure 2 A flowchart illustrating a container elastic stretching method according to an embodiment of the present disclosure is shown schematically.

[0046] like Figure 2 As shown, the container elastic expansion and contraction method of this embodiment includes operations S210 to S240.

[0047] When operating S210, monitor the login user data of N channels, where N is greater than or equal to 1.

[0048] Tracking points can be injected into channels such as WeChat Banking, mobile banking apps, online banking, and offline self-service machines to initiate the monitoring process. The monitoring process can collect data from currently logged-in customers periodically or in real-time. "Tracking points" is a term in the data collection field (such as user behavior data collection), referring to the related technologies and implementation processes for capturing, processing, and transmitting specific user behaviors or events. For example, using Java agent technology for front-end tracking monitors interactions between users and the front-end interface, such as login, clicks, browsing, and exposure.

[0049] When operating S220, based on the logged-in user data, predict the first user access volume of each of the M system services in the first time period in the future. Each system service has a separate container cluster, and M is greater than or equal to 2.

[0050] For example, logged-in user data includes information on one or more users who have logged in through various channels. For instance, it's possible to predict the number of users accessing various system services within the next 30 minutes (i.e., the first user access count). When the workload of each system service is large, and a single container cannot meet the demand, or when the service is critical and cannot be interrupted, multiple containers are used to deploy and provide the system service. This improves concurrent access capabilities and avoids single points of failure. These multiple containers provide services externally as a whole, which is a container cluster.

[0051] In some embodiments, access data from historical logged-in users can be used to fit a user behavior prediction model. For example, after fitting a curve or surface, the logged-in user data is input into the user behavior prediction model to obtain the prediction result.

[0052] In other embodiments, machine learning algorithms, such as deep learning networks, can be used to train a user behavior prediction model based on access data from historical login users to make predictions.

[0053] In other embodiments, a mapping relationship between the number of user groups and the access volume of various system services can be obtained based on the access data of historical logged-in users, resulting in a mapping relationship table as a user behavior prediction model. After analyzing the logged-in user data and dividing the user groups (such as by age, occupation, or wealth, etc.), the access volume of various system services is queried from the mapping relationship table.

[0054] When operating S230, for each system service, the computing resources of the current container cluster are evaluated based on the number of first user accesses, and the evaluation results are obtained.

[0055] For example, the evaluation process includes determining how much traffic the current resources (such as the number of containers) can support, comparing it with the current computing resources of each container cluster, and if the difference exceeds a preset threshold, notifying the elastic scaling center to perform scaling up or down processing of the computing resources in advance. For example, if the traffic is lower than a certain percentage of the first user access volume, scaling up is performed, or if the traffic is higher than a certain percentage of the first user access volume, scaling down is performed.

[0056] When operating S240, if the evaluation result of any of the M types of system services meets the conditions for expansion or reduction, the container cluster of that type of system service should be expanded or reduced in advance.

[0057] For example, "in advance" can refer to starting capacity expansion or contraction after obtaining the assessment results but before the peak arrives, so as to meet peak requirements in the first time period in the future or to avoid wasting resources.

[0058] For example, the monitoring layer 120 periodically collects logged-in customer information. Using the tag values ​​corresponding to the currently logged-in customers as input, it predicts and calculates the distribution of customers' access to various system services in the next 30 minutes. For instance, if it is estimated that 3,000 people will access the wealth management module, it calculates whether the current performance capacity of the wealth management module's backend service is sufficient. If it is insufficient, it initiates a scaling-up request to increase the number of containers for the service. If the current performance of the wealth management community's backend service exceeds the estimated number by more than double, it scales down.

[0059] According to embodiments of this disclosure, compared to timed or elastic scaling based on changes in computer resources, this method not only enables advance processing through prediction, but also avoids advance processing for the entire system. Instead, it can be divided into M types of system services, and the container clusters of one or more system services can be elastically scaled in advance in a refined manner. With limited computer resources, resources can be allocated more reasonably and dynamically, while still meeting business needs. This can effectively reduce resource consumption and achieve greater efficiency with less expenditure.

[0060] In some embodiments, after scaling up or down the container cluster for such system services in advance, the method further includes: periodically re-predicting the first user access volume for a fourth future time period. For example, if the first time period is 30 minutes, it is a short-term prediction of user behavior for elastic scaling. The elastically scaled computing resources may meet the requirements for the next 30 minutes, but after 30 minutes, they may no longer be suitable; therefore, re-prediction is necessary to dynamically adjust the elastic scaling strategy.

[0061] In other embodiments, after scaling up or down the container cluster for this system service in advance, the method further includes: re-predicting the first user access volume in a future fourth time period in response to the changing trend of the number of logged-in users in the logged-in user data. Compared to timed prediction, which may sometimes be unnecessary and waste resources consumed in the prediction process, such as predicting when the number of logged-in users suddenly decreases or increases (e.g., by 30%), this method can be more timely and save resources.

[0062] Figure 3 A flowchart illustrating service partitioning according to an embodiment of this disclosure is shown schematically.

[0063] Before predicting the first user visits, such as Figure 3 As shown, the service division in this embodiment includes operations S310 to S320.

[0064] In operation S310, K system services are divided according to business categories to obtain M types of system services. Each type of system service includes at least one system service, and K is greater than or equal to 1.

[0065] When operating S320, establish M container clusters that correspond one-to-one with M types of system services.

[0066] For example, K system services can be categorized by similar functions, and container clusters can be built. That is, system services are divided into M categories based on business types, and a separate container cluster is built for each category. The categorization is then used as the next step for predicting customer behavior. Figure 1 Taking the system shown as an example, the system services are divided into wealth section, personal information query section, shopping section, etc.

[0067] According to embodiments of this disclosure, customer behavior prediction is also based on business categories, predicting which category of columns (i.e. which system service) each customer is likely to visit, enabling refined elastic scaling strategies to better serve users.

[0068] Figure 4 A flowchart illustrating the prediction of first user visits according to an embodiment of this disclosure is shown schematically.

[0069] like Figure 4 As shown, the prediction of the first user's access volume in operation S220 includes operations S410 to S430.

[0070] In operation S410, based on the logged-in user data, S user characteristics of each logged-in user are obtained, where S is greater than or equal to 1.

[0071] For example, the S user characteristics may include one or more characteristics such as customer age, customer gender, occupation, asset class, risk level, and behavioral habits. The characteristic values ​​are defined as follows: Customer age:

[0072] meaning Feature value youth 1 middle aged 2 elderly 3

[0073] Customer Gender:

[0074] meaning Feature value male 1 female 2

[0075] Profession:

[0076]

[0077]

[0078] Asset Classes:

[0079] meaning Feature value Below 50,000 0 50,000 to 100,000 1 100,000 to 200,000 2 More than 200,000 3

[0080] Risk level:

[0081] meaning Feature value Low risk 0 Medium risk 1 High risk 2

[0082] Behavioral habits:

[0083] meaning Feature value Lifestyle Discounts 0 Wealth growth 1 Shopping 2

[0084] In operation S420, S user features of each logged-in user are input into the user behavior prediction model, which is pre-trained based on the user features and access behavior of historical logged-in users.

[0085] In operation S430, the first prediction result of the user behavior prediction model is obtained. The first prediction result includes the system services accessed by each logged-in user in the first time period.

[0086] For example, predicting the access volume before 10:30 AM at 10:00 AM: The first prediction result may include the access probability of each logged-in user on various system services. Based on the highest probability, determine one type of system service that each logged-in user will access before 10:30 AM (each user corresponds to only one type), and derive the first user access volume. In other embodiments, the first prediction result may include which types of system services (one or more) each logged-in user might access before 10:30 AM, and derive the first user access volume by considering how many users will access each system service before 10:30 AM.

[0087] Figure 5 A flowchart illustrating the re-prediction process according to an embodiment of this disclosure is shown schematically.

[0088] After obtaining the first prediction result from the user behavior prediction model, such as Figure 5 As shown, the re-prediction in this embodiment includes operations S510 to S530.

[0089] When operating S510, real-time access data for each logged-in user is obtained, including the system services currently accessed by each logged-in user.

[0090] When operating the S520, the real-time access data is compared with the first prediction result to obtain the comparison result.

[0091] For example, the first prediction result indicates that user A will visit the wealth column, but the real-time access data shows that user A did not visit the relevant page of the wealth column, and the comparison result is a prediction error.

[0092] When operating S530, if the comparison result of a predetermined number of logged-in users is a prediction error, the second user access volume of each system service in the third future time period is re-predicted, and the third time period is less than or equal to the first time period.

[0093] According to embodiments of this disclosure, comparing the first prediction result with real-time access data allows for timely acquisition of prediction accuracy and dynamic correction of erroneous prediction results. For example, if 2,000 out of 10,000 users are predicted incorrectly, and the predetermined number is 500, then the predictions for those 2,000 users or all users are re-predicted to obtain an accurate elastic scaling strategy and avoid ineffective scaling up and down operations.

[0094] The following is through Figure 6 This section describes the process of re-predicting for users who made incorrect predictions.

[0095] Figure 6 A flowchart illustrating the prediction of a second number of visits according to an embodiment of this disclosure is shown schematically.

[0096] like Figure 6 As shown, in operation S530, predicting the second number of visits includes performing operations S610 to S620 for each logged-in user whose prediction is incorrect.

[0097] When operating S610, input S user characteristics and real-time access data of each logged-in user into the user behavior prediction model.

[0098] For example, compared to inputting only the feature values ​​of each logged-in user into the model during the initial prediction, this step also inputs real-time access data, which can obtain certain prior knowledge and enhance prediction accuracy. For instance, if real-time access data shows that user A clicked on the financial information page or stayed on the financial analysis page for more than 3 minutes, this can form feature values ​​that can be input into the model to predict that user A is likely to enter the wealth section.

[0099] In some embodiments, the real-time access data also includes the page path currently accessed by each logged-in user, and the S user characteristics, currently accessed system services, and currently accessed page path of each logged-in user are input into the user behavior prediction model.

[0100] The system services currently accessed can be used to predict future access. For example, if user B uses a lifestyle discount to purchase some goods, they may then go to the wealth section to check their wealth balance.

[0101] The page path includes a record of multiple pages clicked by each logged-in user in chronological order. By analyzing a user's page path, their target service can be determined.

[0102] During operation of S620, a second prediction result is obtained from the user behavior prediction model. The second prediction result includes the system services accessed by each logged-in user within a third time period.

[0103] For example, the second prediction result may include the access probability of each logged-in user to various system services, determining one type of system service accessed by each logged-in user based on the highest probability (each user corresponds to only one type), and comprehensively deriving the second user access volume. In other embodiments, the second prediction result may include which types of system services (one or more) each logged-in user may access, and comprehensively deriving the second user access volume based on how many users access each system service would accept.

[0104] The third time period can be the same as or different from the first time period. For example, if the first time period is 30 minutes, then the initial prediction at 10:00 is for the visitor count before 10:30. However, at 10:05, if the prediction is found to be incorrect, a second prediction is made, with the goal still to predict the visitor count before 10:30. In this case, the third time period would be 25 minutes.

[0105] According to embodiments of this disclosure, by inputting real-time access data into a user behavior prediction model based on user characteristics, erroneous prediction results can be corrected in a timely manner, and the accuracy of the next prediction can be improved.

[0106] In some embodiments, based on the access of each logged-in user in the second prediction result as seeds, all logged-in users can first be clustered using one or more user features (such as the K-means clustering algorithm). Then, based on the system services accessed by each logged-in user in the second prediction result, it is assumed that other users in the same cluster who have not been re-predicted will access the same services, thus achieving full re-prediction (for example only).

[0107] In some embodiments of this disclosure, the user behavior prediction model is constructed based on a decision tree algorithm, which is described below. Figure 7 and Figure 8This section further explains the process of pre-training a user behavior prediction model.

[0108] Figure 7 A flowchart illustrating a pre-trained user behavior prediction model according to an embodiment of the present disclosure is shown. Figure 8 An architectural diagram of a decision tree according to an embodiment of the present disclosure is illustrated schematically.

[0109] like Figure 7 As shown, the pre-trained user behavior prediction model in this embodiment includes operations S710 to S720.

[0110] When operating S710, a first-stage decision tree model is constructed based on S user characteristics of each historical login user in the second time period.

[0111] For example, the second time period in the past may include a specific month in the past (for illustrative purposes only). The first-stage decision tree model can be generated using the CART algorithm. The CART algorithm is a method for learning the conditional probability distribution of the output random variable Y given an input random variable X. CART assumes that the decision tree is a binary tree, with internal nodes taking values ​​of "yes" or "no". Such a decision tree is equivalent to recursively bisecting each feature, dividing the feature space into a finite number of units, and determining the predicted probability distribution on these units, i.e., the conditional probability distribution of the output given the input.

[0112] For example, the training data template generated using feature value definitions and one month's worth of historical data as the training set is as follows:

[0113]

[0114] Based on the feature value data (i.e., the training set), starting from the root node, the CART algorithm is used to recursively perform the following operations on each node to construct a binary decision tree.

[0115] Step 1: Assuming the training set is D, calculate the Gini impurity of the existing feature values ​​for this dataset (Equation 1). Assume there are M classes in D, P m Let A be the probability that each sample point in the training set belongs to class m. For each feature value A, D is divided into two sets, D1 and D2, based on the sample points. Then, the Gini impurity of the feature sample point is calculated based on the number of samples in each set (Equation 2).

[0116]

[0117]

[0118] Step 2: Select the node with the smallest Gini impurity calculated from all feature value sample points as the parent node, and use the two resulting datasets as child nodes. Step 3: Call Step 1 and Step 2 on each child node until all feature value sample points have been traversed. Step 4: Generate the first-stage decision tree T.

[0119] By operating the S720, the first-stage decision tree model is pruned to obtain the user behavior prediction model.

[0120] The more complex the decision tree model, the higher the accuracy on the training set. However, the accuracy on the test set will decrease as the tree complexity increases after reaching a certain level, leading to overfitting. Pruning is precisely to prevent overfitting and reduce the complexity of the tree. An example process is as follows:

[0121] Let k = 0, T = T0, α = +∞. For the first-stage decision tree T, calculate C(T) for each internal node t from bottom to top. t ), |T t | is a subtree T t The number of leaf nodes, g(t) is the loss function that determines whether or not to prune.

[0122]

[0123] α = min(α, g(t)) Equation 4

[0124] Where C(t) is the prediction error of tree t, calculated as C(t) = (F1 / S1)*(S1 / S). S: total number of samples, S1: number of samples at node t, F1: misclassified samples at node t.

[0125] C(T t ) represents the sum of prediction errors for all leaf nodes of the current tree, as shown in Equation 5.

[0126]

[0127] Prune the internal node t corresponding to g(t) = α, and determine the category of the leaf nodes using a majority vote to obtain tree T. The majority vote method assigns the category with the most votes to the final category, merging categories with fewer votes. Let k = k + 1, α m =α,T m =T, if T m If the tree is not composed of a root node and two leaf nodes, then return to the state where α = +∞ and continue execution; otherwise, let T... m =T n .

[0128] T is generated from the above steps. 0 ,....T nWe select 100 trees and validate them using a dataset from one month. The tree with the highest success rate is chosen as the final decision tree. The success rate is the ratio of successfully classified data to the total number of data in the dataset.

[0129] For example, such as Figure 8 As shown, the system first determines the applicant's occupation. If the applicant is a civil servant, the system then determines their age, followed by their asset level. If a middle-aged civil servant's assets are between 100,000 and 200,000 yuan, the system further determines their gender. If the applicant is female, she may be able to access the wealth section. If an older civil servant's assets are generally above 200,000 yuan, they may be able to access and view their personal information.

[0130] Figure 9 A flowchart illustrating a container elastic stretching method according to another embodiment of the present disclosure is shown schematically.

[0131] Reference Figure 1 and Figure 9 This embodiment of timed elastic scaling management may include operations S910 to S980.

[0132] When operating S910, monitoring layer 120 summarizes the characteristic information of currently logged-in customers.

[0133] When operating S920, the monitoring layer 120 predicts and calculates the number of users expected to be distributed across various columns within half an hour for the current customer. For example, the wealth column module, the lifestyle discount module, and the personal information query module each correspond to a system service.

[0134] When operating the S930, the container management layer 140 obtains the number of containers in each column, that is, the number of containers in the container cluster for each system service.

[0135] During operation of S940, the monitoring layer 120 receives the number of containers in each column returned by the container management layer 140 and calculates the TPS required for that column.

[0136] For example, the user behavior prediction model predicts the expected number of people visiting each column within the current half hour (i.e., user visits). Assuming that the wealth column is expected to have 10 million visitors within 30 minutes, the TPS is expected to be S = 10,000,000 / 30 / 60, which is 5,500. The peak TPS is then multiplied by 2.5, so TPS1 is approximately 13,750 TPS.

[0137] Assuming a single wealth column container can support a TPS of 1000 (obtained through stress testing tools), then approximately 13750 / 1000 = 14 containers are needed. If the current number of wealth column containers is 8 and TPS2 is 8000, then 6 more containers are needed.

[0138] In operation S950, for each column, it is determined whether TPS1 > TPS2 * 120%. TPS1 is the TPS required in the future calculated based on the prediction result, and TPS2 is the TPS that each column can provide. 120% is only an example. If so, and the evaluation result meets the capacity expansion condition, then operation S960 is executed. If not, then operation S970 is executed.

[0139] In operation S960, the container management layer 140 performs a capacity expansion operation on the columns where TPS1 > TPS2 * 120%.

[0140] In operation S970, for each column, it is determined whether TPS1 < TPS2 * 50%. If so, and the evaluation result meets the capacity reduction condition, then operation S9850 is executed. If not, then this elastic scaling process ends.

[0141] In operation S980, the container management layer 140 performs a capacity reduction operation on the columns where TPS1 < TPS2 * 50%.

[0142] Based on the above container elastic scaling method, the present disclosure also provides a container elastic scaling device. The following will be combined with Figure 10 to describe this device in detail.

[0143] Figure 10 Schematically shows a structural block diagram of a container elastic scaling device according to an embodiment of the present disclosure.

[0144] As Figure 10 shown, the container elastic scaling device 1000 of this embodiment includes a data monitoring module 1010, an access prediction module 1020, a resource evaluation module 1030, and a scaling module 1040.

[0145] The data monitoring module 1010 can execute operation S210 to monitor the logged-in user data of N channel ends, where N is greater than or equal to 1.

[0146] The access prediction module 1020 can execute operation S220 to predict the first user access volume of each of the M system services within the first time period in the future based on the logged-in user data. Among them, a separate container cluster is established for each system service, and M is greater than or equal to 2.

[0147] In some embodiments, the access prediction module 1020 can execute operations S410 to S430, operations S510 to S530, and operations S610 to S620, which will not be elaborated here.

[0148] The resource evaluation module 1030 can execute operation S230 to perform a computing resource evaluation on the current container cluster for each system service according to the first user access volume, and obtain an evaluation result.

[0149] The scaling up / down module 1040 can execute operation S240, which is used to scale up or down the container cluster of any of the M system services in advance when the evaluation result of any system service meets the scaling up or down conditions.

[0150] In some embodiments, the container elastic expansion device 1000 may further include a service partitioning module for performing operations S310 to S320, which will not be described in detail here.

[0151] In some embodiments, the container elastic expansion device 1000 may further include a model training module for performing operations S710 to S720, which will not be described in detail here.

[0152] It should be noted that the container elastic expansion device 1000 includes components respectively used to perform the above... Figures 2-9 The modules of each step in any of the described embodiments. The implementation methods, technical problems solved, functions achieved, and technical effects of each module / unit / subunit in the apparatus embodiments are the same as or similar to the implementation methods, technical problems solved, functions achieved, and technical effects of the corresponding steps in the method embodiments, and will not be repeated here.

[0153] According to embodiments of this disclosure, any multiple modules among the data monitoring module 1010, access prediction module 1020, resource assessment module 1030, and scaling module 1040 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module.

[0154] According to embodiments of this disclosure, at least one of the data monitoring module 1010, access prediction module 1020, resource assessment module 1030, and scaling module 1040 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable method of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three methods. Alternatively, at least one of the data monitoring module 1010, access prediction module 1020, resource assessment module 1030, and scaling module 1040 can be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.

[0155] Figure 11A block diagram schematically illustrates an electronic device suitable for implementing a container elastic stretching method according to an embodiment of the present disclosure.

[0156] like Figure 11 As shown, an electronic device 1100 according to an embodiment of the present disclosure includes a processor 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage portion 1108 into a random access memory (RAM) 1103. The processor 1101 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1101 may also include onboard memory for caching purposes. The processor 1101 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0157] RAM 1103 stores various programs and data required for the operation of electronic device 1100. Processor 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Processor 1101 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1102 and / or RAM 1103. It should be noted that programs may also be stored in one or more memories other than ROM 1102 and RAM 1103. Processor 1101 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.

[0158] According to embodiments of this disclosure, the electronic device 1100 may further include an input / output (I / O) interface 1105, which is also connected to a bus 1104. The electronic device 1100 may also include one or more of the following components connected to the I / O interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1110 as needed so that computer programs read from it can be installed into the storage section 1108 as needed.

[0159] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0160] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1102 and / or RAM 1103 and / or one or more memories other than ROM 1102 and RAM 1103 described above.

[0161] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this disclosure.

[0162] When the computer program is executed by the processor 1101, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0163] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1109, and / or installed from the removable medium 1111. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0164] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by processor 1101, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0165] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0166] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0167] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0168] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A method for elastically stretching a container, comprising: Monitor login user data from N channels, where N is greater than or equal to 1; Based on the login user data, predict the first user access volume of each of the M system services in the first time period in the future, wherein each system service has a separate container cluster, and M is greater than or equal to 2. For each system service, the computing resources of the current container cluster are evaluated based on the first user access volume to obtain the evaluation result; When the evaluation result of any of the M types of system services meets the conditions for expansion or reduction, the container cluster of that system service shall be expanded or reduced in advance. The predicted user access volume for each of the M system services within the first time period includes: Based on the login user data, obtain S user characteristics for each login user, where S is greater than or equal to 1; The S user features of each logged-in user are input into the user behavior prediction model, wherein the user behavior prediction model is pre-trained based on the user features and access behavior of historical logged-in users. Obtain a first prediction result output by the user behavior prediction model, the first prediction result including the system services accessed by each logged-in user within the first time period; After obtaining the first prediction result output by the user behavior prediction model, the method further includes: Obtain real-time access data for each logged-in user, including the system services currently accessed by each logged-in user. The real-time access data is compared with the first prediction result to obtain a comparison result; If the comparison result of a predetermined number of logged-in users is a prediction error, the second user access volume of each system service in a future third time period is re-predicted, where the third time period is less than or equal to the first time period.

2. The method according to claim 1, wherein, The user behavior prediction model is constructed based on a decision tree algorithm, and the pre-training of the user behavior prediction model includes: A first-stage decision tree model is constructed based on the S user characteristics of each historical login user in the second past time period. The user behavior prediction model is obtained by pruning the decision tree model in the first stage.

3. The method according to claim 1, wherein, Before predicting the first user's visit volume, the method further includes: The K system services are divided into M types according to business categories, and each type of system service includes at least one system service, where K is greater than or equal to 1. Establish M container clusters that correspond one-to-one with the M types of system services.

4. The method according to claim 1, wherein, The re-prediction of the second user access volume for each system service in the third future time period includes: for each login user whose prediction was incorrect. Input the S user characteristics and real-time access data of each logged-in user into the user behavior prediction model; Obtain a second prediction result output by the user behavior prediction model, the second prediction result including the system services accessed by each logged-in user during the third time period.

5. The method according to claim 1, wherein, The real-time access data also includes the page path currently accessed by each logged-in user. Inputting the S user characteristics and real-time access data of each logged-in user into the user behavior prediction model includes: The S user characteristics of each logged-in user, the currently accessed system service, and the currently accessed page path are input into the user behavior prediction model.

6. The method according to claim 1, wherein, After scaling up or down the container cluster for this type of system service in advance, the method further includes: Periodically re-predict the first user's access volume in the fourth future time period; and / or In response to the changing trend of the number of logged-in users in the logged-in user data, the access volume of the first user in the fourth future time period is re-predicted.

7. A container elastic expansion and contraction device, comprising: The data monitoring module is used to monitor the login user data of N channels, where N is greater than or equal to 1; An access prediction module is used to predict the first user access volume of each of M system services within a future first time period based on the logged-in user data, wherein each system service corresponds to a separate container cluster, and M is greater than or equal to 2; the prediction of the first user access volume of each of the M system services within the future first time period includes: obtaining S user features for each logged-in user based on the logged-in user data, where S is greater than or equal to 1; inputting the S user features of each logged-in user into a user behavior prediction model, wherein the user behavior prediction model is pre-trained based on the user features and access behaviors of historical logged-in users; obtaining a first prediction result output by the user behavior prediction model, the first prediction result including the system services accessed by each logged-in user within the first time period; after obtaining the first prediction result output by the user behavior prediction model, obtaining real-time access data for each logged-in user, the real-time access data including the system services currently accessed by each logged-in user; comparing the real-time access data with the first prediction result to obtain a comparison result; when the comparison result for a predetermined number of logged-in users is a prediction error, re-predicting the second user access volume of each system service within a future third time period, wherein the third time period is less than or equal to the first time period; The resource assessment module is used to assess the computing resources of the current container cluster for each system service based on the first user access volume, and obtain the assessment result. The scaling up / down module is used to scale up or down the container cluster of any of the M system services in advance when the evaluation result of any system service meets the scaling up or scaling down conditions.

8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 6.