Capacity expansion method and device
By using historical load data to predict the load curve and determine the expansion time point, the problem that the expansion trigger mechanism in the prior art cannot reasonably utilize resources and easily causes call loss is solved, and the rational utilization of resources and the effect of reducing call loss is achieved.
Patent Information
- Application Number
- CN201811643605.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-29
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2038-12-29
AI Technical Summary
The capacity expansion trigger mechanism of the prior art cannot reasonably utilize resources, which can easily cause call loss problems.
By obtaining the predicted load curve based on historical load data, obtaining the expansion time point based on the predicted load curve, and starting the expansion at that time point.
Avoid problems caused by too low or too high expansion thresholds, ensure the rational use of resources, and reduce call losses.
Smart Images

Figure CN111381959B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a capacity expansion method and device. Background Art
[0002] At present, cloud computing, virtualization and container technologies are widely used, and cluster technologies based on virtualization and containers have been generated. When the load is too high, the nodes are expanded and cluster node resources are added to the corresponding cluster; when the load is too low, the load is moved away and the cluster nodes are reduced. In this way, computing resources are dynamically allocated on demand, which improves resource utilization and reduces energy consumption. Different manufacturers use different criteria for determining the trigger conditions for expansion and contraction. For example, the Docker container of Openshift uses the average utilization rate of the central processing unit (CPU) as the threshold value, and OSG uses the number of calls established per second (CAPS) by the service as the trigger threshold. If the threshold exceeds the upper limit, the virtual machine (container) is expanded, and if it is lower than the lower limit, the virtual machine (container) is reduced. However, no matter which expansion trigger mechanism is used, the same problem is faced: if the expansion threshold is too low, unnecessary virtual machines (containers) will be generated, reducing the utilization of computing resources; if the expansion threshold is too high, it may cause call loss. This problem is particularly prominent for businesses with fast load growth and long expansion process. Summary of the invention
[0003] The embodiments of the present invention provide a capacity expansion method and device to at least solve the problem that the capacity expansion trigger mechanism in the related art cannot reasonably utilize resources and easily causes call loss.
[0004] According to an embodiment of the present invention, a capacity expansion method is provided, comprising: obtaining a predicted load curve according to historical load data; obtaining a capacity expansion time point according to the predicted load curve; and starting capacity expansion at the capacity expansion time point.
[0005] Optionally, obtaining the predicted load curve based on the historical load data includes: inputting the historical load data as predetermined historical load data into a predetermined model, processing the historical load data using the predetermined model, and obtaining a predetermined predicted load curve as the predicted load curve, wherein the predetermined model is obtained through machine learning using multiple sets of data, and each set of data in the multiple sets of data includes: predetermined historical load data, and a predetermined predicted load curve.
[0006] Optionally, obtaining the capacity expansion time point according to the predicted load curve includes: obtaining an average predicted load curve according to an upper tolerance curve and a lower tolerance curve included in the predicted load curve; obtaining a first capacity expansion time point according to the average predicted load curve and a predetermined threshold value; obtaining the capacity expansion time point according to the first capacity expansion time point and the time required for capacity expansion.
[0007] Optionally, using the predetermined model to process the historical load data includes: cyclically deleting values with the smallest standard deviation in the historical load data until N values are deleted, where N is a positive integer; obtaining the standard deviation of each value in the deleted historical load data; and processing the standard deviation using the predetermined model.
[0008] Optionally, the predetermined model includes predetermined coefficients obtained through machine learning using multiple sets of data.
[0009] Optionally, the predetermined coefficient is obtained in the following manner: setting an initial value of the predetermined coefficient; using the initial value to process predetermined historical load data to obtain a predetermined predicted load curve; obtaining an error value based on the predetermined predicted load curve and an actual predicted load curve corresponding to the predetermined predicted load curve; when the error value does not fall within a predetermined range, correcting the initial value, continuing to execute the above steps until the error value falls within the predetermined range, and using the corrected initial value as the predetermined coefficient.
[0010] Optionally, before acquiring the predicted load curve according to the historical load data, the method further includes: updating the historical load data.
[0011] Optionally, obtaining the capacity expansion time point according to the predicted load curve includes: obtaining an average predicted load curve according to an upper tolerance curve and a lower tolerance curve included in the predicted load curve; obtaining a first capacity expansion time point according to the average predicted load curve and a predetermined threshold value; obtaining the capacity expansion time point according to the first capacity expansion time point and the time required for capacity expansion.
[0012] Optionally, starting capacity expansion at the capacity expansion time point includes: starting capacity expansion at the capacity expansion time point when it is detected that a second actual load curve corresponding to the predicted load curve conforms to a predetermined relationship with the predicted load curve; detecting that the second actual load curve does not conform to a predetermined relationship with the predicted load curve; and starting capacity expansion when the actual load reaches a capacity expansion threshold value.
[0013] Optionally, the predetermined relationship includes: the actual load curve is between the upper tolerance curve and the lower tolerance curve.
[0014] According to another embodiment of the present invention, an elastic expansion unit ESU is also provided, including: a first acquisition module, used to obtain a predicted load curve based on historical load data; a second acquisition module, used to obtain an expansion time point based on the predicted load curve; and a start module, which starts expansion at the expansion time point.
[0015] According to yet another embodiment of the present invention, a storage medium is provided, wherein the storage medium includes a stored program, wherein the program executes any of the above methods when it is run.
[0016] According to yet another embodiment of the present invention, a processor is provided, wherein the processor is used to run a program, wherein the program executes any of the above methods when running.
[0017] Through the present invention, a predicted load curve is obtained according to historical load data; a capacity expansion time point is obtained according to the predicted load curve; and capacity expansion is started at the capacity expansion time point. Since the load curve is predicted according to historical load data, and the corresponding capacity expansion time point is obtained according to the predicted load curve, capacity expansion is started at the capacity expansion time point, so that the time to trigger capacity expansion is no longer solely dependent on a fixed capacity expansion threshold, and the corresponding time to trigger capacity expansion can be determined according to historical load data, avoiding problems caused by too low or too high capacity expansion thresholds. Therefore, the problem that the capacity expansion trigger mechanism of the related art cannot reasonably utilize resources and easily causes call loss can be solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0019] Figure 1 is a hardware structure block diagram of a mobile terminal of a capacity expansion method according to an embodiment of the present invention;
[0020] Figure 2 is a flow chart of a capacity expansion method according to an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of obtaining a capacity expansion time point according to an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of a networking device according to an embodiment of the present invention;
[0023] Figure 5 is a preferred flow chart of a capacity expansion method according to an embodiment of the present invention;
[0024] Figure 6 is a structural block diagram of a capacity expansion device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0027] Example 1
[0028] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a capacity expansion method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal 10 may include one or more (only one is shown in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0029] The memory 104 can be used to store software programs and modules of application software, such as program instructions / modules corresponding to the expansion method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0031] In this embodiment, a capacity expansion method running on the above mobile terminal is provided. Figure 2 is a flow chart of a capacity expansion method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0032] Step S202, obtaining a predicted load curve according to historical load data;
[0033] Step S204, obtaining a capacity expansion time point according to the predicted load curve;
[0034] Step S206, starting capacity expansion at the capacity expansion time point.
[0035] Through the above steps, since the load curve is predicted according to the historical load data, and the corresponding expansion time point is obtained according to the predicted load curve, the expansion is started at the expansion time point, so that the time to trigger the expansion is no longer based on the fixed expansion threshold, and the corresponding time to trigger the expansion can be determined according to the historical load data, avoiding the problem caused by the expansion threshold being too low or too high. Therefore, the problem that the expansion trigger mechanism of the related technology cannot reasonably utilize resources and easily causes call loss can be solved.
[0036] Optionally, obtaining a predicted load curve according to historical load data includes: inputting the historical load data as predetermined historical load data into a predetermined model, processing the historical load data using the predetermined model, and obtaining a predetermined predicted load curve as the predicted load curve, wherein the predetermined model is obtained by machine learning using multiple sets of data, and each set of data in the multiple sets of data includes: predetermined historical load data, and a predetermined predicted load curve. Through the above steps, the most suitable predicted load curve can be obtained by machine learning multiple times, so that it can be used to process the actual load.
[0037] For example, the above embodiment can be based on statistical models and mean standard deviation analysis technology to cyclically eliminate data with relatively large deviations in the sample space (including historical load data). Each time a point is eliminated, the eliminated point satisfies the minimum standard deviation of the remaining points. The standard deviation of each element point data multiplied by the coefficient K constitutes the tolerance package curve (equivalent to the above-mentioned predicted load curve), and the coefficient K is obtained through simulator training. In order to obtain the expansion time point Tai, the average line of the upper and lower tolerance lines of the tolerance package curve is obtained as the predicted load line. The moment of intersection of the predicted load line and the set threshold value is the initially determined trigger expansion time T1. Assuming that the expansion process takes time △T, then after calculation, the final determined trigger expansion time point Tai = T1-△T. Tai can only be applied when the actual load curve is between the upper and lower tolerance lines.
[0038] Optionally, processing the historical load data using a predetermined model includes: cyclically deleting values with the smallest standard deviation in the historical load data until N values are deleted, where N is a positive integer; obtaining the standard deviation of each value in the deleted historical load data; and processing the standard deviation using a predetermined model.
[0039] Optionally, the predetermined model includes predetermined coefficients obtained by machine learning using multiple sets of data.
[0040] Optionally, the predetermined coefficient is obtained in the following manner: setting an initial value of the predetermined coefficient; using the initial value to process predetermined historical load data to obtain a predetermined predicted load curve; obtaining an error value based on the predetermined predicted load curve and an actual predicted load curve corresponding to the predetermined predicted load curve; when the error value does not fall within a predetermined range, correcting the initial value, continuing to execute the above steps until the error value falls within the predetermined range, and using the corrected initial value as the predetermined coefficient.
[0041] Optionally, before obtaining the predicted load curve according to the historical load data, it also includes: updating the historical load data. For example, when it is necessary to add new load data to the historical load data set, the learning process for a can be as follows: multiply the latest load data obtained by a, put it into the predetermined historical load data set, and perform the above learning process on K according to the historical data set with the latest load data added. When the error value obtained is no longer within the predetermined range, a and K are corrected simultaneously according to the error value until the error value obtained falls within the predetermined range, and the final corrected K and a are used as the new K and a.
[0042] Optionally, obtaining the capacity expansion time point according to the predicted load curve includes: obtaining the average predicted load curve according to the upper tolerance curve and the lower tolerance curve included in the predicted load curve; obtaining the first capacity expansion time point according to the average predicted load curve and a predetermined threshold value; obtaining the capacity expansion time point according to the first capacity expansion time point and the time required for the expansion.
[0043] Optionally, starting capacity expansion at the capacity expansion time point includes: starting capacity expansion at the capacity expansion time point when it is detected that a second actual load curve corresponding to the predicted load curve conforms to a predetermined relationship with the predicted load curve; detecting that the second actual load curve does not conform to a predetermined relationship with the predicted load curve; and starting capacity expansion when the actual load reaches a capacity expansion threshold value.
[0044] Optionally, the predetermined relationship includes: the actual load curve is between the upper tolerance curve and the lower tolerance curve.
[0045] The main idea of the above embodiment is: using a large amount of load data generated by the daily operation and maintenance of the business system, after machine learning, predict the load curve of the next day (tolerance package line, i.e. predicted load curve), and further predict the expansion time Tai. If the actual load curve is basically consistent with the predicted load curve trend, the expansion is started at the Tai time, otherwise the expansion is triggered when the actual load reaches the upper limit of the expansion threshold value Trel. Since Tai contains a time advance compared to Trel, compared with the traditional elastic expansion method, the expansion method based on machine learning can achieve the purpose of calmly expanding the virtual machine (container) without call loss while ensuring full utilization of computing resources.
[0046] It should be noted that the above prediction process can select a dynamic baseline algorithm. For ease of understanding, the application of this algorithm is systematically introduced below.
[0047] In the daily operation of telecommunications services, a large amount of load-related data is generated, such as call CAPS and CPU usage. If observed on a daily basis, these data change over time with obvious regularity and good predictability. Machine learning is a very important research field in computer science and artificial intelligence. It uses algorithms to automatically analyze large amounts of data to obtain regularities and use the regularities to predict unknown data. The dynamic baseline algorithm is a machine learning algorithm with good prediction results. In terms of implementation technology, it mainly includes (i) baseline selection. Baseline selection also includes (1) sample space selection. The sample space is the training data set. The larger the sample space, the lower the baseline distortion obtained by a reasonable calculation method. However, when the sample space reaches a certain size, the accuracy benefit brought by continuing to increase the sample space is not high, and it will increase the difficulty of data storage and calculation. Therefore, it is necessary to reasonably select the sample space size based on the storage and calculation capabilities of the existing data. (2) Data preprocessing. After obtaining sample data of appropriate size, the data needs to be preprocessed to eliminate the influence of abnormal data on the initial baseline calculation. Generally, the data is filtered by statistical laws. Common methods include: directly eliminating the maximum and minimum values; selecting the data with the most concentrated distribution as normal data according to a certain ratio. (3) Baseline calculation: on the basis of initializing the baseline, continuously train the parameters through simulation to minimize the error between the actual data and the predicted data, and use the trained parameters to calculate the baseline. (4) Tolerance calculation: using a double-sided wrapping line, the upper tolerance is the difference between the upper tolerance line and the baseline, and the lower tolerance is the difference between the baseline and the lower tolerance line. The value of the tolerance is obtained by analyzing the standard deviation of the sample data. Common methods include: directly using the maximum deviation of reasonable data as the tolerance as the probability calculation baseline method; taking k times the average standard deviation of reasonable data as the tolerance (the k value can be obtained through optimization training). (5) Calculate the expansion time point Tai. The horizontal axis value of the intersection of the 24-hour load curve of the next day generated by the baseline calculation and the expansion threshold line is the predicted expansion time point T1. Assuming that the expansion process takes time △T, then after calculation, the triggered expansion time point Tai = T1-△T. Tai can only be applied when the actual load curve is between the upper and lower tolerance lines. (II) Baseline update. When new load data is collected, on the one hand, its rationality is judged based on the trained baseline, and on the other hand, the data judged to be reasonable needs to be added to retrain the baseline.
[0048] In order to apply the prediction results of the above algorithm to the dynamic expansion and contraction of virtual machines (containers) to achieve the purpose of intelligent elastic scaling, the implementation also involves some devices, mainly including:
[0049] (1) Service load processing node (also known as service execution point, SEP for short). It generates equipment hardware performance data such as CPU usage and service performance data in units of seconds and calls CAPS to send it to the agent running on the operation maintenance module (OMM) to enter the performance database. After the CPU usage and CAPS are processed by functions, these load data will be used for machine learning.
[0050] (2) Judgment procedure. Based on the statistical model and mean standard deviation analysis technology, the data with relatively large deviation in the sample space (including historical load data) is cyclically eliminated. Each time a point is eliminated, the eliminated point satisfies the minimum standard deviation of the remaining points. The mean of each data point constitutes the initialization baseline, and the standard deviation of each data point multiplied by the coefficient K constitutes the tolerance package curve (equivalent to the above-mentioned predicted load curve). The coefficient K is obtained through simulator training. Figure 3 As shown in the figure, in order to obtain the expansion time point Tai, the average line of the upper and lower tolerance lines of the tolerance package curve is obtained as the predicted load line. The intersection of the predicted load line and the set expansion threshold is the initial judgment trigger expansion time T1. Assuming that the expansion process takes time △T, then after calculation, the final judgment trigger expansion time point Tai = T1-△T. Tai can only be applied when the actual load curve is between the upper and lower tolerance lines.
[0051] (3) Simulator. The coefficient K and the update weight a in the dynamic baseline algorithm are very important. The purpose of the simulator is to obtain these two parameters through MATLAB simulation algorithm simulation. It is mainly trained through historical data, and the coefficient K and the update weight a are adjusted manually in small increments. Then, a new dynamic baseline is generated with the new coefficient K and the update weight a.
[0052] For example, the learning process of K can be as follows, that is, select a predetermined set of historical load data, set the initial value of K to 1, multiply the standard deviation of the predetermined historical load data by a coefficient of 1, and obtain a predetermined predicted load curve; compare the predetermined predicted load curve with the actual predicted load curve corresponding to the predetermined predicted load curve to obtain an error value; when the error value does not fall within the predetermined range, correct the K value according to the error value, continue to execute the above steps, obtain a new error value, until the obtained error value falls within the predetermined range, and use the final corrected K as the new K.
[0053] For example, when it is necessary to add new load data to the historical load data set, the learning process for a can be as follows: multiply the latest load data obtained by a and put it into the predetermined historical load data set. Perform the above learning process on K based on the historical data set with the latest load data. When the error value obtained is no longer within the predetermined range, correct a and K at the same time according to the error value until the error value obtained falls within the predetermined range, and use the final corrected K and a as the new K and a. (4) Expansion scheduling unit (also known as elastic expansion and contraction unit, Elastic Scale Unit, referred to as ESU). Compare the real-time actual call load data with the predicted load. As long as the actual load curve is basically consistent with the predicted load curve, that is, at a certain time point, the actual load curve is between the upper and lower tolerance lines, then ESU starts to expand capacity at the final judgment time Tai output by the judgment program; otherwise, the actual load reaches the set expansion threshold value as the trigger condition. ESU also runs a scheduled task and training program. After all the data for the day is collected, the scheduled task is started to run the judgment program to update the baseline to ensure the accuracy of the judgment.
[0054] (5) OMM. An agent runs on the device to consolidate and organize the performance data reported by the SEP and write it into the database. It senses the newly added capacity devices and notifies Sipproxy to distribute the load to the newly added devices.
[0055] (6) Database. This is used to store the hardware performance data of each device, such as the CPU usage rate, and the service performance data, called CAPS. It also stores the load data obtained through function calculations and the average value of each SEP load data.
[0056] (7) Sipproxy. After the elastic expansion is successful, it receives the OMM's request to distribute the load to the newly expanded device and distributes the load to the newly online device.
[0057] It should be noted that the dynamic baseline machine learning algorithm process can be adopted as follows:
[0058] Step 1: Baseline Training
[0059] The baseline is divided into rest days and working days. Rest days need to be configured to restDate under config.ini. The baseline calculation uses the probability method, taking 80% of the data as valid data, that is, eliminating 20% of the data with relatively large deviations. The elimination method is: loop [20% * the total number of data of a certain point in the cycle] times, and eliminate one point each time. The eliminated point satisfies the minimum standard deviation of the remaining points (that is, the remaining points are more concentrated). The mean of each point data constitutes the initialization baseline, and the standard deviation of each point data multiplied by the coefficient K constitutes the initialization tolerance package curve.
[0060] Step 2: Parameter training
[0061] The coefficient K and the updated weight a are obtained through simulation of the MATLAB simulation algorithm (for example, K is about 4, and a is about 0.2). The change ratio of the actual data to the baseline ratio and the threshold of the data fluctuation change rate are mainly trained based on past data. For example, set the starting parameters to run the program, run all the forecast data for the next time period, and then calculate the error with the real data. The parameters are continuously increased (each time adding 0.1, etc.), and there will be another error. The simulation process will continue until the error falls within a specified interval. The parameter with the smallest error among all errors is the training result. The training of the coefficient K and the updated weight a is obtained using the two scenario data of rest days and working days.
[0062] Step 3: Baseline Update
[0063] The purpose of updating the baseline is to correct small changes in the data. When the collected data does not change much every day, but the accumulated changes will affect the anomaly detection judgment, real-time updating of the baseline is particularly necessary.
[0064] The purpose of updating the baseline is to adjust the daily baseline variation pattern to ensure the accuracy of anomaly detection. The updating method is to weight the non-abnormal data into the baseline by the coefficient a. Therefore, the amplitude value of the baseline has a great influence on the accuracy of the baseline update.
[0065] The baseline is updated after all the data for the day is collected. The ratio is adjusted by the ratio of the mean of the normal data for the day to the mean of the baseline at the corresponding time, and then the baseline is updated. When there is no data, the baseline is scaled by the same ratio to ensure the smoothness of the baseline.
[0066] To facilitate understanding of the above embodiment, the following is an example of a dynamic capacity expansion process based on a SIP cluster. The process is as follows:
[0067] Step 1: SEP reports performance data such as CPU and service CAPS to OMM in seconds, and OMM writes it to the database.
[0068] Step 2: The capacity expansion dispatch unit ESU compares the real-time actual call load data with the predicted load. As long as the actual load curve is basically consistent with the predicted load curve, that is, at a certain point in time, the actual load curve is between the upper and lower tolerance lines, the ESU will start capacity expansion at the final judgment time Tai output by the judgment program; otherwise, the actual load reaches the set expansion threshold value as the trigger condition for capacity expansion.
[0069] Step 3: ESU interacts with the virtual machine management platform to apply for the creation of a virtual machine, and the virtual machine management platform returns the expansion result response to ESU. When the virtual machine starts running, it runs an initialization shell called init to modify the parameters of SEP, and then starts SEP.
[0070] Step 4: When SEP is started for the first time, it sends a device online HTTP Rest notification to OMU (Operation and Maintenance Unit). OMU writes the online event of the SEP device into the database using Structured Query Language (SQL). OMM scans the database using a timer, detects that a new device is online in the cluster, reads the configuration specifications of the new device, and regenerates the cluster distribution strategy based on the weight matrix.
[0071] Step 5: OMM synchronizes the new cluster distribution strategy to Sipproxy in the form of file + MML instructions. After Sipproxy updates the cluster distribution strategy, it returns the synchronization result to OMM.
[0072] Step 6: Sipproxy distributes the load to the newly launched virtual machine (container).
[0073] The implementation of the technical solution is further described in detail below in conjunction with the accompanying drawings.
[0074] Figure 4It is a schematic diagram of a networking device according to an embodiment of the present invention, and its components are: Sippproxy (one or more), OMM (one), OMU (one), SEP (multiple) and database (one, which is co-located with OMM on one device), parameter training simulator (one), and expansion scheduling unit ESU (one, which has a judgment program and baseline timing update task). Sippproxy is connected to SEP through User Datagram Protocol (UDP) to transmit standard SIP messages; SEP and OMU, as well as OMM and Sipproxy are connected through HyperText Transfer Protocol (HTTP) (this protocol is based on Transmission Control Protocol TCP communication protocol); OMU, OMM, ESU and database are connected through database (Java Database Connectivity, JDBC); JDBC is a database connection standard based on TCP communication protocol widely used in the industry; OMM and SEP are connected through Java Management Extensions (JMX), which is a message transmission protocol based on TCP that is widely used in the industry.
[0075] Figure 5 is a preferred flow chart of the capacity expansion method according to an embodiment of the present invention, such as Figure 5 As shown, the main steps are as follows:
[0076] 1) Collect CPU and service CAPS data. SEP collects data and reports it to OMM and writes it into the database.
[0077] 2) Function operation, output load data as the sample space of machine learning data. The sample space is the load data of the past three months.
[0078] 3) Classify the sampled data into training data set and test data set.
[0079] 4) Use MatLab to train the coefficient K and parameter a. The coefficient K takes 1 as the initial value, and the parameter a takes 0 as the initial value. The coefficient K and parameter a are included in the training data set and calculated using the dynamic baseline algorithm. The results are compared with the test data set. If the error is large, the coefficient K and parameter a are slightly increased, and then calculated and compared. The coefficient K and parameter a are trained repeatedly in this way, and the coefficient K and parameter a with the smallest error are taken.
[0080] 5) Training baseline: Run the training program regularly every day. Generally, after the performance data collection of the day is completed, it starts at 00:15 the next day to output the predicted baseline (tolerance package line) and expansion time Tai.
[0081] 6) Compare the actual data with the predicted baseline data. If it is within the tolerance envelope, start expanding the capacity of the virtual machine (container) at the predicted time Tai.
[0082] 7) The virtual machine (container) is started after being scheduled by the OSE / OS virtual machine management platform, and the business system is deployed on the virtual machine (container). The device online event is sent to OMU, and OMU writes this event into the database. After OMM detects that the device is online, it sends a notification to Sipproxy to request recalculation of the weight of the virtual machine (container) cluster and distribute the load to the newly created virtual machine (container).
[0083] 8) Sipproxy distributes the load to the business system on the newly created virtual machine (container).
[0084] 9) Virtual machine expansion is completed.
[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0086] Example 2
[0087] In this embodiment, a capacity expansion device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0088] Figure 6 is a structural block diagram of a capacity expansion device according to an embodiment of the present invention. Figure 6 As shown, the device comprises:
[0089] A first acquisition module 62, used to acquire a predicted load curve according to historical load data;
[0090] A second acquisition module 64, connected to the first acquisition module 62, for acquiring a capacity expansion time point according to a predicted load curve;
[0091] The starting module 66 is connected to the second obtaining module 64 and is used to start the capacity expansion at the capacity expansion time point.
[0092] Optionally, the first acquisition module 62 is also used to input historical load data as predetermined historical load data into a predetermined model, process the historical load data using the predetermined model, and obtain a predetermined prediction load curve as a prediction load curve, wherein the predetermined model is trained through machine learning using multiple sets of data, and each set of data in the multiple sets of data includes: predetermined historical load data, and a predetermined prediction load curve.
[0093] Optionally, the second acquisition module 64 is further used to obtain an average predicted load curve based on an upper tolerance curve and a lower tolerance curve included in the predicted load curve; obtain a first capacity expansion time point based on the average predicted load curve and a predetermined threshold value; and obtain a capacity expansion time point based on the first capacity expansion time point and the time required for capacity expansion.
[0094] Optionally, the starting module 66 is also used to start capacity expansion at the capacity expansion time point when it is detected that the second actual load curve corresponding to the predicted load curve conforms to a predetermined relationship with the predicted load curve; when it is detected that the second actual load curve does not conform to a predetermined relationship with the predicted load curve; and when the actual load reaches a capacity expansion threshold value, start capacity expansion.
[0095] Optionally, the predetermined relationship includes: the actual load curve is between the upper tolerance curve and the lower tolerance curve.
[0096] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0097] Example 3
[0098] An embodiment of the present invention further provides a storage medium, which includes a stored program, wherein when the program is run, any of the above methods is executed.
[0099] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0100] S1, obtain the predicted load curve based on historical load data;
[0101] S2, obtaining the capacity expansion time point according to the predicted load curve;
[0102] S3, starts capacity expansion at the capacity expansion time point.
[0103] Optionally, the storage medium is further configured to store program codes for executing the following steps: obtaining a predicted load curve according to historical load data comprises:
[0104] S4, inputting the historical load data as the predetermined historical load data into the predetermined model, using the predetermined model to process the historical load data, and obtaining a predetermined prediction load curve as the prediction load curve, wherein the predetermined model is obtained through machine learning using multiple sets of data, and each set of data in the multiple sets of data includes: predetermined historical load data, and a predetermined prediction load curve.
[0105] Optionally, the storage medium is further configured to store program codes for executing the following steps: obtaining a capacity expansion time point according to a predicted load curve includes:
[0106] S5, obtaining an average predicted load curve according to an upper tolerance curve and a lower tolerance curve included in the predicted load curve;
[0107] S6, obtaining a first capacity expansion time point according to the average predicted load curve and a predetermined threshold value;
[0108] S7: Obtain a capacity expansion time point according to the first capacity expansion time point and the time required for capacity expansion.
[0109] Optionally, the storage medium is further configured to store program codes for executing the following steps:
[0110] S8, when it is detected that the second actual load curve corresponding to the predicted load curve meets a predetermined relationship with the predicted load curve, starting capacity expansion at the capacity expansion time point;
[0111] S10, detecting that the actual load curve and the predicted load curve do not conform to a predetermined relationship, and starting capacity expansion when the actual load reaches a capacity expansion threshold.
[0112] Optionally, the storage medium is further configured to store program codes for executing the following steps:
[0113] S8, the predetermined relationship includes: the actual load curve is between the upper tolerance curve and the lower tolerance curve.
[0114] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0115] An embodiment of the present invention further provides a processor, which is used to run a program, wherein the program executes the steps in any of the above methods when running.
[0116] Optionally, in this embodiment, the above program is used to perform the following steps:
[0117] S1, obtain the predicted load curve based on historical load data;
[0118] S2, obtaining the capacity expansion time point according to the predicted load curve;
[0119] S3, starts capacity expansion at the capacity expansion time point.
[0120] Optionally, in this embodiment, the above program is used to perform the following steps: obtaining a predicted load curve according to historical load data includes:
[0121] S4, inputting the historical load data as the predetermined historical load data into the predetermined model, using the predetermined model to process the historical load data, and obtaining a predetermined prediction load curve as the prediction load curve, wherein the predetermined model is obtained through machine learning using multiple sets of data, and each set of data in the multiple sets of data includes: predetermined historical load data, and a predetermined prediction load curve.
[0122] Optionally, in this embodiment, the above program is used to perform the following steps: obtaining the capacity expansion time point according to the predicted load curve includes:
[0123] S5, obtaining an average predicted load curve according to an upper tolerance curve and a lower tolerance curve included in the predicted load curve;
[0124] S6, obtaining a first capacity expansion time point according to the average predicted load curve and a predetermined threshold value;
[0125] S7: Obtain a capacity expansion time point according to the first capacity expansion time point and the time required for capacity expansion.
[0126] Optionally, in this embodiment, the above program is used to perform the following steps:
[0127] S8, when it is detected that the second actual load curve corresponding to the predicted load curve meets a predetermined relationship with the predicted load curve, starting capacity expansion at the capacity expansion time point;
[0128] S10, detecting that the actual load curve and the predicted load curve do not conform to a predetermined relationship, and starting capacity expansion when the actual load reaches a capacity expansion threshold.
[0129] Optionally, in this embodiment, the above program is used to perform the following steps:
[0130] S8, the predetermined relationship includes: the actual load curve is between the upper tolerance curve and the lower tolerance curve.
[0131] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0132] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0133] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A capacity expansion method, characterized in that: include: Obtain forecast load curve based on historical load data; Obtaining a capacity expansion time point according to the predicted load curve; Initiate capacity expansion at the capacity expansion time point; Wherein, obtaining the expansion time point according to the predicted load curve includes: obtaining an average predicted load curve according to an upper tolerance curve and a lower tolerance curve included in the predicted load curve; obtaining a first expansion time point according to the average predicted load curve and a predetermined threshold value; obtaining the expansion time point according to the first expansion time point and the time required for expansion; Initiating capacity expansion at the capacity expansion time point includes: when it is detected that a second actual load curve corresponding to the predicted load curve meets a predetermined relationship with the predicted load curve, initiating capacity expansion at the capacity expansion time point; when it is detected that the second actual load curve does not meet the predetermined relationship with the predicted load curve, initiating capacity expansion when the actual load reaches a capacity expansion threshold value; Wherein, the predetermined relationship includes: the second actual load curve is between the upper tolerance curve and the lower tolerance curve.
2. The method according to claim 1, characterized in that Acquiring the predicted load curve according to the historical load data includes: inputting the historical load data as predetermined historical load data into a predetermined model, processing the historical load data using the predetermined model, and obtaining a predetermined forecast load curve as the forecast load curve, Wherein, the predetermined model is obtained through machine learning using multiple sets of data, and each set of data in the multiple sets of data includes: the predetermined historical load data and the predetermined predicted load curve.
3. The method according to claim 2, characterized in that Using the predetermined model to process the historical load data includes: cyclically deleting the value with the smallest standard deviation in the historical load data until N values are deleted, wherein N is a positive integer; Obtaining the standard deviation of each value in the deleted historical load data; The standard deviation is processed using the predetermined model.
4. The method according to claim 2 or 3, characterized in that: The predetermined model includes predetermined coefficients obtained through machine learning using multiple sets of data.
5. The method according to claim 4, characterized in that The predetermined coefficient is obtained in the following manner: Setting an initial value of the predetermined coefficient; Processing the predetermined historical load data using the initial value to obtain the predetermined predicted load curve; Obtaining an error value according to the predetermined predicted load curve and an actual predicted load curve corresponding to the predetermined predicted load curve; when the error value does not fall within a predetermined error range, correcting the initial value, and obtaining the error value again until the error value falls within the predetermined error range; The corrected initial value is used as the predetermined coefficient.
6. The method according to claim 1 or 2, characterized in that: Before obtaining the predicted load curve according to the historical load data, the method further includes: The historical load data is updated.
7. An elastic expansion unit ESU, characterized in that: include: A first acquisition module is used to acquire a predicted load curve according to historical load data; A second acquisition module is used to acquire a capacity expansion time point according to the predicted load curve; A startup module, used to start the capacity expansion at the said capacity expansion time point; The first acquisition module is used to acquire a predicted load curve according to historical load data, including: the first acquisition module is used to acquire an average predicted load curve according to an upper tolerance curve and a lower tolerance curve included in the predicted load curve; acquire a first capacity expansion time point according to the average predicted load curve and a predetermined threshold value; acquire the capacity expansion time point according to the first capacity expansion time point and the time required for capacity expansion; The start-up module is used to start the capacity expansion at the capacity expansion time point, including: the start-up module is used to start the capacity expansion at the capacity expansion time point when it is detected that the second actual load curve corresponding to the predicted load curve meets the predetermined relationship with the predicted load curve; when it is detected that the second actual load curve does not meet the predetermined relationship with the predicted load curve, start the capacity expansion when the actual load reaches the capacity expansion threshold value; Wherein, the predetermined relationship includes: the second actual load curve is between the upper tolerance curve and the lower tolerance curve.
8. A storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 3 or 5 when executed.
9. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 3 or 5 when running.
Citation Information
Patent Citations
Short-term power load forecasting method based on particle swarm and BP neural network
CN103729695A
Automatic method and device for expanding file systems automatically
CN105786985A