Resource adjustment method and device, electronic equipment, storage medium and program product
By predicting activity events in the future and adjusting service resource capacity, the challenges of service resource allocation during live streaming and promotion are solved, and efficient resource utilization and system stability are achieved.
Patent Information
- Application Number
- CN202411731158.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In the environment where live streaming sales and promotions are normalized, consumer payment traffic may increase sharply and quickly bottom out, and a second small peak may occur. How to efficiently allocate limited service resources to cope with the challenges of daily promotions.
By obtaining input data, historical transaction data and system data about activity events, predict whether there will be activity events that promote the execution of transaction events in the future. If an active event is predicted, the first transaction traffic is obtained to predict the second transaction traffic and the resource capacity of the service resource used to support the execution of the transaction event is adjusted according to both.
Accurate expansion and expansion of service resources is achieved, ensuring that resource capacity can effectively respond to transaction traffic during activity events, and improving system stability and user experience.
Smart Images

Figure CN119603173A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and more specifically, to a resource adjustment method, device, electronic device, computer-readable storage medium, and computer program product in the field of computer technology. Background Art
[0002] In an environment where live streaming and promotions have become normalized, the payment traffic generated by consumers' transactions and consumption may increase sharply at any time. After the sharp increase, the payment traffic will bottom out in a short time, and there is the possibility of a second small peak at any time. At the same time, the overall service resources are facing a reduction. Therefore, how to efficiently allocate service resources to cope with the daily promotion and maximize the use of limited service resources has become an urgent problem to be solved. Summary of the invention
[0003] The embodiments of this specification provide a resource adjustment method, apparatus, electronic device, computer-readable storage medium, and computer program product. The embodiments of this specification can predict in advance whether there will be activity events that promote the execution of transaction events at future times TH+N and T+N. After predicting the activity events, it can predict when to expand or reduce the service resources that support the execution of transaction events, which is conducive to providing a higher reference guarantee for the accuracy of the expansion and reduction of service resources.
[0004] In a first aspect, a method for resource adjustment is provided, which comprises: obtaining target data; wherein the target data comprises at least one of input data about an activity event, historical transaction data generated by a previous transaction event, and system data, and the activity event is used to promote the execution of the transaction event; predicting whether the activity event will be carried out in the future based on the target data; if so, obtaining a first transaction flow; wherein the first transaction flow comprises the transaction flow generated by executing the transaction event before the activity event is carried out, or the transaction flow generated by executing the transaction event at any time during the activity event; predicting a second transaction flow generated by executing the transaction event during the activity event based on the first transaction flow; wherein the time corresponding to the first transaction flow is earlier than the time corresponding to the second transaction flow; and adjusting the resource capacity of the service resources used to support the execution of the transaction event based on the first transaction flow and the second transaction flow.
[0005] In the above technical scheme, the embodiment of the present specification predicts whether an activity event for promoting the execution of a transaction event will be carried out in the future by adopting at least one of the input data on the activity event, the historical transaction data generated by the previous execution of the transaction event, and the system data. If it is predicted that the activity event will be carried out in the future, the second transaction flow generated by the execution of the transaction event during the execution of the activity event is predicted by using a first transaction flow including the transaction flow generated by the execution of the transaction event before the execution of the activity event or the transaction flow generated by the execution of the transaction event at any time during the execution of the activity event, the time corresponding to the first transaction flow is earlier than the time corresponding to the second transaction flow, and then according to the first transaction flow and the first transaction flow 2. Transaction traffic, a technical solution for adjusting the resource capacity of service resources used to support the execution of transaction events, can predict in advance whether there will be activity events that promote the execution of transaction events at future times TH+N and T+N. After predicting the activity events, it can predict when to expand or reduce the service resources supporting the execution of transaction events, which is conducive to providing a higher reference guarantee for the accuracy of the expansion and contraction of service resources; and by expanding or reducing the service resources, it can achieve reasonable allocation of service resources, ensuring that the resource capacity of the adjusted service resources can effectively cope with the transaction traffic generated by the execution of transaction events during the activity events, which is conducive to improving system stability and user experience during the activity events.
[0006] In one possible implementation, predicting whether the activity event will be carried out at a future time based on the target data includes: inputting the target data into a pre-trained qualitative model to obtain a predicted probability; wherein the qualitative model is a classification probability feature model for clustering activity events; if the predicted probability is greater than or equal to a probability threshold, determining to carry out the activity event at the future time; if the predicted probability is less than the probability threshold, determining not to carry out the activity event at the future time.
[0007] In one possible implementation, predicting the second transaction flow generated by executing the transaction event during the activity event based on the first transaction flow includes: inputting the first transaction flow into a pre-trained quantitative model to obtain the second transaction flow; wherein the quantitative model is a time series model for transaction flow prediction.
[0008] In a possible implementation, the resource adjustment method also includes: obtaining historical transaction flow generated by executing the transaction event to obtain sample data; preprocessing the sample data to obtain preprocessed data; wherein the preprocessing includes at least one of data cleaning, outlier processing and missing value processing; performing steady-state identification on the preprocessed data based on time series analysis and / or statistical analysis; if the preprocessed data presents a steady-state pattern, using the preprocessed data to train the time series model to be trained to obtain the quantitative model; if the preprocessed data does not present a steady-state pattern, using the preprocessed data as the sample data, and executing the step of preprocessing the sample data to obtain the preprocessed data.
[0009] In one possible implementation, adjusting the resource capacity of the service resources used to support the execution of the transaction event based on the first transaction flow and the second transaction flow includes: if the second transaction flow is greater than the first transaction flow, increasing the resource capacity of the service resources.
[0010] In one possible implementation, the service resource is a server, and the resource capacity of the service resource is the number of the servers; increasing the resource capacity of the service resource includes: obtaining a target number of the servers corresponding to the second transaction flow; increasing the number of the servers to the target number, thereby increasing the number of servers to cope with the transaction flow generated by executing transaction events during the activity event, which is beneficial to improving system stability and user experience during the activity event, and accurately and reasonably allocating server resources.
[0011] In one possible implementation, adjusting the resource capacity of the service resources used to support the execution of the transaction event based on the first transaction flow and the second transaction flow includes: if the second transaction flow is less than the first transaction flow, reducing the resource capacity of the service resources.
[0012] In one possible implementation, the service resource is a server, and the resource capacity of the service resource is the number of the servers; reducing the resource capacity of the service resource includes: obtaining a target number of the servers corresponding to the second transaction flow; reducing the number of the servers to the target number, thereby reducing the number of servers to cope with the transaction flow generated by executing transaction events during the activity event, which is beneficial to avoid waste of server resources and realize accurate and reasonable allocation of server resources.
[0013] In a second aspect, a resource adjustment device is provided, the resource adjustment device comprising:
[0014] A first acquisition module, configured to acquire target data; wherein the target data includes at least one of input data on an activity event, historical transaction data generated by previously executed transaction events, and system data, wherein the activity event is used to facilitate the execution of the transaction event;
[0015] A first prediction module, used for predicting whether the activity event will be carried out in the future according to the target data;
[0016] A second acquisition module is used to acquire a first transaction flow when it is predicted that the activity event will be carried out in the future; wherein the first transaction flow includes the transaction flow generated by executing the transaction event before carrying out the activity event, or the transaction flow generated by executing the transaction event at any time during carrying out the activity event;
[0017] A second prediction module is used to predict, based on the first transaction flow, a second transaction flow generated by executing the transaction event during the activity event; wherein the time corresponding to the first transaction flow is earlier than the time corresponding to the second transaction flow;
[0018] A resource adjustment module is used to adjust the resource capacity of service resources used to support the execution of the transaction event according to the first transaction flow and the second transaction flow.
[0019] In one possible implementation, the first prediction module is specifically used to input the target data into a pre-trained qualitative model to obtain a predicted probability; wherein the qualitative model is a classification probability feature model for clustering activity events; if the predicted probability is greater than or equal to a probability threshold, it is determined that the activity event will be carried out at the future time; if the predicted probability is less than the probability threshold, it is determined that the activity event will not be carried out at the future time.
[0020] In one possible implementation, the second prediction module is specifically used to predict the second transaction flow generated by executing the transaction event during the activity event based on the first transaction flow, including: inputting the first transaction flow into a pre-trained quantitative model to obtain the second transaction flow; wherein the quantitative model is a time series model for transaction flow prediction.
[0021] In a possible implementation, the resource adjustment device further includes:
[0022] A model training unit is used to obtain historical transaction flows generated by executing the transaction events to obtain sample data; preprocess the sample data to obtain preprocessed data; wherein the preprocessing includes at least one of data cleaning, outlier processing and missing value processing; based on time series analysis and / or statistical analysis, steady-state identification is performed on the preprocessed data; if the preprocessed data presents a steady-state pattern, the preprocessed data is used to train the time series model to be trained to obtain the quantitative model; if the preprocessed data does not present a steady-state pattern, the preprocessed data is used as the sample data, and the step of preprocessing the sample data to obtain the preprocessed data is performed.
[0023] In a possible implementation, the resource adjustment module includes:
[0024] The first adjustment unit is used to increase the resource capacity of the service resource if the second transaction flow is greater than the first transaction flow.
[0025] In a possible implementation, the service resource is a server, the resource capacity of the service resource is the number of the servers, and the first adjustment unit is specifically used to obtain a target number of the servers corresponding to the second transaction flow; and increase the number of the servers to the target number.
[0026] In a possible implementation, the resource adjustment module includes:
[0027] The second adjustment unit is used to reduce the resource capacity of the service resources if the second transaction flow is less than the first transaction flow.
[0028] In one possible implementation, the service resource is a server, the resource capacity of the service resource is the number of the servers, and the second adjustment unit is specifically used to obtain a target number of the servers corresponding to the second transaction flow; and reduce the number of the servers to the target number.
[0029] In a third aspect, an electronic device is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the electronic device executes the method in the first aspect or any possible implementation of the first aspect.
[0030] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0031] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic flow chart of a resource adjustment method provided in an embodiment of this specification is shown;
[0033] Figure 2 A schematic diagram showing the qualitative model provided in the embodiments of this specification for predicting the occurrence of an activity event;
[0034] Figure 3 A schematic diagram of time series model training provided by an embodiment of this specification is shown;
[0035] Figure 4 A schematic diagram showing a quantitative model for predicting transaction flow provided in an embodiment of this specification
[0036] Figure 5 A schematic diagram of the structure of a resource adjustment device provided in an embodiment of this specification is shown;
[0037] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification is shown. DETAILED DESCRIPTION
[0038] The following will be combined with the accompanying drawings to clearly and thoroughly describe the technical solutions in the embodiments of this specification. In the description of the embodiments of this specification, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of this specification, "multiple" means two or more than two.
[0039] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0040] In an environment where live streaming and promotions have become normalized, the payment traffic generated by consumers' transactions and consumption may increase sharply at any time. After the sharp increase, the payment traffic will bottom out in a short time, and there is the possibility of a second small peak at any time. At the same time, the overall service resources are facing a reduction. Therefore, how to efficiently allocate service resources to cope with the daily promotion and maximize the use of limited service resources has become an urgent problem to be solved.
[0041] In order to achieve efficient allocation of service resources and maximize their utilization, the existing solution is called the consumer finance interbank liquidity prediction solution. This solution establishes an interbank liquidity event library, captures interbank related events, and predicts T+1 liquidity through events based on expert experience rules. The shortcomings of this solution include: 1) It is impossible to make fine-grained predictions for T+0, which means that this solution can only predict the liquidity of the next day (T+1), but cannot predict the liquidity of the current day (T+0) in real time. 2) This solution is based only on expert experience and does not perform time series analysis on the data itself. It cannot fully match the traffic prediction and cannot provide accurate quantitative reference for scaling operations.
[0042] Based on the above problems, the embodiments of this specification can predict in advance whether there will be activity events that promote the execution of transaction events at future times TH+N and T+N. After predicting the activity events, it can predict when to expand or reduce the service resources that support the execution of transaction events, which is conducive to providing a higher reference guarantee for the accuracy of the expansion and reduction of service resources.
[0043] The following is an embodiment of a resource adjustment method provided in the embodiments of this specification.
[0044] Figure 1 FIG. 1 is a schematic flow chart of a resource adjustment method provided in an embodiment of the present specification. Figure 1 As shown, the resource adjustment method provided in the embodiments of this specification is applied to the adjustment of service resources in transaction scenarios, and the transaction scenarios include, for example, payment scenarios, installment repayment scenarios, etc.
[0045] The above resource adjustment method includes the following solutions:
[0046] S110: Acquire target data.
[0047] exist Figure 1In the illustrated embodiment, the target data includes at least one of the input data about the activity event, the historical transaction data generated by the previous execution of the transaction event, and the system data. The transaction event can be understood as an event of a transaction through a transaction product, and the transaction product includes a payment product, a loan and repayment product, etc.; the activity event is used to promote the execution of the transaction event. The activity event refers to a large-scale promotional activity carried out by the merchant to attract a large number of consumers to purchase goods or services. Such activities are usually accompanied by large price discounts, coupons, gifts and other marketing methods. Carrying out activity events is conducive to increasing the transaction volume, and the transaction flow generated by the execution of the transaction event also increases accordingly.
[0048] The input data is obtained online and belongs to online data, which is usually manually entered into the system by the merchant's event planner. The input data includes: event name, event type, event start and end time, event scale, number of participants, expected sales target, event promotion method, etc.
[0049] Historical transaction data and system data are already generated and exist, and are offline data. Historical transaction data includes operational data features, message push features, marketing features, etc. of shopping apps. Operational data features include user behavior data, product browsing volume, purchase history, search keywords, user preferences, etc. Message push features come from the sending and receiving records of push messages, including the number of pushes, push content, push time, user click-through rate, conversion rate, etc. Marketing features include advertising, promotional activities, partnerships, brand influence, etc.
[0050] System data includes stress testing plan characteristics, capacity characteristics, etc. The stress testing plan characteristics are derived from the results of system stress testing, including test time, test scenario, test traffic, system response time and error rate, etc. Capacity characteristics include system hardware configuration, number of servers, bandwidth, database size, etc.
[0051] S120: Predict whether to carry out an activity event in the future based on the target data.
[0052] After obtaining the target data, the target data is comprehensively analyzed to predict whether an activity event will be carried out in the future; if it is predicted that an activity event will be carried out in the future, the specific future time of the activity event can be determined.
[0053] S130: When it is predicted that an activity event will be carried out in the future, obtain a first transaction flow.
[0054] There are two situations in which an event is predicted to take place in the future. The first situation is that an event is predicted to take place in the future when there is no event at the current time. For example, the current time is September 28, 2024, and there is no event on September 28. It is predicted that an event will take place on October 10, 2024.
[0055] Since some activity events last for a long time, such as 3 days, 7 days, 30 days, etc., the second situation is that when an activity event has been carried out at the current time, it is predicted that an activity event will be carried out in the future. For example, the current time is October 10, 2024, and an activity event has been carried out on October 10. At the current time, it is predicted that an activity event will be carried out on October 11, 2024. The activity event that has been carried out on October 10 has not ended yet, and the activity event will continue on October 11.
[0056] The first transaction flow can be understood as the transaction flow obtained at the current time, which belongs to the transaction flow that has actually been generated. Since there are two situations in which it is predicted that an activity event will be carried out in the future, the first transaction flow obtained also corresponds to two situations. In the first situation, the first transaction flow obtained includes the transaction flow generated by the execution of the transaction event before the activity event is carried out, and in the second situation, the first transaction flow obtained includes the transaction flow generated by the execution of the transaction event before the activity event is carried out. That is, in the case of predicting that an activity event will be carried out in the future, the first transaction flow obtained includes the transaction flow generated by the execution of the transaction event before the activity event is carried out, or the transaction flow generated by the execution of the transaction event at any time during the activity event.
[0057] S140: Predicting a second transaction flow generated by executing a transaction event during the activity event based on the first transaction flow; wherein the time corresponding to the first transaction flow is earlier than the time corresponding to the second transaction flow.
[0058] After obtaining the first transaction flow, the second transaction flow generated by executing the transaction event during the activity event is predicted based on the first transaction flow. The first transaction flow and the second transaction flow are daytime flows. The second transaction flow can be understood as the target transaction flow or predicted transaction flow generated by executing the transaction event during the activity event in the future. Since the second transaction flow is predicted, the time corresponding to the second transaction flow is later than the time corresponding to the first transaction flow. If the time corresponding to the first transaction flow is represented by T, the time corresponding to the second transaction flow is represented by T+N, N is a positive integer greater than or equal to 1, and the unit of T can be "day" or "hour". For example, the current time is September 28, 2024, and there is no activity event on September 28. At the current time, it is predicted that the activity event will be carried out on October 10, 2024. Then, the second transaction flow predicts the transaction flow generated by executing the transaction event when the activity event is carried out on October 10, 2024.
[0059] S150: Adjusting the resource capacity of service resources used to support the execution of the transaction event according to the first transaction flow and the second transaction flow.
[0060] The service resources used to support the execution of transaction events include at least one of computing resources, network resources, storage resources, etc. Computing resources include servers, CPUs, memory, disk space, etc. Network resources include bandwidth, network equipment, etc. Storage resources include databases, caches, etc.
[0061] After obtaining the first transaction flow and the second transaction flow, the resource capacity of the service resources is adjusted by comparing the first transaction flow and the second transaction flow. If the resource capacity of the service resources needs to be increased, the operation of increasing the resource capacity of the service resources is performed, that is, the service resources are expanded; if the resource capacity of the service resources needs to be reduced, the operation of reducing the resource capacity of the service resources is performed, that is, the service resources are reduced; by adjusting the resource capacity of the service resources, the reasonable allocation of service resources can be achieved, ensuring that the resource capacity of the adjusted service resources can effectively cope with the transaction flow generated by the execution of transaction events during the activity events, which is conducive to improving the system stability and user experience during the activity events.
[0062] The embodiments of the present specification use at least one of input data about the activity event, historical transaction data generated by the previous execution of the transaction event, and system data to predict whether an activity event for promoting the execution of the transaction event will be carried out in the future. If it is predicted that the activity event will be carried out in the future, a first transaction flow including the transaction flow generated by the execution of the transaction event before the activity event is carried out or the transaction flow generated by the execution of the transaction event at any time during the activity event is predicted. A second transaction flow generated by the execution of the transaction event during the activity event is predicted, and the time corresponding to the first transaction flow is earlier than the time corresponding to the second transaction flow. Then, according to the first transaction flow and the second transaction flow, The technical solution for adjusting the resource capacity of service resources used to support the execution of transaction events can predict in advance whether there will be activity events that promote the execution of transaction events at the future time TH+N and T+N. After predicting the activity events, it can predict when to expand or reduce the service resources supporting the execution of transaction events, which is conducive to providing a higher reference guarantee for the accuracy of the expansion and contraction of service resources; and by expanding or reducing the service resources, it can achieve reasonable allocation of service resources, ensuring that the resource capacity of the adjusted service resources can effectively cope with the transaction flow generated by the execution of transaction events during the activity events, which is conducive to improving system stability and user experience during the activity events.
[0063] In a possible implementation, the above-mentioned prediction of whether to carry out an activity event in the future time based on the target data includes the following schemes:
[0064] Input the target data into the pre-trained qualitative model to obtain the predicted probability;
[0065] If the predicted probability is greater than or equal to the probability threshold, determine to carry out the activity event at a future time;
[0066] If the predicted probability is less than the probability threshold, it is determined that the activity event will not be carried out in the future.
[0067] The prediction of whether an activity event will be carried out in the future is achieved through a pre-trained qualitative model, which is a classification probability feature model for clustering activity events. Among them, the classification probability feature model is obtained through supervised training based on expert experience and factual results data, which can improve the accuracy of predicting whether an activity event will be carried out in the future. The data based on expert experience and factual results are the same as the data type included in the above-mentioned target data, and the data based on expert experience and factual results carry labels. The process of supervised training of the classification probability feature model includes:
[0068] 1. Collect data containing expert experience and factual results. These data should include past events and their related characteristics, as well as experts’ probability estimates or classification labels for these events.
[0069] 2. Extract useful features, which can be key indicators from expert experience or relevant variables mined from raw data.
[0070] 3. Choose a supervised learning model suitable for the task, such as logistic regression, decision tree, random forest, support vector machine, neural network, etc.
[0071] 4. Train the selected model using labeled data. The labels come from expert experience and factual results. These labels indicate the probability of each sample belonging to a certain category (activity occurred or not occurred).
[0072] 5. Use cross-validation or other validation methods to evaluate the performance of the model to ensure that the model is not overfitting or underfitting.
[0073] 6. Adjust model parameters based on the validation results to improve model performance, and use an independent test dataset to evaluate the generalization ability of the model.
[0074] 7. Model deployment: Use the trained classification probability feature model as a qualitative model, and the model training is completed.
[0075] like Figure 2 As shown, Figure 2 A schematic diagram of the qualitative model provided in the embodiment of this specification predicting the occurrence of an activity event is shown. After the qualitative model is trained, the qualitative model is applied, that is, the target data is used as the model input and input into the qualitative model. After the target data is processed by the qualitative model, the output result of the qualitative model is converted through the Softmax function (activation function) and the prediction result is output. The prediction result is a probability value between 0 and 1, which is called the predicted probability. Then, the predicted probability threshold is compared. If the predicted probability is greater than or equal to the probability threshold, it is considered that the activity event will be carried out in the future; if the predicted probability is less than the probability threshold, it is considered that the activity event will not be carried out in the future.
[0076] In a possible implementation, the second transaction flow generated by executing the transaction event during the activity event according to the first transaction flow prediction includes the following schemes:
[0077] The first transaction flow is input into a pre-trained quantitative model to obtain a second transaction flow.
[0078] The quantitative model is a pre-trained time series model for transaction flow prediction. For example, the ARIMA model (Autoregressive Integrated Moving Average Model) is selected as the time series model. Figure 3 As shown, Figure 3A schematic diagram of the time series model training provided by the embodiment of this specification is shown. The training of the time series model is as follows:
[0079] S210: Acquire historical transaction flows generated by executing transaction events to obtain sample data, that is, the sample data includes sample data that has been generated.
[0080] S212: Preprocess the sample data to obtain preprocessed data; wherein the preprocessing of the sample data includes but is not limited to at least one of data cleaning, outlier processing and missing value processing. Data cleaning mainly removes meaningless or erroneous data points; outlier processing is processing extreme values that exceed the normal range, which can be eliminated or replaced with more reasonable values; missing value processing is filling or deleting missing data points.
[0081] S214: According to time series analysis and / or statistical analysis, steady state identification is performed on the preprocessed data; wherein steady state is intended to indicate that the data presents a certain regularity, such as periodicity, trend, etc. Time series analysis and / or statistical analysis can be used to determine whether the preprocessed data is in a steady state. If the preprocessed data presents a steady state pattern, it is considered that the preprocessed data meets the modeling requirements; otherwise, the preprocessed data may have problems such as large fluctuations and unstable trends. If the preprocessed data presents a steady state pattern, execute S216; if the preprocessed data does not present a steady state pattern, execute S218.
[0082] S216: Use the preprocessed data to train the time series model to be trained to obtain a quantitative model; if the preprocessed data presents a steady-state pattern, the preprocessed data can be used to train the time series model to be trained, such as ARIMA. After the training is completed, the obtained model is the so-called quantitative model, which can be used to predict future transaction flows.
[0083] S218: Use the preprocessed data as sample data and execute S212; if the preprocessed data does not show a steady-state pattern, the sample data needs to be readjusted. At this time, the preprocessed data is used as sample data again and S212 is repeatedly executed until the obtained preprocessed data meets the modeling requirements, thereby realizing model training.
[0084] like Figure 4 As shown, Figure 4A schematic diagram of predicting transaction flow using a quantitative model provided in an embodiment of the present specification is shown. After the quantitative model is trained, the quantitative model is applied to predict transaction flow. A steady-state analysis is first performed on the first transaction flow. If the first transaction flow presents a steady-state pattern, the first transaction flow is used as the model input. After the quantitative model processes the first transaction flow, the second transaction flow is output, that is, the second transaction flow generated by executing a transaction event during the activity event is predicted. If the first transaction flow does not present a steady-state pattern, the first transaction flow is preprocessed until the preprocessed first transaction flow presents a steady-state pattern, and then the preprocessed first transaction flow is used as the model input, and the second transaction flow is output through the quantitative model.
[0085] In a possible implementation, adjusting the resource capacity of the service resources used to support the execution of the transaction event according to the first transaction flow and the second transaction flow includes the following solutions:
[0086] comparing the second transaction flow with the first transaction flow;
[0087] If the second transaction flow is greater than the first transaction flow, increasing the resource capacity of the service resource;
[0088] If the second transaction flow is less than the first transaction flow, the resource capacity of the service resources is reduced.
[0089] After obtaining the second transaction flow, the second transaction flow is compared with the first transaction flow to obtain a comparison result. The comparison result can be used to determine the change in demand for service resources. If the second transaction flow is greater than the first transaction flow, it means that during the activity event, the transaction flow will increase significantly. At this time, it is necessary to increase the resource capacity of the service resources, that is, to expand the service resources. On the contrary, if the second transaction flow is less than the first transaction flow, it means that during the activity event, the transaction flow will not increase significantly, but will decrease. At this time, you can consider reducing the resource capacity of the service resources, that is, to shrink the service resources.
[0090] In a possible implementation, when the service resource is a server and the resource capacity of the service resource is the number of servers, the above-mentioned increasing the resource capacity of the service resource includes the following solutions:
[0091] Obtain a target number of servers corresponding to the second transaction flow;
[0092] Increase the number of servers to the target number.
[0093] A corresponding number of servers are set in advance for different transaction flows, that is, each transaction flow corresponds to a server number. By comparing the second transaction flow with the first transaction flow, it is determined that the server needs to be expanded, and the number of servers corresponding to the second transaction flow can be obtained, that is, the target number of servers can be obtained, and then the current number of servers can be increased to the target number, so that the transaction flow generated by executing transaction events during the activity event can be responded to by increasing the number of servers, which is conducive to improving the system stability and user experience during the activity event, as well as accurately and reasonably allocating server resources.
[0094] In the case where the service resource is a server and the resource capacity of the service resource is the number of servers, the above-mentioned method of increasing the resource capacity of the service resource includes the following solutions:
[0095] Obtain a target number of servers corresponding to the second transaction flow;
[0096] Reduce the number of servers to the target number.
[0097] By comparing the second transaction flow with the first transaction flow, it is determined that the server needs to be scaled down, and the number of servers corresponding to the second transaction flow can be obtained, that is, the target number of servers. Then, the current number of servers is reduced to the target number, thereby reducing the number of servers to cope with the transaction flow generated by the execution of transaction events during the activity event, which is beneficial to avoid waste of server resources and realize accurate and reasonable allocation of server resources.
[0098] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0099] Figure 5 FIG. 1 shows a schematic diagram of a resource adjustment device provided in an embodiment of the present specification. Figure 5 As shown, the resource adjustment device 500 includes:
[0100] A first acquisition module 510, configured to acquire target data; wherein the target data includes at least one of input data on an activity event, historical transaction data generated by previously executed transaction events, and system data, wherein the activity event is used to facilitate the execution of the transaction event;
[0101] A first prediction module 520, configured to predict whether the activity event will be carried out in the future according to the target data;
[0102] The second acquisition module 530 is used to acquire a first transaction flow when it is predicted that the activity event will be carried out in the future; wherein the first transaction flow includes the transaction flow generated by executing the transaction event before carrying out the activity event, or the transaction flow generated by executing the transaction event at any time during carrying out the activity event;
[0103] A second prediction module 540 is used to predict, based on the first transaction flow, a second transaction flow generated by executing the transaction event during the activity event; wherein the time corresponding to the first transaction flow is earlier than the time corresponding to the second transaction flow;
[0104] The resource adjustment module 550 is used to adjust the resource capacity of the service resources used to support the execution of the transaction event according to the first transaction flow and the second transaction flow.
[0105] In one possible implementation, the first prediction module 520 is specifically used to input the target data into a pre-trained qualitative model to obtain a predicted probability; wherein the qualitative model is a classification probability feature model for clustering activity events; if the predicted probability is greater than or equal to a probability threshold, it is determined that the activity event will be carried out at the future time; if the predicted probability is less than the probability threshold, it is determined that the activity event will not be carried out at the future time.
[0106] In one possible implementation, the second prediction module 540 is specifically used to predict the second transaction flow generated by executing the transaction event during the activity event based on the first transaction flow, including: inputting the first transaction flow into a pre-trained quantitative model to obtain the second transaction flow; wherein the quantitative model is a time series model for transaction flow prediction.
[0107] In a possible implementation, the resource adjustment device 500 further includes:
[0108] A model training unit is used to obtain historical transaction flows generated by executing the transaction events to obtain sample data; preprocess the sample data to obtain preprocessed data; wherein the preprocessing includes at least one of data cleaning, outlier processing and missing value processing; based on time series analysis and / or statistical analysis, steady-state identification is performed on the preprocessed data; if the preprocessed data presents a steady-state pattern, the preprocessed data is used to train the time series model to be trained to obtain the quantitative model; if the preprocessed data does not present a steady-state pattern, the preprocessed data is used as the sample data, and the step of preprocessing the sample data to obtain the preprocessed data is performed.
[0109] In a possible implementation, the resource adjustment module 550 includes:
[0110] The first adjustment unit is used to increase the resource capacity of the service resource if the second transaction flow is greater than the first transaction flow.
[0111] In a possible implementation, the service resource is a server, the resource capacity of the service resource is the number of the servers, and the first adjustment unit is specifically used to obtain a target number of the servers corresponding to the second transaction flow; and increase the number of the servers to the target number.
[0112] In a possible implementation, the resource adjustment module 550 includes:
[0113] The second adjustment unit is used to reduce the resource capacity of the service resources if the second transaction flow is less than the first transaction flow.
[0114] In one possible implementation, the service resource is a server, the resource capacity of the service resource is the number of the servers, and the second adjustment unit is specifically used to obtain a target number of the servers corresponding to the second transaction flow; and reduce the number of the servers to the target number.
[0115] It should be noted that the resource adjustment device provided in the above embodiment only uses the division of the above functional modules as an example when executing the resource adjustment method. In actual applications, the above functional distribution can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the resource adjustment device provided in the above embodiment belongs to the same concept as the resource adjustment method embodiment. Therefore, for details not disclosed in the embodiment of the device disclosed in the present invention, please refer to the embodiment of the resource adjustment method disclosed in the present invention, which will not be repeated here.
[0116] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.
[0117] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification is shown.
[0118] For example, Figure 6 As shown, the electronic device 600 includes: a memory 601 and a processor 602, wherein the memory 601 stores an executable program code 6011, and the processor 602 is used to call and execute the executable program code 6011 to perform a resource adjustment method.
[0119] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be corresponded to, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0120] In the case of dividing each functional module according to each function, the electronic device may include: a first acquisition module, a first prediction module, a second acquisition module, a second acquisition module, a resource adjustment module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.
[0121] The electronic device provided in this embodiment is used to execute the above-mentioned resource adjustment method, and thus can achieve the same effect as the above-mentioned implementation method.
[0122] In the case of an integrated unit, the electronic device may include a processing module and a storage module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device in executing mutual program codes and data.
[0123] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the embodiments of this specification. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.
[0124] This embodiment further provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer, the computer executes the above-mentioned related method steps to implement a resource adjustment method in the above-mentioned embodiment.
[0125] This embodiment further provides a computer program product. When the computer program product runs on a computer, the computer is enabled to execute the above-mentioned related steps to implement a resource adjustment method in the above-mentioned embodiment.
[0126] In addition, the electronic device provided in the embodiments of the embodiments of this specification may specifically be a chip, a component or a module, and the electronic device may include a connected processor and a memory; wherein the memory is used to store instructions, and when the electronic device is running, the processor may call and execute instructions so that the chip executes a resource adjustment method in the above-mentioned embodiment.
[0127] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0128] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0129] In the embodiments provided in the embodiments of this specification, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0130] The above contents are only specific implementation methods of the embodiments of this specification, but the protection scope of the embodiments of this specification is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of this specification, which should be included in the protection scope of the embodiments of this specification. Therefore, the protection scope of the embodiments of this specification shall be based on the protection scope of the claims.
Claims
1. A resource adjustment method, the resource adjustment method comprising: Acquire target data; wherein the target data includes at least one of input data about an activity event, historical transaction data generated by previously executed transaction events, and system data, and the activity event is used to facilitate the execution of the transaction event; Predicting whether the activity event will be carried out in the future based on the target data; If yes, obtain a first transaction flow; wherein the first transaction flow includes the transaction flow generated by executing the transaction event before the activity event is carried out, or the transaction flow generated by executing the transaction event at any time during the activity event; Predicting, according to the first transaction flow, a second transaction flow generated by executing the transaction event during the period of carrying out the activity event; wherein the time corresponding to the first transaction flow is earlier than the time corresponding to the second transaction flow; According to the first transaction flow and the second transaction flow, the resource capacity of the service resources used to support the execution of the transaction event is adjusted.
2. The resource adjustment method according to claim 1, wherein the step of predicting whether the activity event will be carried out in the future based on the target data comprises: Input the target data into a pre-trained qualitative model to obtain a predicted probability; wherein the qualitative model is a classification probability feature model for clustering activity events; If the predicted probability is greater than or equal to the probability threshold, determine to carry out the activity event at the future time; If the predicted probability is less than the probability threshold, it is determined that the activity event will not be carried out at the future time.
3. The resource adjustment method according to claim 1, wherein the second transaction flow generated by executing the transaction event during the activity event according to the first transaction flow prediction comprises: Inputting the first transaction flow into a pre-trained quantitative model to obtain the second transaction flow; Wherein, the quantitative model is a time series model for transaction flow prediction.
4. The resource adjustment method according to claim 3, further comprising: Obtaining historical transaction flows generated by executing the transaction events to obtain sample data; Preprocessing the sample data to obtain preprocessed data; wherein the preprocessing includes at least one of data cleaning, outlier processing and missing value processing; Performing steady-state identification on the preprocessed data according to time series analysis and / or statistical analysis; If the preprocessed data presents a steady-state pattern, training the time series model to be trained using the preprocessed data to obtain the quantitative model; If the preprocessed data does not present a steady-state pattern, the preprocessed data is used as the sample data, and the step of preprocessing the sample data to obtain the preprocessed data is performed.
5. The resource adjustment method according to any one of claims 1 to 4, wherein adjusting the resource capacity of the service resources used to support the execution of the transaction event according to the first transaction flow and the second transaction flow comprises: If the second transaction flow is greater than the first transaction flow, the resource capacity of the service resource is increased.
6. The resource adjustment method according to claim 5, wherein the service resource is a server, and the resource capacity of the service resource is the number of the servers; The increasing the resource capacity of the service resource comprises: Obtaining a target number of the servers corresponding to the second transaction flow; The number of servers is increased to the target number.
7. The resource adjustment method according to any one of claims 1 to 4, wherein adjusting the resource capacity of the service resources used to support the execution of the transaction event according to the first transaction flow and the second transaction flow comprises: If the second transaction flow is less than the first transaction flow, the resource capacity of the service resource is reduced.
8. The resource adjustment method according to claim 7, wherein the service resource is a server, and the resource capacity of the service resource is the number of the servers; The reducing the resource capacity of the service resource comprises: Obtaining a target number of the servers corresponding to the second transaction flow; The number of servers is reduced to the target number.
9. A resource adjustment device, comprising: A first acquisition module, configured to acquire target data; wherein the target data includes at least one of input data on an activity event, historical transaction data generated by previously executed transaction events, and system data, wherein the activity event is used to facilitate the execution of the transaction event; A first prediction module, used for predicting whether the activity event will be carried out in the future according to the target data; A second acquisition module is used to acquire a first transaction flow when it is predicted that the activity event will be carried out in the future; wherein the first transaction flow includes the transaction flow generated by executing the transaction event before carrying out the activity event, or the transaction flow generated by executing the transaction event at any time during carrying out the activity event; A second acquisition module is used to predict, based on the first transaction flow, a second transaction flow generated by executing the transaction event during the activity event; wherein the time corresponding to the first transaction flow is earlier than the time corresponding to the second transaction flow; A resource adjustment module is used to adjust the resource capacity of service resources used to support the execution of the transaction event according to the first transaction flow and the second transaction flow.
10. An electronic device, comprising: A memory for storing executable program codes; A processor is used to call and run the executable program code from the memory, so that the electronic device executes the resource adjustment method as described in any one of claims 1 to 8.
11. A computer-readable storage medium storing a computer program, wherein when the computer program is executed, the resource adjustment method according to any one of claims 1 to 8 is implemented.
12. A computer program product comprising instructions, which, when executed on a computer or a processor, enables the computer or the processor to execute the resource adjustment method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Container resource control method and device and computer storage medium
CN113886010A
Resource scheduling method, system and equipment and storage medium
CN114936089A
Service scaling method and device, electronic equipment and storage medium
CN115545805A
Traffic prediction and resource scheduling method and device, electronic equipment and storage medium
CN117478528A
Resource scheduling method and device, electronic equipment and storage medium
CN117762639A
Cited By
Resource data processing method and device, storage medium and electronic equipment
CN121563159A
Resource adjustment
WO2026113768A1