Automatic capacity expansion and reduction method and system for live broadcast system

文档序号:107623 发布日期:2021-10-15 浏览:16次 中文

阅读说明:本技术 一种直播系统自动扩缩容方法及系统 (Automatic capacity expansion and reduction method and system for live broadcast system ) 是由 沙晓强 于 2021-06-30 设计创作,主要内容包括:本发明实施例提供一种直播系统自动扩缩容方法及系统,包括:确定直播系统的检测指标以及检测指标值,所述检测指标包括CPU负载或峰值在线人数PCU;根据检测指标值判断该直播系统是否需要扩缩容,当检测指标值满足扩缩容条件时,采用根据经验累积数据得到的容量拟合公式确定该直播系统扩缩容的服务器数量;所述经验积累数据是指历史时间段内每次扩缩容时所采用的检测指标值,在所述历史时间段内当检测指标值满足扩缩容条件时,采用线性扩缩容方式确定该直播系统扩缩容的服务器数量;根据确定的服务器数量进行相应的扩容或缩容操作。采用对历史经验累计数据与扩缩容数据进行拟合的容量拟合公式进行扩缩容,使自动扩缩容更符合真实情况。(The embodiment of the invention provides a method and a system for automatically expanding and contracting a volume of a live broadcast system, wherein the method comprises the following steps: determining a detection index and a detection index value of a live broadcast system, wherein the detection index comprises a CPU load or a peak online number PCU; judging whether the live broadcast system needs to expand or contract the capacity according to the detection index value, and when the detection index value meets the expansion and contraction capacity condition, determining the number of servers of the expansion and contraction capacity of the live broadcast system by adopting a capacity fitting formula obtained by accumulating data according to experience; the experience accumulation data refers to detection index values adopted in each expansion and contraction of the live broadcast system in a historical time period, and when the detection index values meet expansion and contraction conditions in the historical time period, the number of servers for expanding and contracting the live broadcast system is determined in a linear expansion and contraction mode; and carrying out corresponding capacity expansion or capacity reduction operation according to the determined number of the servers. And carrying out capacity expansion and contraction by adopting a capacity fitting formula for fitting the historical experience accumulated data and the capacity expansion and contraction data, so that the automatic capacity expansion and contraction is more in line with the real situation.)

1. An automatic capacity expansion and reduction method for a live broadcast system is characterized by comprising the following steps:

determining a detection index of a live broadcast system, and acquiring a detection index value of the live broadcast system, wherein the detection index comprises a CPU (Central processing Unit) load or a peak online number PCU (personal computer control unit);

judging whether the live broadcast system needs to expand or contract the capacity according to the detection index value, and when the detection index value meets the expansion and contraction capacity condition, determining the number of servers of the expansion and contraction capacity of the live broadcast system by adopting a capacity fitting formula obtained by accumulating data according to experience; the experience accumulation data refers to detection index values adopted in each expansion and contraction of the live broadcast system in a historical time period, and when the detection index values meet expansion and contraction conditions in the historical time period, the number of servers for expanding and contracting the live broadcast system is determined in a linear expansion and contraction mode;

and carrying out corresponding capacity expansion or capacity reduction operation according to the determined number of the servers.

2. The method as claimed in claim 1, further comprising, before determining whether the live system needs to expand or contract according to the detection index value:

and performing mean filtering on the acquired detection index values by adopting a low-pass filtering algorithm, removing noise in the index data, and obtaining purified detection index values, wherein the purified detection index values are used for judging whether the direct broadcasting system needs to expand or contract.

3. The method according to claim 2, wherein when the detected index value satisfies the scaling condition in the historical time period, the number of servers for scaling the live broadcast system is determined in a linear scaling manner, and specifically includes:

when any purified detection index value of the live broadcast system reaches a corresponding expansion triggering threshold value, determining the number of servers of the live broadcast system expanded at the time by adopting a linear expansion mode according to the purified detection index value, and expanding the capacity of the live broadcast system according to the number of the servers expanded at the time; and

after the live broadcast system is subjected to capacity expansion, when all purification detection index values of the live broadcast system are smaller than respective corresponding dynamic capacity reduction threshold values, respectively calculating corresponding capacity reduction results of the live broadcast system by adopting a linear capacity reduction mode according to all the purified detection index values, taking the minimum value of the number of capacity reduction servers in each capacity reduction result as the number of the final capacity reduction servers at the time, and performing capacity reduction on the live broadcast system according to the number of the final capacity reduction servers at the time; and for the same detection index, the capacity expansion triggering threshold value is larger than the dynamic capacity reduction threshold value.

4. The method for automatically expanding and contracting the capacity of the live broadcast system as claimed in claim 3, wherein the method for obtaining the capacity fitting formula according to the empirical accumulated data specifically comprises:

setting a least square formula for each detection index, substituting the data of the detection index in the experience accumulated data and the corresponding quantity of capacity expansion servers or the corresponding quantity of final capacity reduction servers into the least square formula to perform first fitting to form a statically indeterminate equation set; vectorizing the hyperstatic equation set, wherein the vectorized hyperstatic equation set has unknown vector coefficients; forming a residual square sum formula by vectorizing a hyperstatic equation set and corresponding volume expansion and reduction data, obtaining an unknown vector coefficient value when the residual square sum formula value is minimum, and substituting the unknown vector coefficient value into the hyperstatic equation set to obtain a primary fitting formula; substituting the data of the detection index in all the experience accumulated data and the corresponding quantity of the capacity expansion servers or the corresponding quantity of the final capacity reduction servers into a primary fitting formula for iteration to obtain a secondary fitting formula; and taking a fitting formula after iteration for a preset number of times as a capacity fitting formula of the detection index, wherein the expansion and contraction capacity data refers to the quantity of expansion servers or the quantity of final contraction servers determined by a linear expansion and contraction capacity mode.

5. The method as claimed in claim 3, wherein the method for automatically expanding and contracting the live system is characterized in that whether the live system needs to expand and contract the capacity is determined according to the detection index value, and when the detection index value meets the expansion and contraction condition, the number of servers of the expansion and contraction capacity of the live system is determined by using a capacity fitting formula obtained by accumulating data according to experience, and the method specifically comprises the following steps:

and when any purified detection index value of the live broadcast system reaches a corresponding expansion triggering threshold value, obtaining the number of servers of the live broadcast system in the current expansion according to a capacity fitting formula of the detection index.

After the live broadcast system is subjected to capacity expansion, when all purification detection index values of the live broadcast system are smaller than respective corresponding dynamic capacity reduction threshold values, the number of corresponding capacity reduction servers is obtained according to a capacity fitting formula of all detection indexes, and the minimum value of the number of the capacity reduction servers is used as the number of the final capacity reduction servers of the live broadcast system.

6. The utility model provides a live system automatic expand the shrinkage capacity system which characterized in that includes:

the index detection unit is used for determining a detection index of the live broadcast system and acquiring a detection index value of the live broadcast system, wherein the detection index comprises a CPU (Central processing Unit) load or a peak online number PCU (personal computer control unit);

the expansion and contraction capacity determining unit is used for judging whether the live broadcast system needs expansion and contraction capacity according to the detection index value, and when the detection index value meets the expansion and contraction capacity condition, the number of servers of the expansion and contraction capacity of the live broadcast system is determined by adopting a capacity fitting formula obtained by accumulating data according to experience; the experience accumulation data refers to detection index values adopted in each expansion and contraction of the live broadcast system in a historical time period, and when the detection index values meet expansion and contraction conditions in the historical time period, the number of servers for expanding and contracting the live broadcast system is determined in a linear expansion and contraction mode;

and the capacity expansion and reduction unit is used for carrying out corresponding capacity expansion or capacity reduction operation according to the determined number of the servers.

7. A live system automatic capacity expansion and reduction system according to claim 6, further comprising:

and the denoising unit is used for performing mean filtering on the detection index values acquired by the index detection unit by adopting a low-pass filtering algorithm, removing noise in the index data to obtain purified detection index values and sending the purified detection index values to the expansion and contraction capacity determination unit, so that the expansion and contraction capacity determination unit can judge whether the live broadcast system needs expansion and contraction capacity according to the purified detection index values.

8. A live system automatic capacity expansion and reduction system according to claim 7, further comprising:

the linear capacity expansion unit is used for determining the number of servers of the live broadcast system in the current capacity expansion mode according to any purified detection index value when the detection index value of the live broadcast system reaches a corresponding capacity expansion trigger threshold value in a historical time period, and performing capacity expansion on the live broadcast system according to the number of the servers in the current capacity expansion;

the linear capacity reduction unit is used for respectively calculating each capacity reduction result corresponding to the live broadcast system in a linear capacity reduction mode according to each purified detection index value after the live broadcast system is subjected to capacity expansion in a historical time period and when each purified detection index value of the live broadcast system is smaller than a corresponding dynamic capacity reduction threshold value, taking the minimum value of the number of capacity reduction servers in each capacity reduction result as the number of the servers subjected to the final capacity reduction at the time, and performing capacity reduction on the live broadcast system according to the number of the servers subjected to the final capacity reduction at the time; and for the same detection index, the capacity expansion triggering threshold value is larger than the dynamic capacity reduction threshold value.

9. A live system automatic expansion and contraction system according to claim 8, further comprising:

the fitting unit is used for setting a least square formula aiming at each detection index in a historical time period, and substituting the data of the detection index in the experience accumulated data and the corresponding quantity of capacity expansion servers or the corresponding quantity of final capacity reduction servers into the least square formula to perform first fitting to form a statically indeterminate equation set; vectorizing the hyperstatic equation set, wherein the vectorized hyperstatic equation set has unknown vector coefficients; forming a residual square sum formula by vectorizing a hyperstatic equation set and corresponding volume expansion and reduction data, obtaining an unknown vector coefficient value when the residual square sum formula value is minimum, and substituting the unknown vector coefficient value into the hyperstatic equation set to obtain a primary fitting formula; substituting the data of the detection index in all the experience accumulated data and the corresponding quantity of the capacity expansion servers or the corresponding quantity of the final capacity reduction servers into a primary fitting formula for iteration to obtain a secondary fitting formula; and taking a fitting formula after iteration for a preset number of times as a capacity fitting formula of the detection index, wherein the expansion and contraction capacity data refers to the quantity of expansion servers or the quantity of final contraction servers determined by a linear expansion and contraction capacity mode.

10. The live system automatic expansion and reduction system according to claim 8, wherein the expansion and reduction determining unit comprises:

the nonlinear capacity expansion subunit is used for obtaining the number of servers of the live broadcast system in the current capacity expansion according to a capacity fitting formula of the detection index when any purified detection index value of the live broadcast system reaches a corresponding capacity expansion triggering threshold value;

and the nonlinear capacity reduction subunit is used for obtaining the number of the corresponding capacity reduction servers according to a capacity fitting formula of each detection index when each purification detection index value of the live broadcast system is smaller than a corresponding dynamic capacity reduction threshold value after the live broadcast system is subjected to capacity expansion, and taking the minimum value of the number of the capacity reduction servers as the number of the final capacity reduction servers of the live broadcast system.

Technical Field

The invention relates to the field of automatic capacity expansion and reduction, in particular to a method and a system for automatic capacity expansion and reduction of a live broadcast system.

Background

In recent years, the rapid development of the live broadcast industry, the live broadcast volume and the online user watching volume are rapidly increased, and live broadcast shopping is deeply reached to the life of everyone, so that the live broadcast shopping becomes a new life style. Certainly, the high-speed development of the live broadcast industry provides higher challenges for internet enterprises, and the enterprises face the problems of overlarge server system pressure and overhigh server purchasing cost, so that the enterprises can automatically and quickly expand the capacity during live broadcast peak, and simultaneously expand the suitable number of servers to reduce the cost.

The common way to scale the system is: and (4) detecting the pressure of the service system by operation and maintenance personnel of the enterprise, and then initiating expansion according to the experience value. The detection indexes during general capacity expansion comprise CPU load, interface QPS, interface RT and the like, and when the detection indexes reach a threshold value, capacity expansion of a certain data server is carried out according to daily experience evaluation; and when the detection index reaches a safety threshold value, the operation and maintenance personnel perform server capacity reduction. The main flow of capacity expansion comprises main parts of server purchase, service deployment, flow rate uploading and the like, and the main flow of capacity reduction comprises main parts of flow rate downloading, service stopping, server releasing and the like. The number of servers of the expansion capacity is mainly determined according to historical experience values.

In the process of implementing the invention, the applicant finds that at least the following problems exist in the prior art:

at present, a common capacity expansion and reduction scheme needs to predict the number of servers needing capacity expansion by depending on experience or simple linear deduction, and the capacity expansion and reduction are mostly carried out by depending on manual judgment and manual operation in real time. In fact, the live broadcast industry has a large flow rate and a frequent arrival, so that a large amount of capacity expansion and contraction needs exist every day, and a large amount of labor cost is consumed for operation. Meanwhile, due to the manual judgment, the expansion and contraction quantity is not accurate, and the expansion quantity is too much or too little, so that the service capability of the system is insufficient or the cost is wasted.

Disclosure of Invention

The embodiment of the invention provides an automatic capacity expansion and reduction method and system for a live broadcast system.

To achieve the above object, in one aspect, an embodiment of the present invention provides an automatic volume expansion and reduction method for a live broadcast system, including:

determining a detection index of a live broadcast system, and acquiring a detection index value of the live broadcast system, wherein the detection index comprises a CPU (Central processing Unit) load or a peak online number PCU (personal computer control unit);

judging whether the live broadcast system needs to expand or contract the capacity according to the detection index value, and when the detection index value meets the expansion and contraction capacity condition, determining the number of servers of the expansion and contraction capacity of the live broadcast system by adopting a capacity fitting formula obtained by accumulating data according to experience; the experience accumulation data refers to detection index values adopted in each expansion and contraction of the live broadcast system in a historical time period, and when the detection index values meet expansion and contraction conditions in the historical time period, the number of servers for expanding and contracting the live broadcast system is determined in a linear expansion and contraction mode;

and carrying out corresponding capacity expansion or capacity reduction operation according to the determined number of the servers.

On the other hand, an embodiment of the present invention provides an automatic volume expansion and reduction system for a live broadcast system, including:

the index detection unit is used for determining a detection index of the live broadcast system and acquiring a detection index value of the live broadcast system, wherein the detection index comprises a CPU (Central processing Unit) load or a peak online number PCU (personal computer control unit);

the expansion and contraction capacity determining unit is used for judging whether the live broadcast system needs expansion and contraction capacity according to the detection index value, and when the detection index value meets the expansion and contraction capacity condition, the number of servers of the expansion and contraction capacity of the live broadcast system is determined by adopting a capacity fitting formula obtained by accumulating data according to experience; the experience accumulation data refers to detection index values adopted in each expansion and contraction of the live broadcast system in a historical time period, and when the detection index values meet expansion and contraction conditions in the historical time period, the number of servers for expanding and contracting the live broadcast system is determined in a linear expansion and contraction mode;

and the capacity expansion and reduction unit is used for carrying out corresponding capacity expansion or capacity reduction operation according to the determined number of the servers.

The technical scheme has the following beneficial effects: and carrying out capacity expansion and contraction by adopting a capacity fitting formula for fitting the historical experience accumulated data and the capacity expansion and contraction data, so that the automatic capacity expansion and contraction is more in line with the real situation.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.

Fig. 1 is a flowchart of an automatic volume expansion and reduction method for a live broadcast system according to an embodiment of the present invention;

fig. 2 is a structural diagram of an automatic volume expansion and reduction system of a live broadcast system according to an embodiment of the present invention;

FIG. 3 is a graph comparing the pre-and post-filtering effects of an embodiment of the invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

As shown in fig. 1, in combination with the embodiment of the present invention, an automatic volume expansion and reduction method for a live broadcast system is provided, which includes:

s101: determining a detection index of a live broadcast system, and acquiring a detection index value of the live broadcast system, wherein the detection index comprises a CPU (Central processing Unit) load or a peak online number PCU (personal computer control unit);

s102: judging whether the live broadcast system needs to expand or contract the capacity according to the detection index value, and when the detection index value meets the expansion and contraction capacity condition, determining the number of servers of the expansion and contraction capacity of the live broadcast system by adopting a capacity fitting formula obtained by accumulating data according to experience; the experience accumulation data refers to detection index values adopted in each expansion and contraction of the live broadcast system in a historical time period, and when the detection index values meet expansion and contraction conditions in the historical time period, the number of servers for expanding and contracting the live broadcast system is determined in a linear expansion and contraction mode;

s103: and carrying out corresponding capacity expansion or capacity reduction operation according to the determined number of the servers.

Preferably, before the determining whether the live broadcast system needs to expand or contract the volume according to the detection index value, the method further includes:

s104: and performing mean filtering on the acquired detection index values by adopting a low-pass filtering algorithm, removing noise in the index data, and obtaining purified detection index values, wherein the purified detection index values are used for judging whether the direct broadcasting system needs to expand or contract.

Preferably, in step 102, when the detection index value meets the scaling condition in the historical time period, determining the number of servers of the scaling of the live broadcast system by using a linear scaling mode specifically includes:

s105: when any purified detection index value of the live broadcast system reaches a corresponding expansion triggering threshold value, determining the number of servers of the live broadcast system expanded at the time by adopting a linear expansion mode according to the purified detection index value, and expanding the capacity of the live broadcast system according to the number of the servers expanded at the time; and

s106: after the live broadcast system is subjected to capacity expansion, when all purification detection index values of the live broadcast system are smaller than respective corresponding dynamic capacity reduction threshold values, respectively calculating corresponding capacity reduction results of the live broadcast system by adopting a linear capacity reduction mode according to all the purified detection index values, taking the minimum value of the number of capacity reduction servers in each capacity reduction result as the number of the final capacity reduction servers at the time, and performing capacity reduction on the live broadcast system according to the number of the final capacity reduction servers at the time; and for the same detection index, the capacity expansion triggering threshold value is larger than the dynamic capacity reduction threshold value.

Preferably, in step 102, the method for obtaining the capacity fitting formula according to the empirically accumulated data specifically includes:

setting a least square formula for each detection index, substituting the data of the detection index in the experience accumulated data and the corresponding quantity of capacity expansion servers or the corresponding quantity of final capacity reduction servers into the least square formula to perform first fitting to form a statically indeterminate equation set; vectorizing the hyperstatic equation set, wherein the vectorized hyperstatic equation set has unknown vector coefficients; forming a residual square sum formula by vectorizing a hyperstatic equation set and corresponding volume expansion and reduction data, obtaining an unknown vector coefficient value when the residual square sum formula value is minimum, and substituting the unknown vector coefficient value into the hyperstatic equation set to obtain a primary fitting formula; substituting the data of the detection index in all the experience accumulated data and the corresponding quantity of the capacity expansion servers or the corresponding quantity of the final capacity reduction servers into a primary fitting formula for iteration to obtain a secondary fitting formula; and taking a fitting formula after iteration for a preset number of times as a capacity fitting formula of the detection index, wherein the expansion and contraction capacity data refers to the quantity of expansion servers or the quantity of final contraction servers determined by a linear expansion and contraction capacity mode.

Preferably, step 102 specifically includes:

s1021: and when any purified detection index value of the live broadcast system reaches a corresponding expansion triggering threshold value, obtaining the number of servers of the live broadcast system in the current expansion according to a capacity fitting formula of the detection index.

S1022: after the live broadcast system is subjected to capacity expansion, when all purification detection index values of the live broadcast system are smaller than respective corresponding dynamic capacity reduction threshold values, the number of corresponding capacity reduction servers is obtained according to a capacity fitting formula of all detection indexes, and the minimum value of the number of the capacity reduction servers is used as the number of the final capacity reduction servers of the live broadcast system.

As shown in fig. 2, in combination with the embodiment of the present invention, an automatic capacity expansion and reduction system for a live broadcast system is provided, which includes:

the index detection unit 21 is configured to determine a detection index of the live broadcast system, and acquire a detection index value of the live broadcast system, where the detection index includes a CPU load or a peak online number PCU;

the expansion and contraction capacity determining unit 22 is configured to determine whether the live broadcast system needs expansion and contraction capacity according to the detection index value, and when the detection index value meets an expansion and contraction capacity condition, determine the number of servers of the expansion and contraction capacity of the live broadcast system by using a capacity fitting formula obtained by accumulating data according to experience; the experience accumulation data refers to detection index values adopted in each expansion and contraction of the live broadcast system in a historical time period, and when the detection index values meet expansion and contraction conditions in the historical time period, the number of servers for expanding and contracting the live broadcast system is determined in a linear expansion and contraction mode;

and the capacity expansion and reduction unit 23 is configured to perform corresponding capacity expansion or capacity reduction operations according to the determined number of servers.

Preferably, the method further comprises the following steps:

and the denoising unit 24 is configured to perform mean filtering on the detection index values acquired by the index detection unit by using a low-pass filtering algorithm, remove noise in the index data, obtain purified detection index values, and send the purified detection index values to the scaling capacity determination unit, so that the scaling capacity determination unit determines whether the live broadcast system needs scaling according to the purified detection index values.

Preferably, the method further comprises the following steps:

a linear expansion unit 25, configured to determine, in a historical time period, the number of servers of the live broadcast system that are expanded this time by using a linear expansion manner according to any one of the purified detection index values when the purified detection index value of the live broadcast system reaches a corresponding expansion trigger threshold, and expand the capacity of the live broadcast system according to the number of servers that are expanded this time;

a linear capacity reduction unit 26, configured to, after capacity expansion of the live broadcast system is performed in a historical time period, when each purified detection index value of the live broadcast system is smaller than a corresponding dynamic capacity reduction threshold value, respectively calculate each capacity reduction result corresponding to the live broadcast system in a linear capacity reduction manner according to each purified detection index value, use a minimum value of the number of capacity reduction servers in each capacity reduction result as the number of servers of the final capacity reduction at this time, and perform capacity reduction on the live broadcast system according to the number of servers of the final capacity reduction at this time; and for the same detection index, the capacity expansion triggering threshold value is larger than the dynamic capacity reduction threshold value.

Preferably, the method further comprises the following steps:

the fitting unit 27 is configured to set a least square formula for each detection index in the historical time period, and substitute data of the detection index in the accumulated empirical data and the corresponding number of capacity expansion servers or the corresponding number of final capacity reduction servers into the least square formula to perform first fitting to form a hyperstatic equation set; vectorizing the hyperstatic equation set, wherein the vectorized hyperstatic equation set has unknown vector coefficients; forming a residual square sum formula by vectorizing a hyperstatic equation set and corresponding volume expansion and reduction data, obtaining an unknown vector coefficient value when the residual square sum formula value is minimum, and substituting the unknown vector coefficient value into the hyperstatic equation set to obtain a primary fitting formula; substituting the data of the detection index in all the experience accumulated data and the corresponding quantity of the capacity expansion servers or the corresponding quantity of the final capacity reduction servers into a primary fitting formula for iteration to obtain a secondary fitting formula; and taking a fitting formula after iteration for a preset number of times as a capacity fitting formula of the detection index, wherein the expansion and contraction capacity data refers to the quantity of expansion servers or the quantity of final contraction servers determined by a linear expansion and contraction capacity mode.

Preferably, the expansion/contraction capacity determination unit 22 includes:

a nonlinear capacity expansion subunit 221, configured to, when any purified detection index value of the live broadcast system reaches a corresponding capacity expansion trigger threshold, obtain, according to a capacity fitting formula of the detection index, the number of servers of the live broadcast system in the current capacity expansion according to the capacity fitting formula of the detection index;

and a nonlinear capacity reduction subunit 222, configured to, after capacity expansion is performed on the live broadcast system, obtain, according to a capacity fitting formula of each detection index, a number of servers of a corresponding capacity reduction when each purification detection index value of the live broadcast system is smaller than a corresponding dynamic capacity reduction threshold, and use a minimum value of the number of servers of each capacity reduction as the number of servers of the final capacity reduction of the live broadcast system this time.

The beneficial effects obtained by the invention are as follows:

compared with the traditional capacity expansion and reduction technology, the method has the advantages that the capacity expansion and reduction quantity is obtained through three steps of index detection, linear capacity expansion experience accumulation and statistical data fitting, historical capacity expansion data and evaluation are fully utilized, the capacity expansion quantity with the minimum variance is obtained, the service condition is reflected more truly, and the capacity expansion service capacity and the capacity expansion cost are guaranteed.

The above technical solutions of the embodiments of the present invention are described in detail below with reference to specific application examples, and reference may be made to the foregoing related descriptions for technical details that are not described in the implementation process.

The invention is a system automatic expansion and contraction technology used for live broadcast, which is used for the automatic expansion and contraction technology of live broadcast, on one hand, the quantity of expansion and contraction is statistically calculated, and the quantity of servers needing expansion is estimated; and on the other hand, the expansion and contraction capacity flow is automatically designed. The patent analyzes the statistical rule between the detection threshold and the expansion and contraction capacity quantity, and combines data fitting to obtain the optimal expansion and contraction capacity quantity. The method improves the automation speed of the expansion and shrinkage capacity and the expansion and shrinkage capacity precision, and can meet the actual application requirements. The method mainly comprises the following steps:

step 1: building index detection system

The detection indexes of the live broadcast system are determined, and the detection index values of the live broadcast system are collected. The CPU can directly reflect the real-time condition of the server, and the zabbix is adopted as a CPU load acquisition tool to acquire the CPU loads of all the servers; the PCU is obtained by counting the user amount in the live broadcast room in real time as a specific attribute of the live broadcast service. Because the collected data (CPU) has high-frequency noise interference, a low-pass filtering algorithm is adopted for mean filtering to remove the noise of data collection (the high-frequency interference of the CPU is physically determined by the server and mainly aims at taking out interference burrs), and the filtering formula is as follows:

F[m]=F[m-1]+K*(P[m]-F[m-1])

wherein m is the mth sampling point, P is the sampling data, F is the filtered value, and K is the filter coefficient, and the effect after filtering the index is shown in fig. 3. That is, the low-pass filtering algorithm is adopted to perform mean filtering on the acquired detection index values, noise in the index data is removed, and a purified detection index value is obtained, and the purified detection index value is used for judging whether the live broadcast system needs to be expanded or contracted.

By acquiring indexes in real time and filtering, the system state which can reflect the actual situation in real time can be obtained, so that a decision basis is made for capacity expansion.

Step 2: capacity expansion quantity index decision service

In a live broadcast system, some services are relatively sensitive, and are more urgent when more servers are needed, for example, in a live broadcast push system, in order to send push to a user as soon as possible, the user can arrive at a live broadcast room as soon as possible, so that the push capability needs to be improved in a shorter time, and after push sending is completed, online services can be maintained by few servers.

Judging whether the live broadcast system needs to expand or contract the capacity according to the detection index value, and when the detection index value meets the expansion and contraction capacity condition, determining the number of servers of the expansion and contraction capacity of the live broadcast system by adopting a capacity fitting formula obtained by accumulating data according to experience; the experience accumulation data refers to detection index values adopted in each expansion and contraction of the live broadcast system in a historical time period, and when the detection index values meet expansion and contraction conditions in the historical time period, the number of servers of the expansion and contraction of the live broadcast system is determined in a linear expansion and contraction mode.

Step 2.1 experience accumulation by linear expansion.

When the decision system starts, the number of servers which are most suitable for expansion and contraction is not known empirically, so that the expansion effect (utilization rate) is accumulated empirically by adopting a linear expansion and contraction mode. Specifically, when any purified detection index value of the live broadcast system reaches a corresponding expansion triggering threshold value, the number of servers of the live broadcast system expanded at this time is determined in a linear expansion mode according to the purified detection index value, and the live broadcast system is expanded according to the number of servers expanded at this time. Meanwhile, the quality evaluation is carried out on the expansion effect every time, so that the expansion result and the expansion quality evaluation after the index is reached every time are obtained. Specifically, the capacity expansion effect is evaluated through the utilization rate, and the capacity expansion effect is good when the utilization rate reaches an empirical value that the machine is fully loaded and does not wait (for example, the cpu utilization rate reaches 70%). The fluctuation can be understood as an empirical difference from the optimal utilization. Wherein, the linear expansion formula is as follows:

wherein, N is a capacity expansion coefficient related to the number of the current stock servers, K is a capacity expansion threshold coefficient whose magnitude affects the slope of the capacity expansion number, thr is a trigger threshold (each index has a corresponding trigger threshold) of the system service, x is index data monitored in real time, and y is the calculated capacity expansion number.

Through the calculation, the capacity expansion quantity of each time can be obtained, the capacity expansion server (the server can be in different distributed systems) performs quality evaluation on the capacity expansion of the time after the service is completed according to the capacity expansion quantity of each time, and the evaluation content comprises the utilization rate of the capacity expansion of the time and the like. After expanding the live broadcast system, when the large flow rate disappears, the capacity reduction can be carried out, and the capacity reduction follows the slow-reduction principle, namely: when each purified detection index value of the live broadcast system is smaller than the corresponding dynamic capacity reduction threshold value, respectively calculating each corresponding capacity reduction result of the live broadcast system by adopting a linear capacity reduction mode according to each purified detection index value, wherein the capacity reduction formula is as follows:

the shrinkThr is a dynamic capacity reduction threshold, and M is the number of capacity expansion servers, and the threshold can always ensure that the system can still provide services with the capacity lower than thr after capacity reduction.

Taking the minimum value of the number of the capacity-reduced servers in each capacity-reduced result as the number of the final capacity-reduced servers at this time, and carrying out capacity reduction on the live broadcast system according to the number of the final capacity-reduced servers at this time; and for the same detection index, the capacity expansion triggering threshold value is larger than the dynamic capacity reduction threshold value.

And 2.2, carrying out data fitting capacity expansion formula according to the empirical data.

Setting a least square formula for each detection index, substituting the data of the detection index in the experience accumulated data and the corresponding quantity of capacity expansion servers or the corresponding quantity of final capacity reduction servers into the least square formula to perform first fitting to form a statically indeterminate equation set; vectorizing the hyperstatic equation set, wherein the vectorized hyperstatic equation set has unknown vector coefficients; forming a residual square sum formula by vectorizing a hyperstatic equation set and corresponding volume expansion and reduction data, obtaining an unknown vector coefficient value when the residual square sum formula value is minimum, and substituting the unknown vector coefficient value into the hyperstatic equation set to obtain a primary fitting formula; substituting the data of the detection index in all the experience accumulated data and the corresponding quantity of the capacity expansion servers or the corresponding quantity of the final capacity reduction servers into a primary fitting formula for iteration to obtain a secondary fitting formula; and taking a fitting formula after iteration for preset times as a capacity fitting formula of the detection index, wherein the expansion and contraction capacity data refers to linear expansion and contraction capacity, the number of expansion servers or the number of corresponding final expansion servers. The method comprises the following specific steps:

the least square fitting method is adopted to obtain a first fitting formula, a second fitting formula and a third fitting formula. The formula is as follows:

wherein, X represents a detection index, i represents an ith sampling point, and j represents a jth fitting; m represents how many equations exist, namely the relation between the achieved index and the expansion quantity, n represents n times of fitting, the maximum value of n is 3, and the expansion quantity fitting formula can be obtained by solving beta (fitting coefficient) under the equation set.

Substituting the acquired m sampling points into the equation to obtain an overdetermined equation set as follows:

vectorizing the system of equations as:

y=Xβ

for such a relation equation, the least square method can select the most suitable β to make the equation as good as possible, and introduces the minimum residual sum of squares S:

S(β)=‖Xβ-y‖2

when a beta value is taken to minimize S, the best fitting effect is achieved, and then a capacity fitting formula is obtained. When in useWhen (1)Coefficients representing a first, second or third fit), S (β) takes a minimum value, and S (β) is differentiated to find the maximum value, whereby:

if matrix XTX is not singular, then β has a unique solution:

therefore, by processing the collected traffic (empirically accumulated data) by using the above algorithm, a best fit formula of first fit, second fit and third fit can be obtained as follows:

y=β1x+β0

y=β2x21x+β0

y=β3x32x21x+β0

and step 3: and (5) building an automatic capacity expansion and reduction basic service. The number of servers (which may be in different distributed systems) to be expanded and contracted is obtained through index detection and data decision (capacity fitting formula), and then an OPS system needs to be set up to actually expand the capacity of the machine. The method specifically comprises the following steps:

and when any purified detection index value of the live broadcast system reaches a corresponding expansion triggering threshold value, obtaining the number of servers of the live broadcast system in the current expansion according to a capacity fitting formula of the detection index.

After the live broadcast system is subjected to capacity expansion, when all purification detection index values of the live broadcast system are smaller than respective corresponding dynamic capacity reduction threshold values, the number of corresponding capacity reduction servers is obtained according to a capacity fitting formula of all detection indexes, and the minimum value of the number of the capacity reduction servers is used as the number of the final capacity reduction servers of the live broadcast system.

The basic service can automate the expansion operation steps of the previous manual operation, and the data decision system only needs to tell how many servers need to be expanded and contracted, so that the increase and decrease of the servers can be automatically completed.

In conclusion, the invention adopts a mode of combining evaluation and data fitting of historical experience capacity expansion data, so that the automatic capacity expansion and reduction quantity is more consistent with the real situation. Meanwhile, the invention carries out complete system practice construction from index acquisition and data decision to automatic capacity expansion operation and carries out a great deal of fact verification. Therefore, under the condition of meeting large flow, the system can expand and contract more efficiently to meet the system requirement, and the cost can be reduced.

The beneficial effects obtained by the invention are as follows:

compared with the traditional capacity expansion and reduction technology, the method has the advantages that the capacity expansion and reduction quantity is obtained through three steps of index detection, linear capacity expansion experience accumulation and statistical data fitting, historical capacity expansion data and evaluation are fully utilized, the capacity expansion quantity with the minimum variance is obtained, the service condition is reflected more truly, and the capacity expansion service capacity and the capacity expansion cost are guaranteed.

It should be understood that the specific order or hierarchy of steps in the processes disclosed is an example of exemplary approaches. Based upon design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not intended to be limited to the specific order or hierarchy presented.

In the foregoing detailed description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the subject matter require more features than are expressly recited in each claim. Rather, as the following claims reflect, invention lies in less than all features of a single disclosed embodiment. Thus, the following claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. To those skilled in the art; various modifications to these embodiments will be readily apparent, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

What has been described above includes examples of one or more embodiments. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the aforementioned embodiments, but one of ordinary skill in the art may recognize that many further combinations and permutations of various embodiments are possible. Accordingly, the embodiments described herein are intended to embrace all such alterations, modifications and variations that fall within the scope of the appended claims. Furthermore, to the extent that the term "includes" is used in either the detailed description or the claims, such term is intended to be inclusive in a manner similar to the term "comprising" as "comprising" is interpreted when employed as a transitional word in a claim. Furthermore, any use of the term "or" in the specification of the claims is intended to mean a "non-exclusive or".

Those of skill in the art will further appreciate that the various illustrative logical blocks, units, and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate the interchangeability of hardware and software, various illustrative components, elements, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.

The various illustrative logical blocks, or elements, described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. For example, a storage medium may be coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may be located in a user terminal. In the alternative, the processor and the storage medium may reside in different components in a user terminal.

In one or more exemplary designs, the functions described above in connection with the embodiments of the invention may be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media that facilitate transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to carry or store program code in the form of instructions or data structures and which can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Additionally, any connection is properly termed a computer-readable medium, and, thus, is included if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wirelessly, e.g., infrared, radio, and microwave. Such discs (disk) and disks (disc) include compact disks, laser disks, optical disks, DVDs, floppy disks and blu-ray disks where disks usually reproduce data magnetically, while disks usually reproduce data optically with lasers. Combinations of the above may also be included in the computer-readable medium.

The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:数据显示、数据发送方法及装置、相关设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类