CN115981796A - Method, apparatus, device and medium for elastically stretching and contracting container - Google Patents
Method, apparatus, device and medium for elastically stretching and contracting container Download PDFInfo
- Publication number
- CN115981796A CN115981796A CN202310135439.4A CN202310135439A CN115981796A CN 115981796 A CN115981796 A CN 115981796A CN 202310135439 A CN202310135439 A CN 202310135439A CN 115981796 A CN115981796 A CN 115981796A
- Authority
- CN
- China
- Prior art keywords
- user
- system service
- login
- access
- time period
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
A container elastic expansion method is provided, and relates to the field of cloud computing. The method comprises the following steps: monitoring login user data of N channel ends, wherein N is greater than or equal to 1; predicting a first user access amount of each system service in M system services in a first time period in the future according to the login user data, wherein each system service is correspondingly established with an independent container cluster, and M is greater than or equal to 2; for each system service, evaluating the computing resources of the 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 the expansion or reduction condition, performing expansion or reduction processing on the container cluster of the system service in advance. A container elastic stretching device, an apparatus, a storage medium and a program product are also provided.
Description
Technical Field
The present disclosure relates to the field of cloud computing, and more particularly, to a container elastic stretching method, apparatus, device, medium, and program product.
Background
Elastic scaling is a service that automatically adjusts the computing power (such as the number of container instances) according to business requirements and policies, that is, the number of service container instances is automatically increased and decreased according to the service conditions of the server.
Current elastic scaling methods are typically set based on timing rules or based on computer resource changes. The timing rule is configured at a fixed time point, and elastic expansion and contraction actions are executed once or repeatedly. According to the change situation of computer resources, namely the change of resources such as CPU, memory and the like of the monitoring system, when the change reaches a certain threshold value, the elastic expansion action is triggered to be executed.
In carrying out the inventive concepts of the present disclosure, the inventors discovered: when the access amount suddenly increases, the computing resources are suddenly increased, and the elastic expansion and contraction at the moment cannot timely cope with the situation. If the concurrency quantity suddenly increases, a CPU (central processing unit), a memory and the like of the system may rise instantly, and the expansion is triggered at the moment, so that the starting of the container needs a certain time, and the elastic expansion does not actually achieve the purpose of fire fighting. In addition, resource waste can be caused by untimely elastic shrinkage.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a container elastic expansion method, apparatus, device, medium, and program product.
An aspect of an embodiment of the present disclosure provides a method of elastically stretching a container, including: monitoring login user data of N channel ends, wherein N is greater than or equal to 1; predicting a first user access amount of each system service in M system services in a first time period in the future according to the login user data, wherein each system service is correspondingly established with an independent container cluster, and M is greater than or equal to 2; for each system service, evaluating the computing resources of the 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 the expansion or reduction condition, performing expansion or reduction processing on the container cluster of the system service in advance.
In some embodiments, the predicting the first amount of user access for each of the M system services over the future first time period comprises: obtaining S user characteristics of each login user according to the login user data, wherein S is greater than or equal to 1; inputting S user characteristics of each login user into a user behavior prediction model, wherein the user behavior prediction model is obtained by pre-training according to the user characteristics and the access behaviors of the historical login users; and obtaining a first prediction result output by the user behavior prediction model, wherein the first prediction result comprises the system service accessed by each login user in the first time period.
In some embodiments, the user behavior prediction model is constructed according to a decision tree algorithm, and pre-training the user behavior prediction model includes: constructing a first-stage decision tree model according to S user characteristics of each historical login user in a second past time period; and pruning the decision tree model of the first stage to obtain the user behavior prediction model.
In some embodiments, prior to predicting the first amount of user access, the method further comprises: dividing K system services according to service classes to obtain the M system services, wherein each system service comprises at least one system service, and K is greater than or equal to 1; and establishing M container clusters which correspond to the M system services one by one.
In some embodiments, after obtaining the first prediction result output by the user behavior prediction model, the method further comprises: acquiring real-time access data of each login user, wherein the real-time access data comprises system services currently accessed by each login user; comparing the real-time access data with the first prediction result to obtain a comparison result; when the comparison result of the preset number of login users is prediction error, predicting the second user access amount of each system service in a future third time period, wherein the third time period is less than or equal to the first time period.
In some embodiments, said re-predicting a second amount of user access for said each system service for a third future time period comprises: for each login user with wrong prediction, inputting S user characteristics and real-time access data of each login user into the user behavior prediction model; and obtaining a second prediction result output by the user behavior prediction model, wherein the second prediction result comprises the system service accessed by each login user in the third time period.
In some embodiments, the real-time access data further includes a page path currently visited by the each logged-in user, and the inputting S user characteristics of the each logged-in user and the real-time access data into the user behavior prediction model includes: and inputting the S user characteristics of each login user, the currently accessed system service and the currently accessed page path into the user behavior prediction model.
In some embodiments, after the capacity expansion or capacity reduction process is performed on the container cluster served by the system in advance, the method further includes: periodically re-predicting the first user visit amount within a fourth time period in the future; and/or in response to a trend of change of the number of logged users in the logged user data, re-predicting the first user access amount in a fourth time period in the future.
Another aspect of the disclosed embodiments provides a container elastic expansion device, including: the data monitoring module is used for monitoring login user data of N channel ends, wherein N is greater than or equal to 1; the access prediction module is used for predicting the first user access amount of each system service in M system services in a first time period in the future according to the login user data, wherein each system service is correspondingly established with an independent container cluster, and M is greater than or equal to 2; the resource evaluation module is used for carrying out calculation resource evaluation on the current container cluster according to the first user access amount for each system service to obtain an evaluation result; and the capacity expansion and reduction module is used for carrying out capacity expansion or capacity reduction processing on the container cluster of the system service in advance when the evaluation result of any system service in the M system services meets the capacity expansion or reduction conditions.
The container elastic telescopic device comprises modules for performing the steps of the method according to any one of the above.
Another aspect of an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method as described above.
Another aspect of the embodiments of the present disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which when executed by a processor, cause the processor to perform the method as described above.
Yet another aspect of the disclosed embodiments provides a computer program product comprising a computer program that when executed by a processor implements the method as described above.
One or more of the above embodiments have the following advantageous effects: the method comprises the steps of determining the first user access amount of each system service in a first time period in the future by predicting the behavior of a login user, evaluating the data of computing resources needing to be consumed, and carrying out capacity expansion or capacity reduction treatment on container clusters of one or more system services in advance. Compared with the mode of elastic expansion and contraction at regular time or according to the change condition of computer resources, the method can not only realize advanced treatment through prediction, but also not aim at the whole system, can be divided into M system services, can finely elastically expand and contract container clusters of one or more system services in advance, can more reasonably and dynamically arrange and distribute resources under the limited computer resources, can meet the requirements of business, can effectively reduce resource consumption, and can realize greater efficiency with less expenditure.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates a block diagram of a system of elastic retractors in accordance with an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a method of elastically telescoping a container according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow diagram of service partitioning according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart for predicting a first user visit volume according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a flow diagram of re-prediction according to an embodiment of the present disclosure;
FIG. 6 schematically shows a flow chart of predicting a second visit amount according to an embodiment of the present disclosure;
FIG. 7 schematically illustrates a flow diagram for pre-training a user behavior prediction model, according to an embodiment of the disclosure;
FIG. 8 schematically illustrates an architecture diagram of a decision tree in accordance with an embodiment of the present disclosure;
FIG. 9 schematically illustrates a flow chart of a method of elastically telescoping a container according to another embodiment of the present disclosure;
FIG. 10 schematically illustrates a block diagram of a container elastic expansion device according to an embodiment of the present disclosure; and
fig. 11 schematically illustrates a block diagram of an electronic device adapted to implement a method of elastic stretching of a container according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B, and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B, and C" would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and/or A, B, and C together, etc.).
In the technical scheme of the disclosure, before the personal information of the user is acquired or collected, the authorization or the consent of the user is acquired. The collection, storage, use, processing, transmission, provision, disclosure, application and other processing of the personal information of the related users are all in accordance with the regulations of related laws and regulations, and necessary security measures are taken without violating the good customs of the public order.
Fig. 1 schematically shows a block diagram of an elastic telescopic system according to an embodiment of the present disclosure. However, the present disclosure is not limited to the system configuration shown in fig. 1.
As shown in fig. 1, the elastic telescopic 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.
The channel layer 110 is used for providing an online service channel end of a wechat bank, a mobile phone bank App, an online bank and the like of a banking institution, and an offline service channel end, such as a self-service machine of an offline branch. The user can log in each channel end point and click a special column to transact business, and quit the channel end after transacting.
The monitoring layer 120 is used for monitoring the channel layer 110 to obtain the login user data, and predicting and calculating the capacity requirement at regular time and performing the elastic expansion process in advance.
The service layer 130 is used for providing M system services, such as a wealth column module, a life preference module and a personal information query module, which correspond to one system service respectively.
The container management layer 140 is used to provide computing resources by the number of container instances to increase or decrease the capacity, for example, to accept calls from the monitoring layer to run a scale-up module to scale up or scale down elastically. The container means that different services are packaged in corresponding containers through a container technology in the cloud computing platform, and then the containers are combined with some scripts to enable the containers to cooperate with each other as required.
It is understood that the elastic expansion and contraction processing performed by the monitoring layer 120 is only one embodiment of the disclosure, and the disclosure is not limited thereto, and for example, the control layer may be separately configured to receive the monitoring data transmitted by the monitoring layer 120 and perform operations such as prediction, evaluation, elastic expansion and contraction.
The method for elastically telescoping the container according to the embodiment of the present disclosure will be described in detail with reference to fig. 2 to 9 based on the system described in fig. 1.
Fig. 2 schematically illustrates a flow chart of a method of elastically telescoping a container according to an embodiment of the present disclosure.
As shown in fig. 2, the method of elastically stretching and contracting the container of this embodiment includes operations S210 to S240.
In operation S210, log-in user data of N channel ends is monitored, where N is greater than or equal to 1.
The embedded point can be injected into channel ends of a WeChat bank, a mobile phone bank App, an online bank, an offline self-service machine and the like, and a monitoring process is started. The monitoring process may collect current log-in client data periodically or in real time. "buried point" is a term used in the field of data collection (e.g., user behavior data collection) and refers to the relevant technologies and processes for capturing, processing, and sending events for a particular user behavior. Front-end point burying is performed, for example, using Java agent technology, and monitoring of interactions occurring between a user and a front-end interface, such as actions like login, click, browse, exposure, and the like, is performed.
In operation S220, a first user access amount of each system service in M system services in a future first time period is predicted according to login user data, wherein a separate container cluster is correspondingly established for each system service, and M is greater than or equal to 2.
Illustratively, the login user data includes one or more user information logged in at the respective channel end. For example, the number of user visits (i.e., the first user visit) for various system services in the next 30 minutes may be predicted. When the traffic of each system service is large, only a single container cannot meet the requirement, or the service is important and cannot be interrupted, a plurality of containers are used for deployment to provide the system service, so that the aims of improving the concurrent access capability and avoiding single-point faults are fulfilled. The plurality of container pairs serve as a whole, namely a container cluster.
In some embodiments, the access data of the historical logged-in user may be used for fitting to obtain a user behavior prediction model. For example, after curve or curved surface fitting, the login user data is input into the user behavior prediction model, and a prediction result is obtained.
In other embodiments, a machine learning algorithm, such as a deep learning network, may be used to receive access data of a historical logged-on user for training, and obtain a user behavior prediction model to implement the prediction.
In other embodiments, the mapping relationship between the user group number and various system service access amounts can be obtained according to the access data of the historical login users, and the mapping relationship table is obtained to serve as the user behavior prediction model. And analyzing the data of the logged-in users, dividing user groups (for example, dividing according to one or more of age, occupation or wealth) and inquiring various system service access volumes in the mapping relation table.
In operation S230, for each system service, computing resource evaluation is performed on the current container cluster according to the first user access amount, and an evaluation result is obtained.
Illustratively, the evaluation process includes judging how much access amount can be supported according to the current resources (such as the number of containers), comparing with the current computing resources of each container cluster, and if the difference exceeds a preset threshold, informing the elastic scaling center to perform capacity expansion and reduction processing on the computing resources in advance. For example, if the access amount is lower than the first user by a certain proportion, the capacity is expanded, or if the access amount is higher than the first user by a certain proportion, the capacity is reduced.
In operation S240, when the evaluation result of any one of the M system services meets the expansion or contraction condition, the capacity expansion or contraction process is performed on the container cluster of the system service in advance.
For example, advancing may refer to starting the expansion or contraction processing just before a peak value after obtaining the evaluation result, so that the peak requirement may be met in a first period of time in the future, or to avoid wasting resources.
For example, the monitoring layer 120 collects log-in client information at regular time, and predicts and calculates the distribution of the client accessing various system services in the next 30 minutes by taking the corresponding tag value of the current log-in client as input, for example, 3000 people are expected to be available in accessing the wealth column module, and calculates whether the performance tolerance of the current wealth column background service is enough, if not, a capacity expansion request is initiated, and the number of containers of the service is increased. And if the performance of the background service of the current wealth community exceeds more than one time of the pre-counting, capacity reduction is carried out.
According to the embodiment of the disclosure, compared with a mode of elastic expansion and contraction at regular time or according to the change condition of computer resources, the method can not only realize advanced processing through prediction, but also not carry out advanced processing on the whole system, can be divided into M system services, finely flexibly expand and contract container clusters of one or more system services in advance, more reasonably and dynamically arrange and distribute resources under limited computer resources, and simultaneously can meet the requirements of business, effectively reduce resource consumption and realize greater efficiency with less expenditure.
In some embodiments, after performing capacity expansion or capacity reduction processing on the container cluster serviced by the system in advance, the method further includes: and periodically re-predicting the first user access amount in a fourth time period in the future. Taking a timing prediction as an example, the first time period is 30 minutes, which is a short-time prediction of user behavior for elastic expansion and contraction processing. The computing resources after elastic expansion can meet the requirements of 30 minutes in the future, but after 30 minutes, the computing resources are not applicable any more, so the computing resources are predicted again so as to dynamically adjust the elastic expansion strategy.
In other embodiments, after performing capacity expansion or capacity reduction processing on the container cluster serviced by the system in advance, the method further includes: and in response to the change trend of the number of the login users in the login user data, the first user access amount in the future fourth time period is forecasted again. Compared with timing prediction, elastic expansion and contraction may not be needed sometimes, and resources consumed in the prediction process are wasted, for example, prediction is performed when the number of login users suddenly decreases or suddenly increases (for example, 30%), certain timeliness can be achieved, and resources can be saved.
Fig. 3 schematically shows a flow chart of service partitioning according to an embodiment of the present disclosure.
Before predicting the first user access amount, as shown in fig. 3, the service division of this embodiment includes operations S310 to S320.
In operation S310, K system services are divided according to service categories, and M system services are obtained, where each system service includes at least one system service, and K is greater than or equal to 1.
In operation S320, M container clusters corresponding to M system services one to one are established.
For example, sorting the K system services by similar functions, a container cluster is established. Namely, the system services are divided into M categories according to the service categories, and each category establishes a separate container cluster. And taking the classified category as the classification category of the next customer prediction behavior. Taking the system shown in fig. 1 as an example, the system services are divided into a wealth column, a personal information inquiry column, a shopping column, and the like.
According to the embodiment of the disclosure, the client behavior is predicted based on the service type, and the column of which type each client can access (i.e. which system service) with a high probability is predicted, so that a fine flexible strategy can be realized, and the service can be provided for the user better.
Fig. 4 schematically shows a flow chart of predicting a first user visit volume according to an embodiment of the disclosure.
As shown in fig. 4, predicting the first user access amount in operation S220 includes operations S410 to S430.
In operation S410, S user characteristics of each login user are obtained according to the login user data, where S is greater than or equal to 1.
Illustratively, the S user characteristics may include one or more characteristics of a customer' S age, customer gender, occupation, asset class, risk level, and behavioral habits. The characteristic values are defined as follows. Age of the customer:
means of | Value of characteristic item |
Young people | 1 |
Middle-aged | 2 |
The elderly | 3 |
Customer gender:
means of | Value of characteristic item |
For male | 1 |
Woman | 2 |
Occupation:
asset classes:
means of | Value of characteristic item |
Less than 5 ten thousand | 0 |
5 to 10 ten thousand | 1 |
10 to 20 ten thousand | 2 |
Over 20 million | 3 |
Risk level:
means of | Value of characteristic item |
Low risk | 0 |
Middle risk | 1 |
High risk | 2 |
Behavior habit:
means of | Value of characteristic item |
Life preference | 0 |
Wealth growth | 1 |
Shopping | 2 |
In operation S420, S user characteristics of each login user are input into a user behavior prediction model, where the user behavior prediction model is obtained by pre-training according to the user characteristics and the access behavior of the historical login users.
In operation S430, a first prediction result output by the user behavior prediction model is obtained, where the first prediction result includes system services accessed by each logged-in user in a first time period.
Illustratively, the visit amount before 10 o 'clock is predicted in 10 am, the first prediction result may include the visit probability of each login user in various system services, one system service (only one for each user) visited by each login user before 10 o' clock is determined according to the maximum probability, and the first user visit amount is obtained by integration. In other embodiments, the first prediction result may include what kind of system service(s) each logged-in user may access before 10 times half, and the first user access amount is obtained by integrating how many users each system service will access before 10 times half.
FIG. 5 schematically shows a flow diagram of a re-prediction according to an embodiment of the present disclosure.
After obtaining the first prediction result output by the user behavior prediction model, as shown in fig. 5, the embodiment predicts again including operations S510 to S530.
In operation S510, real-time access data of each login user is acquired, the real-time access data includes the system services currently accessed by each logged-in user.
In operation S520, the real-time access data is compared with the first prediction result to obtain a comparison result.
Illustratively, for example, the first prediction result indicates that the A user accesses the wealth column, but the real-time access data shows that the A user does not access the relevant page of the wealth column, and the comparison result is a prediction error.
In operation S530, when the comparison result of the predetermined number of login users is a prediction error, the second user access amount of each system service in a third time period in the future is predicted again, and the third time period is less than or equal to the first time period.
According to the embodiment of the disclosure, the first prediction result is compared with the real-time access data, so that the prediction accuracy can be obtained in time, and the wrong prediction result can be dynamically corrected. For example, 2000 users out of 10000 users have wrong prediction, and the predetermined number is 500, the 2000 users or all users are predicted again to obtain an accurate elastic scaling strategy, so as to avoid invalid capacity expansion and contraction processing.
The following describes the process of user re-prediction of prediction error by using fig. 6.
Fig. 6 schematically shows a flow chart of predicting a second access amount according to an embodiment of the present disclosure.
As shown in fig. 6, predicting the second access amount in operation S530 includes performing operations S610 to S620 for each login user for which prediction is incorrect.
In operation S610, S user characteristics and real-time access data of each login user are input into a user behavior prediction model.
Exemplarily, compared with the step of only inputting the characteristic value of each login user into the model during initial prediction, the step of inputting real-time access data in the same way can obtain certain prior knowledge and enhance the prediction accuracy. For example, if the user clicks the financing information page, or stays on the finance analysis page for more than 3 minutes, for example, the real-time access data display a can form a characteristic value to be input into the model, and it is predicted that a large probability will enter the wealth column.
In some embodiments, the real-time access data further includes a currently accessed page path for each logged-in user, and the S user characteristics, the currently accessed system services, and the currently accessed page path for each logged-in user are input into the user behavior prediction model.
Future visits may be predicted by the currently visited system services, for example, B-user purchases some goods using life benefits, which may further enter the wealth column to view his wealth balance.
The page path includes a plurality of page records having a chronological order that each logged-in user has clicked. The target service can be obtained by analyzing the page path of the user.
In operation S620, a second prediction result output by the user behavior prediction model is obtained, where the second prediction result includes system services accessed by each logged-in user in a third time period.
Illustratively, the second prediction result may include the access probability of each logged-in user to various system services, and determine one system service (only one for each user) accessed by each logged-in user according to the maximum probability, and synthesize the second user access amount. In other embodiments, the second prediction result may include what system service(s) each logged-in user is likely to access, and the second user access amount is integrated with how many users each system service will receive access.
The third time period may be the same as or different from the first time period. By way of example, if the first time period is 30 minutes, then the visit volume 10 o 'clock before half a clock is initially predicted at 10 o' clock. And when the time is 10 o' clock 05, the prediction is found to be wrong, the second prediction is carried out, the target still predicts the visit amount half and a half of the time before the time is 10, and the third time period is 25 minutes.
According to the embodiment of the disclosure, the real-time access data is input into the user behavior prediction model on the basis of the user characteristics, so that the wrong prediction result can be corrected in time, and the accuracy of the next prediction is improved.
In some embodiments, based on the access of each logged-in user in the second prediction result as a seed, all logged-in users may be clustered by using one or more user characteristics (e.g., a K-means clustering algorithm), and then based on the system service accessed by each logged-in user in the second prediction result, it is considered that other users not predicted again in the same cluster will access the same service, so as to implement all prediction again (for example only).
In some embodiments of the present disclosure, the user behavior prediction model is obtained by constructing a decision tree algorithm, and the process of pre-training the user behavior prediction model is further described with reference to fig. 7 and 8.
FIG. 7 schematically shows a flow diagram for pre-training a user behavior prediction model according to an embodiment of the present disclosure. FIG. 8 schematically illustrates an architecture diagram of a decision tree in accordance with an embodiment of the present disclosure.
As shown in fig. 7, the pre-trained user behavior prediction model of this embodiment includes operations S710 to S720.
In operation S710, a first-stage decision tree model is constructed based on S user characteristics of each of the historical login users in a second period of time in the past.
Illustratively, the past second time period includes, for example, within a past month (by way of example only). The first stage decision tree model may be generated using the CART algorithm. The CART algorithm is a learning method of conditional probability distribution of an output random variable Y given an input random variable X. CART assumes that the decision tree is a binary tree, and the value of the internal node is '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 over these units, i.e., the conditional probability distribution that is output under the given conditions of the input.
For example, a training data template generated by using the eigenvalue definition and the historical data of the previous month as a training set is as follows:
from the eigenvalue data (i.e., the training set), a binary decision tree is constructed starting from the root node by recursively operating each node as follows using the CART algorithm.
Step 1, assuming that a training set is D, calculating the degree of uncertainty of the existing characteristic value to the data set (formula 1), assuming that M categories exist in D, and P m The probability that each sample point in the training set belongs to the m classes. For each characteristic value A, dividing D into two sets of D1 and D2 according to the sample points, and then calculating the purity of the Gini of the characteristic sample points according to the number of samples in each set (formula 2).
And 2, selecting the node with the minimum value from the calculated kiney invariance of all characteristic value sample points as a father node, and taking the two separated data sets as child nodes. And 3, respectively calling the step 1 and the step 2 for the divided child nodes until all the characteristic value sample points are traversed. And 4, generating a first-stage decision tree T.
In operation S720, the first-stage decision tree model is pruned to obtain a user behavior prediction model.
The more complex the decision tree model, the higher the accuracy of the training set. But the accuracy of the test set decreases as the complexity of the tree increases, i.e., an overfitting occurs, when it reaches a certain height. Pruning is just to prevent overfitting, reducing the complexity of the tree. An example process is as follows:
let k =0,T =T 0 α = + ∞. For the first stage decision tree T, C (T) is computed 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 a loss function that determines whether pruning is performed or not.
α = min (α, g (t)) formula 4
Where C (t) is a prediction error of the tree t, and the calculation formula is C (t) = (F1/S1) × (S1/S). S: total number of samples, S1: number of samples of node t, F1: node t misclassifies the samples.
C(T t ) Represents the sum of the prediction errors of all leaf nodes of the current tree, as in equation 5.
Pruning is carried out on internal nodes T corresponding to g (T) = alpha, and the categories of the leaf nodes are determined by a majority voting method to obtain a tree T. The majority vote, i.e., the large number of classes, is used as the final class, and the small number of classes are combined. Let k = k +1, α m =α,T m = T, if T m If not, returning to the step of setting alpha = + ∞ to continue execution, otherwise, enabling T to be m =T n 。
T is generated by the above steps 0 ,....T n And selecting a data set of one month to verify the trees, and taking the tree with the highest success rate as a final decision tree, wherein the ratio of the successfully classified data to the total number of the data sets is the success rate.
Illustratively, as shown in FIG. 8, the job is judged first, and if it is a officer, the age is judged, and then the asset level is judged. If the middle-aged officer has an asset level between 10 and 20 ten thousand, the sex is further judged, and if the woman is a woman, the wealth column may be accessed. If the assets of the old officer are basically more than 20 ten thousand, the inquiry personal information can be accessed.
Fig. 9 schematically illustrates a flow chart of a method of elastically telescoping a container according to another embodiment of the present disclosure.
Referring to fig. 1 and 9, the timing elastic stretch management of this embodiment may include operations S910 to S980.
In operation S910, the monitoring layer 120 aggregates the current login customer characteristic information.
In operation S920, the monitoring layer 120 predicts and calculates the number of people in each column expected to be distributed within half an hour of the current client, and the wealth column module, the life preference module, and the personal information query module correspond to one system service respectively.
In operation S930, the container management layer 140 obtains the numbers of containers in each column, i.e., the number of containers in the container cluster for each system service.
In operation 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 to be provided by the column.
For example, the number of people (i.e. the user visit amount) in each section is predicted by the user behavior prediction model within half an hour, and assuming that the wealth section is predicted to be 1000 thousands of people within 30 minutes, the TPS is predicted to be S =10000000/30/60, the calculation result is 5500, and the peak TPS is multiplied by 2.5 on the basis, so the TPS1 is about 13750TPS.
Assuming a fiscal column container can support a TPS of 1000 (available through the pressure test tool), then about 13750/1000=14 containers are required. If the number of the current wealth column containers is 8 and the number of TPS2 is 8000, 6 containers need to be expanded.
In operation S950, for each column, it is determined whether TPS1> TPS2 × 120%. TPS1 is the TPS required in the future calculated according to the prediction result, and TPS2 is the TPS which can be provided by each column. 120% is merely exemplary. If yes, the evaluation result meets the capacity expansion condition, and then operation S960 is performed. If not, operation S970 is performed.
In operation S960, the container management layer 140 performs a capacity expansion operation on the columns of TPS1> TPS2 × 120%.
In operation S970, for each column, it is determined whether TPS1< TPS2 by 50%. If yes, the operation S9850 is performed if the evaluation result meets the capacity reduction condition. If not, ending the elastic expansion and contraction processing.
In operation S980, the container management layer 140 performs a reduction operation on TPS1< TPS2 × 50% columns.
Based on the elastic telescopic method of the container, the disclosure also provides an elastic telescopic device of the container. The apparatus will be described in detail below with reference to fig. 10.
Fig. 10 schematically shows a block diagram of a structure of a container elastic expansion device according to an embodiment of the present disclosure.
As shown in fig. 10, the elastic telescopic device 1000 of the container of this embodiment includes a data monitoring module 1010, an access prediction module 1020, a resource evaluation module 1030, and a scaling module 1040.
The data monitoring module 1010 may perform operation S210 for monitoring logged user data of N channel ends, where N is greater than or equal to 1.
The access prediction module 1020 may perform operation S220 for predicting a first user access amount of each system service in M system services in a future first time period according to the logged user data, where each system service is correspondingly established with a separate container cluster, and M is greater than or equal to 2.
In some embodiments, the access prediction module 1020 may perform operations S410 to S430, S510 to S530, and S610 to S620, which are not described herein again.
The resource evaluation module 1030 may perform operation S230, where for each system service, the current container cluster is evaluated for the computing resource according to the first user access amount, and an evaluation result is obtained.
The capacity expansion module 1040 may perform operation S240, so as to perform capacity expansion or capacity reduction processing on the container cluster of the M system services in advance when the evaluation result of any system service of the M system services meets the capacity expansion or capacity reduction condition.
In some embodiments, the elastic container retraction device 1000 may further include a service dividing module, which is used to perform operations S310 to S320, and is not described herein.
In some embodiments, the elastic expansion device 1000 may further include a model training module for performing operations S710 to S720, which are not described herein.
It should be noted that the elastic telescopic device 1000 of the container includes modules for performing the steps of any one of the embodiments described in fig. 2 to 9. The implementation, solved technical problems, implemented functions, and achieved technical effects of each module/unit/subunit and the like in the apparatus part embodiment are respectively the same as or similar to the implementation, solved technical problems, implemented functions, and achieved technical effects of each corresponding step in the method part embodiment, and are not described herein again.
According to an embodiment of the present disclosure, any of the data monitoring module 1010, the access prediction module 1020, the resource evaluation module 1030, and the scale and shrink module 1040 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module.
According to an embodiment of the present disclosure, at least one of the data monitoring module 1010, the access prediction module 1020, the resource evaluation module 1030, and the scaling module 1040 may be implemented at least in part as a hardware circuit, 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 a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in any suitable combination of any of them. Alternatively, at least one of the data monitoring module 1010, the access prediction module 1020, the resource evaluation module 1030, and the scaling module 1040 may be implemented at least in part as a computer program module that, when executed, may perform a corresponding function.
Fig. 11 schematically illustrates a block diagram of an electronic device adapted to implement a method of elastic stretching of a container according to an embodiment of the present disclosure.
As shown in fig. 11, 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 section 1108 into a Random Access Memory (RAM) 1103. The processor 1101 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 1101 may also include on-board memory for caching purposes. The processor 1101 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to the embodiments of the present disclosure.
In the RAM 1103, various programs and data necessary for the operation of the electronic device 1100 are stored. The processor 1101, the ROM 1102, and the RAM 1103 are connected to each other by a bus 1104. The processor 1101 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 1102 and/or the RAM 1103. It is to be noted that the programs may also be stored in one or more memories other than the ROM 1102 and the RAM 1103. The processor 1101 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
The present disclosure also provides a computer-readable storage medium, which may be embodied in the devices/apparatuses/systems described in the above embodiments. Or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement a method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 1102 and/or the RAM 1103 and/or one or more memories other than the ROM 1102 and the RAM 1103 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated by the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the method provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 1101. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted in the form of a signal on a network medium, distributed, downloaded and installed via the communication part 1109, and/or installed from the removable medium 1111. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 1109 and/or installed from the removable medium 1111. The computer program, when executed by the processor 1101, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments of the present disclosure and/or the claims may be made without departing from the spirit and teachings of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.
Claims (12)
1. A method of elastically telescoping a container, comprising:
monitoring login user data of N channel ends, wherein N is greater than or equal to 1;
predicting a first user access amount of each system service in M system services in a first time period in the future according to the login user data, wherein each system service is correspondingly established with an independent container cluster, and M is greater than or equal to 2;
for each system service, evaluating the computing resources of the 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 the expansion or reduction condition, performing expansion or reduction processing on the container cluster of the system service in advance.
2. The method of claim 1, wherein the predicting a first amount of user access for each of the M system services over the future first time period comprises:
obtaining S user characteristics of each login user according to the login user data, wherein S is greater than or equal to 1;
inputting S user characteristics of each login user into a user behavior prediction model, wherein the user behavior prediction model is obtained by pre-training according to the user characteristics and the access behaviors of the historical login users;
and obtaining a first prediction result output by the user behavior prediction model, wherein the first prediction result comprises the system service accessed by each login user in the first time period.
3. The method of claim 2, wherein the user behavior prediction model is constructed according to a decision tree algorithm, and pre-training the user behavior prediction model comprises:
constructing a first-stage decision tree model according to S user characteristics of each historical login user in a second past time period;
and pruning the first-stage decision tree model to obtain the user behavior prediction model.
4. The method of claim 1, wherein prior to predicting the first user access amount, the method further comprises:
dividing K system services according to service classes to obtain M system services, wherein each system service comprises at least one system service, and K is greater than or equal to 1;
and establishing M container clusters which correspond to the M system services one by one.
5. The method of claim 2, wherein after obtaining the first prediction result output by the user behavior prediction model, the method further comprises:
acquiring real-time access data of each login user, wherein the real-time access data comprises system services currently accessed by each login user;
comparing the real-time access data with the first prediction result to obtain a comparison result;
and when the comparison result of the preset number of login users is a prediction error, predicting the second user access amount of each system service in a future third time period again, wherein the third time period is less than or equal to the first time period.
6. The method of claim 5, wherein said re-predicting a second amount of user access for said each system service in a third future time period comprises: for each logged-in user for which a prediction was wrong,
inputting S user characteristics and real-time access data of each login user into the user behavior prediction model;
and obtaining a second prediction result output by the user behavior prediction model, wherein the second prediction result comprises the system service accessed by each login user in the third time period.
7. The method of claim 5, wherein the real-time access data further comprises a path of a page currently visited by the each logged-in user, and entering S user characteristics of the each logged-in user and real-time access data into the user behavior prediction model comprises:
and inputting the S user characteristics of each login user, the currently accessed system service and the currently accessed page path into the user behavior prediction model.
8. The method of claim 1, wherein after the capacity expansion or capacity reduction process is performed on the container cluster served by the system in advance, the method further comprises:
periodically re-predicting the first user visit amount within a fourth time period in the future; and/or
And in response to the change trend of the number of the login users in the login user data, the first user access amount in a fourth period of time in the future is forecasted again.
9. A container elastic telescopic device comprising:
the data monitoring module is used for monitoring login user data of N channel ends, wherein N is greater than or equal to 1;
the access prediction module is used for predicting the first user access amount of each system service in M system services in a first time period in the future according to the login user data, wherein each system service is correspondingly established with an independent container cluster, and M is greater than or equal to 2;
the resource evaluation module is used for carrying out calculation resource evaluation on the current container cluster according to the first user access amount for each system service to obtain an evaluation result;
and the capacity expansion and reduction module is used for carrying out capacity expansion or capacity reduction processing on the container cluster of the system service in advance when the evaluation result of any system service in the M system services meets the capacity expansion or reduction conditions.
10. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-8.
11. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 8.
12. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310135439.4A CN115981796A (en) | 2023-02-10 | 2023-02-10 | Method, apparatus, device and medium for elastically stretching and contracting container |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310135439.4A CN115981796A (en) | 2023-02-10 | 2023-02-10 | Method, apparatus, device and medium for elastically stretching and contracting container |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115981796A true CN115981796A (en) | 2023-04-18 |
Family
ID=85963344
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310135439.4A Pending CN115981796A (en) | 2023-02-10 | 2023-02-10 | Method, apparatus, device and medium for elastically stretching and contracting container |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115981796A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116701153A (en) * | 2023-08-09 | 2023-09-05 | 云账户技术(天津)有限公司 | Evaluation method and device of settlement service performance, electronic equipment and storage medium |
CN117407158A (en) * | 2023-10-08 | 2024-01-16 | 天翼数字生活科技有限公司 | Cluster capacity expansion method and device, electronic equipment and storage medium |
-
2023
- 2023-02-10 CN CN202310135439.4A patent/CN115981796A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116701153A (en) * | 2023-08-09 | 2023-09-05 | 云账户技术(天津)有限公司 | Evaluation method and device of settlement service performance, electronic equipment and storage medium |
CN116701153B (en) * | 2023-08-09 | 2023-10-27 | 云账户技术(天津)有限公司 | Evaluation method and device of settlement service performance, electronic equipment and storage medium |
CN117407158A (en) * | 2023-10-08 | 2024-01-16 | 天翼数字生活科技有限公司 | Cluster capacity expansion method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115981796A (en) | Method, apparatus, device and medium for elastically stretching and contracting container | |
US8762299B1 (en) | Customized predictive analytical model training | |
WO2017133615A1 (en) | Service parameter acquisition method and apparatus | |
US20150278813A1 (en) | Determining a temporary transaction limit | |
WO2019134274A1 (en) | Interest exploration method, storage medium, electronic device and system | |
WO2020168851A1 (en) | Behavior recognition | |
CN112598472B (en) | Product recommendation method, device, system, medium and program product | |
CN110197207B (en) | Method and related device for classifying unclassified user group | |
CN108182633B (en) | Loan data processing method, loan data processing device, loan data processing program, and computer device and storage medium | |
CN110909222A (en) | User portrait establishing method, device, medium and electronic equipment based on clustering | |
CN110766481A (en) | Client data processing method and device, electronic equipment and computer readable medium | |
CN115238815A (en) | Abnormal transaction data acquisition method, device, equipment, medium and program product | |
CN114202417A (en) | Abnormal transaction detection method, apparatus, device, medium, and program product | |
US20230237787A1 (en) | Techniques for dynamic time-based custom model generation | |
WO2021189949A1 (en) | Information recommendation method and apparatus, and electronic device, and medium | |
CN118035876A (en) | Recommendation information generation method, device, equipment and medium | |
WO2023185125A1 (en) | Product resource data processing method and apparatus, electronic device and storage medium | |
US20230274195A1 (en) | Time-varying features via metadata | |
CN115981970A (en) | Operation and maintenance data analysis method, device, equipment and medium | |
CN116308641A (en) | Product recommendation method, training device, electronic equipment and medium | |
CN114692014A (en) | Method, apparatus, device, medium and program product for determining candidate get-off location | |
CN112632392A (en) | Method, apparatus, device, medium and program product for determining candidate get-off location | |
KR102635315B1 (en) | Method for training caregiver-patient matching model that infers matching information between caregiver and patient and matching caregiver-patient using caregiver-patient matching model | |
CN118172130A (en) | Product recommendation method, device, equipment and medium | |
US20220318327A1 (en) | Ranking similar users based on values and personal journeys |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |