A flow scheduling method, device and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2026-08-14
AI Technical Summary
但当业务连续通话时长大但是分布极度不均时,难以选择出成本较低的方式,导致最终流量使用成本较高
[0044]As can be seen, this application acquires real-time traffic data of a real-time audio/video application in the current period. If the real-time traffic data reaches the scheduling threshold of the current period, a first traffic channel is designated as the target traffic channel; otherwise, a second traffic channel is designated as the target traffic channel. The first traffic channel corresponds to the time-based billing method, and the second traffic channel corresponds to the peak-based billing method. Then, the channel information of the target traffic channel is sent to the real-time audio/video application so that the real-time audio/video application can transmit real-time audio/video data based on the target traffic channel. That is, this application acquires real-time traffic data of a real-time audio/video application. When the real-time traffic data reaches the scheduling threshold, the traffic of the real-time audio/video application is scheduled to the channel corresponding to the time-based billing method; otherwise, the traffic of the real-time audio/video application is scheduled to the channel corresponding to the time-based peak-based billing method. In this way, the advantages of the two traffic channels can be combined, which can reduce the cost of traffic usage.
Smart Images

Figure CN116938820B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of traffic scheduling technology, and in particular to a traffic scheduling method, device and medium. Background Technology
[0002] Currently, in real-time audio and video applications, namely live video streaming and voice applications, there are generally two billing models for RTC (Real-Time Communication): peak bandwidth billing and call duration billing. Each has its advantages and disadvantages. Peak bandwidth billing is suitable when monthly usage is relatively evenly distributed, while call duration billing is more cost-effective for scenarios with non-continuous and low usage. However, when the continuous call duration is long but extremely unevenly distributed, it is difficult to choose a lower-cost method, resulting in higher final traffic usage costs. In summary, in the process of developing this invention, the inventors have at least discovered that existing traffic scheduling schemes lead to higher traffic usage costs. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide a traffic scheduling method, device, and medium that can reduce traffic usage costs. The specific solution is as follows:
[0004] In a first aspect, this application discloses a traffic scheduling method, the method comprising a first traffic channel and a second traffic channel, including:
[0005] In the current cycle, acquire real-time traffic data for real-time audio and video applications;
[0006] If the real-time traffic data reaches the scheduling threshold of the current period, the first traffic channel is determined as the target traffic channel; otherwise, the second traffic channel is determined as the target traffic channel. Wherein, the first traffic channel is the channel corresponding to the duration-based billing method, and the second traffic channel is the channel corresponding to the peak-based billing method.
[0007] The channel information of the target traffic channel is sent to the real-time audio and video application so that the real-time audio and video application can transmit real-time audio and video data based on the target traffic channel.
[0008] Optional, also includes:
[0009] Acquire traffic data for the first period; wherein the traffic data changes over time;
[0010] The traffic growth rate is determined based on the traffic data from the first period;
[0011] The second traffic data is determined based on the traffic growth rate and the traffic data of the first period;
[0012] Based on the second traffic data, the scheduling threshold for the current period is obtained.
[0013] Optionally, obtaining the traffic data for the first period includes:
[0014] Get the bitrate of each user at each time point in the first period;
[0015] The bandwidth at each time point is calculated based on the bitrate of all users at each time point in the first period to obtain the traffic data for the first period.
[0016] Optionally, obtaining the scheduling threshold for the current period based on the second traffic data includes:
[0017] Multiple candidate thresholds are determined, and the cost corresponding to each candidate threshold is calculated based on the second traffic data;
[0018] The lowest cost is determined from the costs corresponding to the plurality of candidate thresholds, and the candidate threshold corresponding to the lowest cost is determined as the scheduling threshold for the current period.
[0019] Optionally, determining multiple candidate thresholds includes:
[0020] Obtain the highest peak value of the second traffic data;
[0021] The highest peak value is reduced by a preset step size to obtain a peak value reduction result until the highest peak value reduction result is zero. The highest peak value and each peak value reduction result are used as the multiple candidate thresholds.
[0022] Optionally, calculating the cost corresponding to each candidate threshold based on the second traffic data includes:
[0023] A traffic data curve is generated based on the second traffic data;
[0024] A threshold line is determined based on any candidate threshold; the threshold line is a line that varies over time and has a constant bandwidth equal to the candidate threshold.
[0025] Determine the area of the closed shape enclosed by the threshold line and the flow data curve;
[0026] The target duration is determined based on the area, and the first cost corresponding to the duration-based billing method is determined based on the target duration.
[0027] The highest peak value in the traffic data curve that is less than or equal to the candidate threshold is determined to obtain the target peak value, and the second cost corresponding to the peak billing method is determined based on the target peak value.
[0028] The sum of the first cost and the second cost is determined as the cost corresponding to the candidate threshold.
[0029] Optionally, determining the target duration based on the area includes:
[0030] The average bitrate for each closed graph is determined based on the bitrate of all users within the time period corresponding to each closed graph.
[0031] The duration of each closed shape is determined based on its area and the corresponding average bitrate.
[0032] The sum of the durations corresponding to all the closed shapes is determined as the target duration.
[0033] Optional, also includes:
[0034] Monitor the status of the first and second flow channels;
[0035] If either the first flow channel or the second flow channel fails, the non-faulty channel in the first flow channel or the second flow channel will be designated as the target flow channel.
[0036] Secondly, this application discloses a traffic scheduling device, comprising:
[0037] The real-time traffic acquisition module is used to acquire real-time traffic data of real-time audio and video applications in the current period.
[0038] The traffic channel determination module is used to determine the first traffic channel as the target traffic channel if the real-time traffic data reaches the scheduling threshold of the current period, and otherwise determine the second traffic channel as the target traffic channel; wherein, the first traffic channel is the channel corresponding to the time-based billing method, and the second traffic channel is the channel corresponding to the peak-based billing method;
[0039] The channel information distribution module is used to distribute the channel information of the target traffic channel to the real-time audio and video application, so that the real-time audio and video application can transmit real-time audio and video data based on the target traffic channel.
[0040] Thirdly, this application discloses an electronic device, including a memory and a processor, wherein:
[0041] The memory is used to store computer programs;
[0042] The processor is used to execute the computer program to implement the aforementioned traffic scheduling method.
[0043] Fourthly, this application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned traffic scheduling method.
[0044] As can be seen, this application acquires real-time traffic data of a real-time audio / video application in the current period. If the real-time traffic data reaches the scheduling threshold of the current period, a first traffic channel is designated as the target traffic channel; otherwise, a second traffic channel is designated as the target traffic channel. The first traffic channel corresponds to the time-based billing method, and the second traffic channel corresponds to the peak-based billing method. Then, the channel information of the target traffic channel is sent to the real-time audio / video application so that the real-time audio / video application can transmit real-time audio / video data based on the target traffic channel. That is, this application acquires real-time traffic data of a real-time audio / video application. When the real-time traffic data reaches the scheduling threshold, the traffic of the real-time audio / video application is scheduled to the channel corresponding to the time-based billing method; otherwise, the traffic of the real-time audio / video application is scheduled to the channel corresponding to the time-based peak-based billing method. In this way, the advantages of the two traffic channels can be combined, which can reduce the cost of traffic usage. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0046] Figure 1 A schematic diagram of the system framework applicable to the traffic scheduling scheme provided in this application;
[0047] Figure 2 A flowchart of a traffic scheduling method provided in this application;
[0048] Figure 3 A specific bitrate diagram is provided for this application;
[0049] Figure 4 A flowchart of a specific traffic scheduling method provided in this application;
[0050] Figure 5 A schematic diagram of monthly traffic flow provided for this application;
[0051] Figure 6 A schematic diagram of a daily flow rate curve provided for this application;
[0052] Figure 7 This application provides a specific schematic diagram of the daily bandwidth curve and threshold line;
[0053] Figure 8 A specific cost curve diagram provided for this application
[0054] Figure 9This application provides a specific schematic diagram for determining the scheduling threshold;
[0055] Figure 10 A traffic scheduling diagram provided in this application;
[0056] Figure 11 This application provides a specific traffic scheduling diagram;
[0057] Figure 12 Another specific traffic scheduling diagram provided in this application;
[0058] Figure 13 A schematic diagram of a traffic scheduling device is provided in this application;
[0059] Figure 14 A schematic diagram of an electronic device provided in this application. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0061] Currently, in real-time audio and video applications, there are generally two RTC billing models: peak bandwidth billing and call duration billing. Each has its advantages and disadvantages. Peak bandwidth billing is suitable when monthly usage is relatively evenly distributed, while call duration billing is more cost-effective for scenarios with non-continuous and low usage. However, when the continuous call duration is long but extremely unevenly distributed, it is difficult to choose a lower-cost method, resulting in higher final traffic usage costs. In summary, during the development of this invention, the inventors discovered that existing traffic scheduling schemes lead to higher traffic usage costs. Therefore, this application provides a traffic scheduling scheme that can reduce traffic usage costs.
[0062] The system framework used in the traffic scheduling scheme of this application can be found in [reference needed]. Figure 1 As shown, this may specifically include: a backend server and a number of user terminals that establish communication connections with the backend server. The user terminals include, but are not limited to, tablets, laptops, smartphones, and personal computers (PCs). These user terminals have real-time audio and video applications installed, which are used for live streaming or voice communication.
[0063] In this application, the steps of the backend server executing the traffic scheduling method include: in the current period, acquiring real-time traffic data of the real-time audio and video application; if the real-time traffic data reaches the scheduling threshold of the current period, then determining the first traffic channel as the target traffic channel, otherwise determining the second traffic channel as the target traffic channel; wherein, the first traffic channel is the channel corresponding to the time-based billing method, and the second traffic channel is the channel corresponding to the peak-based billing method; and sending the channel information of the target traffic channel to the real-time audio and video application so that the real-time audio and video application can transmit real-time audio and video data based on the target traffic channel.
[0064] See Figure 2 As shown in the figure, this application discloses a traffic scheduling method, the method including a first traffic channel and a second traffic channel, including:
[0065] Step S11: In the current period, obtain real-time traffic data of real-time audio and video applications.
[0066] In a specific implementation, the bitrate of each user can be acquired periodically within the current cycle; real-time traffic data for real-time audio and video applications can be calculated based on the bitrates of all users. Furthermore, the real-time traffic data can be updated based on preset events, such as broadcast start-up events and broadcast end-of-broadcast events. Differential updates are performed on the periodically calculated real-time traffic data based on these preset events, ensuring that the real-time traffic data between adjacent periodic calculations is closer to the actual data. In other words, periodic updates of network-wide statistical data and event statistics compensate for the incremental data before the arrival of the network-wide statistical task; the combination of these two methods yields data that more closely reflects the actual traffic.
[0067] It should be noted that bitrate is the number of bits transmitted per unit of time. Video and audio have different bitrates, such as... Figure 3 As shown, Figure 3 This is a specific bitrate illustration provided for an embodiment of this application. Furthermore, the bitrate is affected by the user's screen resolution and network type (4G, 5G, WiFi). Therefore, in traffic data statistics, it is necessary to collect the bitrate of different users. The period can be one month, or it can be one day, etc. The period in this application can be determined according to the billing cycle of the traffic provider; for example, if the traffic provider's billing cycle is one month, the period in this application is one month.
[0068] Step S12: If the real-time traffic data reaches the scheduling threshold of the current period, the first traffic channel is determined as the target traffic channel; otherwise, the second traffic channel is determined as the target traffic channel. Wherein, the first traffic channel is the channel corresponding to the duration-based billing method, and the second traffic channel is the channel corresponding to the peak-based billing method.
[0069] In a specific implementation, the scheduling threshold for the current period can be predetermined, for example, determined at the end of the most recent historical period, i.e., the previous period. Furthermore, the scheduling threshold for the current period can be determined based on traffic data from the most recent historical period. Specifically, the traffic data for the current period can be predicted based on the traffic data from the most recent historical period, and the scheduling threshold for the current period can be obtained based on the predicted traffic data and a preset cost calculation model. When real-time traffic data is acquired, the real-time traffic data is compared with the scheduling threshold. If the real-time traffic data reaches the scheduling threshold for the current period, the channel corresponding to the duration-based billing method is determined as the target traffic channel; otherwise, the channel corresponding to the peak-based billing method is determined as the target traffic channel. It can be understood that traffic data refers to the bandwidth at each point in time within the period; real-time traffic data reaching the scheduling threshold for the current period also means that the real-time bandwidth has reached the scheduling threshold for the current period.
[0070] In other words, in this embodiment of the application, the characteristics of the two time-based billing methods can be combined, and the traffic channels of the two billing methods can be accessed simultaneously for traffic scheduling. Normally, the traffic is scheduled to the peak billing method, while the spike traffic during peak periods is scheduled to the time-based billing method. After traffic scheduling, the advantages of the two traffic channels are fully utilized, and the effect of peak shaving and reducing usage costs is ultimately achieved.
[0071] Step S13: Send the channel information of the target traffic channel to the real-time audio and video application so that the real-time audio and video application can transmit real-time audio and video data based on the target traffic channel.
[0072] In a specific implementation, the channel information is the channel type, and real-time audio and video applications transmit real-time audio and video data based on the channel corresponding to the channel type.
[0073] In one implementation, after acquiring channel information, the real-time audio and video application does not switch channels if it is currently transmitting real-time audio and video data based on the channel corresponding to the channel type; otherwise, it switches channels to the channel corresponding to the channel type.
[0074] In another implementation, before step S13, it can be determined whether the real-time audio and video application is currently transmitting real-time audio and video data based on the target traffic channel. If not, step S13 is triggered; otherwise, step S13 is not executed. In this way, the real-time audio and video application does not switch channels.
[0075] Furthermore, embodiments of this application can monitor the status of the first and second traffic channels; if either the first or second traffic channel fails, the non-faulty channel between the first and second traffic channels is identified as the target traffic channel. In this way, by using the status of the two channels as scheduling factors, when one channel fails, the system can switch entirely to the other channel, enhancing the robustness of the entire system and reducing the cost of incidents.
[0076] As can be seen, in this embodiment, real-time traffic data of a real-time audio / video application is acquired in the current period. If the real-time traffic data reaches the scheduling threshold of the current period, a first traffic channel is determined as the target traffic channel; otherwise, a second traffic channel is determined as the target traffic channel. The first traffic channel is the channel corresponding to the time-based billing method, and the second traffic channel is the channel corresponding to the peak-based billing method. Then, the channel information of the target traffic channel is sent to the real-time audio / video application so that the real-time audio / video application can transmit real-time audio / video data based on the target traffic channel. That is, this application acquires real-time traffic data of a real-time audio / video application. When the real-time traffic data reaches the scheduling threshold, the traffic of the real-time audio / video application is scheduled to the channel corresponding to the time-based billing method; otherwise, the traffic of the real-time audio / video application is scheduled to the channel corresponding to the time-based peak-based billing method. In this way, the advantages of the two traffic channels can be combined, which can reduce the cost of traffic usage.
[0077] See Figure 4 As shown in the embodiment of this application, a specific traffic scheduling method includes:
[0078] Step S21: Obtain traffic data for the first period; wherein the traffic data changes over time.
[0079] In a specific implementation, the bitrate of each user at each time point in the first period can be obtained; the bandwidth at each time point is calculated based on the bitrate of all users at each time point in the first period to obtain the traffic data of the first period. The first period can be the most recent historical period, and the formula for calculating the traffic data is S = T(W), where S is the traffic data, T is the time sequence, and W is the bandwidth, and W = ∑ 1-n (B), where B is the user bitrate and n is the number of users.
[0080] Understandably, traffic data can be plotted as a traffic curve. A traffic curve is a cyclical pattern of traffic data collected and statistically analyzed through technical means during operation. Its influencing factors mainly include: new user growth rate, holiday activities, monthly peak periods, and daily peak periods. For example, see... Figure 5 As shown, Figure 5 This is a monthly traffic curve disclosed in an embodiment of this application, with the horizontal axis representing time and the vertical axis representing bandwidth. See also... Figure 6 As shown, Figure 6 This application discloses a daily traffic curve, with time on the horizontal axis and bandwidth on the vertical axis. The traffic curve shows that there is one day each month with a significantly higher peak traffic value than other days, and there is a daily evening traffic peak. Traffic during off-peak periods is less than 1 / 10 of the peak period. The daily traffic peaks are characterized by large peak values and short durations. Furthermore, the most recent historical period is the previous period of the current period.
[0081] Step S22: Determine the traffic growth rate based on the traffic data of the first period.
[0082] In a specific implementation, the traffic growth rate can be determined based on the traffic data of the first period and the traffic data of the second period, where the second period is the period preceding the first period. The formula used is R = F(Sn:Sn-1), where R is the traffic growth rate, Sn is the traffic data of the first period, Sn-1 is the traffic data of the second period, and F is the traffic growth rate calculation function, which can be: F(Sn:Sn-1) = (Sn-Sn-1) / t, where t is time.
[0083] Step S23: Determine the second traffic data based on the traffic growth rate and the traffic data of the first period.
[0084] In a specific implementation, the product of the traffic growth rate and the traffic data of the first period can be determined, and the second traffic data can be obtained by summing this product with a variable parameter. The second traffic data is the predicted traffic data for the current period, where the formula used is S. (预测流量数据) =Sn*R+β, where β is a variable parameter.
[0085] Step S24: Based on the second traffic data, obtain the scheduling threshold for the current period.
[0086] In one implementation, the scheduling threshold for the current period can be obtained based on the second traffic data and a preset cost calculation model.
[0087] In a specific implementation, step S24 may include the following steps:
[0088] Step 240: Determine multiple candidate thresholds and calculate the cost corresponding to each candidate threshold based on the second traffic data. Specifically, the cost corresponding to each candidate threshold can be calculated based on the second traffic data and a preset cost calculation model.
[0089] In one implementation, the highest peak value of the second traffic data can be obtained; the highest peak value can be reduced by a preset step size to obtain a peak value reduction result until the highest peak value reduction result is zero, and the highest peak value and each peak value reduction result are used as the plurality of candidate thresholds.
[0090] Furthermore, a traffic data curve can be generated based on the second traffic data; a threshold line can be determined based on any candidate threshold; the threshold line is a straight line that changes over time and has a constant bandwidth at the candidate threshold; the area of the closed figure enclosed by the threshold line and the traffic data curve can be determined; a target duration can be determined based on the area, and a first cost corresponding to the duration-based billing method can be determined based on the target duration; the highest peak value in the traffic data curve that is less than or equal to the candidate threshold can be determined to obtain the target peak value, and a second cost corresponding to the peak-based billing method can be determined based on the target peak value; the sum of the first cost and the second cost can be determined as the cost corresponding to the candidate threshold.
[0091] In one embodiment, determining the target duration based on the area may specifically include: determining the average bitrate for each closed shape based on the bitrates of all users within the time period corresponding to each closed shape; determining the duration for each closed shape based on its area and the corresponding average bitrate; and summing the durations for all closed shapes to determine the target duration. The ratio of the area of any closed shape to the average bitrate is the duration corresponding to that closed shape's area.
[0092] Understandably, the preset cost calculation model is: Total Cost = Target Peak Value * Peak Rate + Target Duration * Duration Rate. The target peak value is the highest peak value in the traffic data curve that is less than or equal to the scheduling threshold. The target duration is the duration calculated by converting the area of the closed shape enclosed by the threshold line corresponding to the scheduling threshold and the traffic data curve. Specifically, the ratio of the area of each closed shape to the corresponding bitrate is determined, and then all ratios are summed to obtain the target duration.
[0093] In other words, in the default cost calculation model, peak traffic billing does not require conversion. Historical traffic statistics use Mbps as the basic unit. If the period is monthly, only the peak traffic for that month needs to be obtained to calculate the cost. Duration-based billing requires conversion between traffic and duration. By reducing the peak traffic, the area of the reduction is converted into duration. For example, see... Figure 7 As shown, Figure 7 This is a schematic diagram of a specific daily traffic curve and a threshold line, where the straight line represents the threshold. When the bandwidth reaches the threshold, traffic is redirected to the channel corresponding to the time-based billing method. The area formed by the traffic curve and the threshold line, divided by the bitrate, yields the total time-based billing cost after redirection. A pre-defined cost calculation model, combined with the unit prices of the two billing methods, allows inputting traffic data from any month to obtain the cost curve. See [link / reference]. Figure 8 As shown, Figure 8This is a schematic diagram of a specific cost curve disclosed in an embodiment of this application. An optimal threshold range can be obtained from the cost curve, and there is a threshold point with the lowest cost. Using this threshold point as the scheduling basis for the two billing methods, a minimum total cost can be obtained.
[0094] Step 241: Determine the lowest cost from the costs corresponding to the plurality of candidate thresholds, and determine the candidate threshold corresponding to the lowest cost as the scheduling threshold for the current period.
[0095] Step S25: In the current cycle, obtain real-time traffic data for real-time audio and video applications.
[0096] Step S26: If the real-time traffic data reaches the scheduling threshold of the current period, then the first traffic channel is determined as the target traffic channel; otherwise, the second traffic channel is determined as the target traffic channel. Wherein, the first traffic channel is the channel corresponding to the duration-based billing method, and the second traffic channel is the channel corresponding to the peak-based billing method.
[0097] Step S27: Send the channel information of the target traffic channel to the real-time audio and video application so that the real-time audio and video application can transmit real-time audio and video data based on the target traffic channel.
[0098] For the specific implementation process of steps S25 to S27 above, please refer to the content disclosed in the foregoing embodiments, and will not be repeated here.
[0099] As can be seen, this embodiment of the application obtains traffic data from the most recent historical period, thereby determining the traffic growth rate, and predicts the traffic data for the current period based on the traffic growth rate and the traffic data from the most recent historical period; based on the predicted traffic data and a preset cost calculation model, the scheduling threshold for the current period is obtained. In this way, predicting the current traffic data based on historical traffic data to calculate the scheduling threshold for the current period is easier to process and better ensures low-cost performance compared to calculating the threshold based on real-time traffic.
[0100] The following section details the traffic scheduling scheme of this application, using a one-month period as an example. This embodiment predicts the monthly traffic curve based on historical traffic curves and the business growth rate, and inputs this monthly traffic curve into a pre-set cost calculation model to calculate the optimal threshold for traffic scheduling. Specifically, this includes:
[0101] First, obtain the traffic curve from last month and calculate the traffic growth rate. Then, fit last month's traffic curve with the traffic growth rate to predict this month's traffic curve. Finally, input the predicted traffic curve for this month into a preset cost calculation model to calculate the scheduling threshold at the lowest cost. It should be noted that if the traffic curve is not predicted using the above method, but the cost is calculated based on the real-time traffic for this month, the optimal scheduling threshold will change, the processing will be complex, and the cost effect cannot be guaranteed. Conversely, by using traffic prediction, the optimal threshold point for traffic scheduling can be predicted in advance, and from the cost curve perspective, within a certain range of scheduling thresholds, the effect of achieving a very close result to the lowest total cost can be achieved. The specific process of calculating the scheduling threshold is as follows: Obtain the highest peak value of the predicted traffic curve, set C = peak value, and calculate the current cost. At this point, C = peak value indicates that no traffic has been scheduled yet; decrease the value of C by a fixed step size, and convert the switching area into duration using a formula, and then calculate the current cost; when C = 0, it indicates that all peak-billed traffic has been switched to duration-billed traffic. Based on the costs corresponding to all C values, select the C with the lowest cost as the scheduling threshold. See Figure 9 As shown, Figure 9 This is a schematic diagram illustrating a specific scheduling threshold determination method disclosed in an embodiment of this application.
[0102] Furthermore, traffic scheduling is performed based on a scheduling threshold and in conjunction with real-time traffic. It is understood that this embodiment obtains the traffic curve of the previous month and calculates the traffic growth rate. The traffic curve of the previous month is fitted with the traffic growth rate to predict the traffic curve of the current month. Finally, the predicted traffic curve of the current month is input into a preset cost calculation model to calculate the scheduling threshold at which the cost is lowest. Traffic scheduling is then performed based on the scheduling threshold and in conjunction with real-time traffic. Figure 10 As shown, Figure 10 This is a schematic diagram of traffic scheduling disclosed in an embodiment of this application. Specifically, traffic scheduling based on a scheduling threshold and real-time traffic includes: obtaining the optimal scheduling threshold for the current month, which is valid for that month. On the last day of each month, the optimal threshold for the following month is automatically calculated. Then, when a user starts broadcasting (karaoke room microphone access, live broadcast), the current real-time traffic data is obtained, and the scheduling threshold is used to determine whether to perform scheduling. Finally, the scheduling RTC type is issued, and the user's App receives the RTC type issued by the backend to start broadcasting. Figure 11 As shown, Figure 11 This is a specific traffic scheduling diagram disclosed in an embodiment of this application.
[0103] Further, see Figure 12 As shown, Figure 12This is another specific traffic scheduling diagram disclosed in an embodiment of this application. The traffic for the current month is predicted based on last month's traffic data and the traffic growth rate of the past two months, and then the scheduling threshold for the current month is calculated. If some client versions do not support this solution, filtering is performed, and multiple fault tolerance mechanisms are provided. For example, if real-time traffic data is not available, scheduling is based on historical traffic data, or a forced switch to time-based billing is executed during peak hours. In this application, traffic data can be statistically analyzed in real time using scheduled tasks and events.
[0104] In this way, a cost model is established based on different billing methods, using traffic data as input to obtain the optimal scheduling thresholds for the two billing methods. Finally, real-time traffic monitoring is performed, and traffic scheduling is automatically implemented to reduce traffic peaks and lower traffic usage costs. Furthermore, introducing traffic channels with multiple billing methods also helps improve the disaster recovery capabilities of real-time audio and video applications. The status of traffic channels can be incorporated into the scheduling factors; when one channel fails, traffic is redirected to another channel, reducing the significant losses caused by a single traffic channel failure.
[0105] See Figure 13 As shown in the figure, this application discloses a traffic scheduling device, including:
[0106] The real-time traffic acquisition module 11 is used to acquire real-time traffic data of real-time audio and video applications in the current period.
[0107] The traffic channel determination module 12 is used to determine the first traffic channel as the target traffic channel if the real-time traffic data reaches the scheduling threshold of the current period, and otherwise determine the second traffic channel as the target traffic channel; wherein, the first traffic channel is the channel corresponding to the duration billing method, and the second traffic channel is the channel corresponding to the peak billing method.
[0108] The channel information distribution module 13 is used to distribute the channel information of the target traffic channel to the real-time audio and video application so that the real-time audio and video application can transmit real-time audio and video data based on the target traffic channel.
[0109] As can be seen, in this embodiment, real-time traffic data of a real-time audio / video application is acquired in the current period. If the real-time traffic data reaches the scheduling threshold of the current period, a first traffic channel is determined as the target traffic channel; otherwise, a second traffic channel is determined as the target traffic channel. The first traffic channel is the channel corresponding to the time-based billing method, and the second traffic channel is the channel corresponding to the peak-based billing method. Then, the channel information of the target traffic channel is sent to the real-time audio / video application so that the real-time audio / video application can transmit real-time audio / video data based on the target traffic channel. That is, in this embodiment, real-time traffic data of a real-time audio / video application is acquired, and when the real-time traffic data reaches the scheduling threshold, the traffic of the real-time audio / video application is scheduled to the channel corresponding to the time-based billing method; otherwise, the traffic of the real-time audio / video application is scheduled to the channel corresponding to the time-based peak-based billing method. In this way, the advantages of the two traffic channels can be combined, which can reduce the cost of traffic usage.
[0110] Furthermore, the device also includes:
[0111] The first traffic acquisition module is used to acquire traffic data for the first period; wherein the traffic data changes over time.
[0112] The traffic growth rate acquisition module is used to determine the traffic growth rate based on the traffic data of the first period;
[0113] The second traffic acquisition module is used to determine the second traffic data based on the traffic growth rate and the traffic data of the first period;
[0114] The scheduling threshold acquisition module is used to obtain the scheduling threshold for the current period based on the second traffic data.
[0115] The first traffic acquisition module specifically includes:
[0116] The user bitrate acquisition submodule is used to acquire the bitrate of each user at each time point in the first period;
[0117] The bandwidth acquisition submodule is used to calculate the bandwidth at each time point based on the bitrate of all users at each time point in the first period, and obtain the traffic data of the first period.
[0118] Furthermore, the scheduling threshold acquisition module specifically includes:
[0119] The candidate threshold determination submodule is used to determine multiple candidate thresholds;
[0120] The cost calculation submodule is used to calculate the cost corresponding to each candidate threshold based on the second flow data.
[0121] The scheduling threshold determination submodule is used to determine the lowest cost from the costs corresponding to the plurality of candidate thresholds, and to determine the candidate threshold corresponding to the lowest cost as the scheduling threshold for the current period.
[0122] The candidate threshold determination submodule is specifically used to obtain the highest peak value of the second traffic data; reduce the highest peak value by a preset step size to obtain a peak value reduction result until the highest peak value reduction result is zero, and use the highest peak value and each peak value reduction result as the plurality of candidate threshold values.
[0123] Correspondingly, the cost calculation submodule specifically includes:
[0124] A traffic data curve generation unit is used to generate a traffic data curve based on the second traffic data.
[0125] A threshold line determination unit is used to determine a threshold line based on any candidate threshold; the threshold line is a line that varies over time and has a bandwidth that is always equal to the candidate threshold.
[0126] An area determination unit is used to determine the area of the closed shape enclosed by the threshold line and the flow data curve;
[0127] A duration determination unit is used to determine the target duration based on the area;
[0128] The first cost determination unit is used to determine the first cost corresponding to the duration-based billing method based on the target duration.
[0129] The target peak determination unit is used to determine the highest peak value in the traffic data curve that is less than or equal to the candidate threshold in order to obtain the target peak value.
[0130] The second cost determination unit is used to determine the second cost corresponding to the peak billing method based on the target peak value;
[0131] The total cost determination unit is used to determine the sum of the first cost and the second cost as the cost corresponding to the candidate threshold.
[0132] Specifically, the duration determination unit is used to determine the average bitrate of each closed shape based on the bitrate of all users within the time period corresponding to each closed shape; to determine the duration of each closed shape based on the area of each closed shape and the corresponding average bitrate; and to determine the sum of the durations of all the closed shapes as the target duration.
[0133] In addition, the device also includes:
[0134] The status monitoring module is used to monitor the status of the first flow channel and the second flow channel;
[0135] Correspondingly, the flow channel determination module 12 is also used to determine the non-faulty channel in the first flow channel and the second flow channel as the target flow channel if the status monitoring module detects a fault in either the first flow channel or the second flow channel.
[0136] Furthermore, embodiments of this application also provide an electronic device. Figure 14 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be considered as any limitation on the scope of this application.
[0137] Figure 14 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the traffic scheduling method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be a server.
[0138] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0139] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.
[0140] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform operations and processing on the data 223 in the memory 22. The operating system 221 can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the traffic scheduling method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0141] Furthermore, this application also discloses a storage medium storing a computer program, which, when loaded and executed by a processor, implements the traffic scheduling method steps disclosed in any of the foregoing embodiments.
[0142] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0143] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0144] The above provides a detailed description of a traffic scheduling method, device, and medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A traffic scheduling method, the method comprising a first traffic channel and a second traffic channel, characterized in that, include: In the current cycle, acquire real-time traffic data for real-time audio and video applications; If the real-time traffic data reaches the scheduling threshold of the current period, the first traffic channel is determined as the target traffic channel; otherwise, the second traffic channel is determined as the target traffic channel. Wherein, the first traffic channel is the channel corresponding to the duration-based billing method, and the second traffic channel is the channel corresponding to the peak-based billing method. The channel information of the target traffic channel is sent to the real-time audio and video application so that the real-time audio and video application can transmit real-time audio and video data based on the target traffic channel; The method further includes: acquiring traffic data for a first period; wherein the traffic data changes over time; determining a traffic growth rate based on the traffic data for the first period; determining second traffic data based on the traffic growth rate and the traffic data for the first period; and obtaining the scheduling threshold for the current period based on the second traffic data, wherein the second traffic data is the predicted traffic data for the current period.
2. The traffic scheduling method according to claim 1, characterized in that, The acquisition of traffic data for the first period includes: Get the bitrate of each user at each time point in the first period; The bandwidth at each time point is calculated based on the bitrate of all users at each time point in the first period to obtain the traffic data for the first period.
3. The traffic scheduling method according to claim 1, characterized in that, The step of obtaining the scheduling threshold for the current period based on the second traffic data includes: Multiple candidate thresholds are determined, and the cost corresponding to each candidate threshold is calculated based on the second traffic data; The lowest cost is determined from the costs corresponding to the plurality of candidate thresholds, and the candidate threshold corresponding to the lowest cost is determined as the scheduling threshold for the current period.
4. The traffic scheduling method according to claim 3, characterized in that, The determination of multiple candidate thresholds includes: Obtain the highest peak value of the second traffic data; The highest peak value is reduced by a preset step size to obtain a peak value reduction result until the highest peak value reduction result is zero. The highest peak value and each peak value reduction result are used as the multiple candidate thresholds.
5. The traffic scheduling method according to claim 3, characterized in that, The calculation of the cost corresponding to each candidate threshold based on the second traffic data includes: Generate a traffic data curve based on the second traffic data; A threshold line is determined based on any candidate threshold; the threshold line is a line that varies over time and has a constant bandwidth equal to the candidate threshold. Determine the area of the closed shape enclosed by the threshold line and the flow data curve; The target duration is determined based on the area, and the first cost corresponding to the duration-based billing method is determined based on the target duration. The highest peak value in the traffic data curve that is less than or equal to the candidate threshold is determined to obtain the target peak value, and the second cost corresponding to the peak billing method is determined based on the target peak value. The sum of the first cost and the second cost is determined as the cost corresponding to the candidate threshold.
6. The traffic scheduling method according to claim 5, characterized in that, The determination of the target duration based on the area includes: The average bitrate for each closed graph is determined based on the bitrate of all users within the time period corresponding to each closed graph. The duration of each closed shape is determined based on its area and the corresponding average bitrate. The sum of the durations corresponding to all the closed graphics is determined as the target duration.
7. The traffic scheduling method according to any one of claims 1 to 6, characterized in that, Also includes: Monitor the status of the first and second flow channels; If either the first flow channel or the second flow channel fails, the non-faulty channel in the first flow channel or the second flow channel will be designated as the target flow channel.
8. An electronic device, characterized in that, Includes memory and processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program to implement the traffic scheduling method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the traffic scheduling method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method of implementing charged duration based user fee rate switch
CN101163021A