Traffic scheduling method and device, equipment and storage medium

By calculating the number of online people and speech frequency in the live broadcast room, marking the large live broadcast room and dynamically adjusting the flow limit value, the problem of resource allocation imbalance in the mixed traffic scenario of multiple live broadcast rooms is solved, and the stability of the system and the improvement of user experience is achieved.

CN120378641APending Publication Date: 2025-07-25CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510635872.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the scenario of mixed traffic in multiple live broadcast rooms, the existing technology lacks an effective traffic scheduling mechanism, resulting in the system's capacity expansion lag and resource allocation imbalance when large traffic impacts, and the inability to dynamically perceive and predict traffic pressure, and there is a risk of service overload.

Method used

By obtaining the number of online people and speech frequency in the live broadcast room, calculating the traffic resource occupation ratio, marking the large live broadcast room and adjusting the current limit value, combining historical data prediction and real-time monitoring, dynamically adjusting the current limit operation, and introducing differentiated and elastic scheduling mechanisms.

Benefits of technology

Differentiated flow limits for large live broadcast rooms under the impact of large traffic are achieved, ensuring that small and medium-sized live broadcast rooms are guaranteed to obtain resource guarantees, improving system stability and user experience, and avoiding resource waste and overload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378641A_ABST
    Figure CN120378641A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic scheduling method, device and equipment and a storage medium, and the method comprises the steps: obtaining the number of online people and the speaking frequency of each live broadcast room, and calculating the traffic resource occupation proportion of each live broadcast room based on the number of online people and the speaking frequency; marking the live broadcast rooms with the traffic resource occupation proportions greater than a preset threshold in the live broadcast rooms as large live broadcast rooms; adjusting a current limiting value of the large live broadcast room based on a preset current limiting rule and the number of online people of the large live broadcast room; and executing a current limiting operation on the large live broadcast room based on the adjusted current limiting value. According to the invention, the large-flow live broadcast rooms and the common live broadcast rooms are processed in a differentiated manner, so that the medium and small live broadcast rooms can still obtain basic resource guarantee in a high-load state of the system. The technical problem that an effective traffic scheduling mechanism is lacked when a system encounters large traffic impact in a multi-live-broadcasting-room mixed traffic scene is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a traffic scheduling method, apparatus, device, and storage medium. Background Art

[0002] In the current real-time interaction scenario, the multi-live-room mixed traffic mode has become the mainstream application form. Especially in the live broadcast business, large-traffic live rooms and small- and medium-traffic live rooms often run in parallel. Currently, a passive expansion mechanism based on resource thresholds is generally adopted, that is, horizontal service expansion is triggered by monitoring the CPU or memory usage rate. Such a solution can cope in a single traffic scenario, but significant defects are exposed in a mixed traffic environment: First, when the instantaneous traffic surges, there is a lag in system expansion, and it is difficult to complete resource allocation in a short time, resulting in an increased risk of service overload; second, the flow limiting strategy uses a global fixed threshold, and different live rooms share the same flow limiting standard, resulting in the traffic of high-active live rooms squeezing the resources of small and medium live rooms, causing an imbalance in resource allocation; third, the system lacks the ability to dynamically sense and predict traffic pressure, and only relies on post-event resource expansion, and cannot actively intervene before the traffic peak. Summary of the Invention

[0003] The main purpose of this application is to provide a traffic scheduling method, apparatus, device, and storage medium, aiming to solve the technical problem that in a multi-live-room mixed traffic scenario, the system lacks an effective traffic scheduling mechanism when encountering a large traffic impact.

[0004] To achieve the above object, this application provides a traffic scheduling method, and the traffic scheduling method includes the following steps:

[0005] Obtain the online number of people and the speech frequency of each live room, and calculate the traffic resource occupancy ratio of each live room based on the online number of people and the speech frequency;

[0006] Mark the live rooms with the traffic resource occupancy ratio greater than a preset threshold in each live room as large live rooms;

[0007] Adjust the flow limiting value of the large live room based on a preset flow limiting rule and the online number of people in the large live room;

[0008] Perform a flow limiting operation on the large live room based on the adjusted flow limiting value.

[0009] In one embodiment, before the step of obtaining the online number of people and the speech frequency of each live room and calculating the traffic resource occupancy ratio of each live room based on the online number of people and the speech frequency, it includes:

[0010] Predict the traffic pressure value for a preset future period based on the pre-collected historical online number of people and historical message delivery volume, and obtain the traffic pressure curve for the preset future period;

[0011] According to the flow pressure curve in the preset future time period, allocate resources for the preset future time period.

[0012] In one embodiment, the step of predicting the flow pressure value for the preset future time period based on the pre-collected historical online number of people and historical message sending volume, and obtaining the flow pressure curve for the preset future time period includes:

[0013] Based on the pre-collected historical online number of people and historical message sending volume, combined with the preset activity factor within the preset future time period, predict the flow pressure value and draw the flow pressure curve for the preset future time period.

[0014] In one embodiment, after the step of obtaining the online number of people and the speech frequency in each live broadcast room, and calculating the proportion of flow resource occupancy in each live broadcast room based on the online number of people and the speech frequency, it includes:

[0015] Calculate the real-time flow pressure value according to the real-time online number of people and the real-time message sending volume;

[0016] Based on different thresholds reached by the real-time flow pressure value, trigger different levels of early warning and capacity expansion operations.

[0017] In one embodiment, the step of triggering different levels of early warning and capacity expansion operations based on different thresholds reached by the real-time flow pressure value includes:

[0018] When the real-time flow pressure value reaches the first threshold, trigger a first-level early warning and perform pre-allocation of resources;

[0019] When the real-time flow pressure value reaches the second threshold, trigger a second-level early warning and perform elastic capacity expansion operations;

[0020] When the real-time flow pressure value reaches the third threshold, trigger a second-level early warning and perform extreme capacity expansion operations.

[0021] In one embodiment, after the step of calculating the real-time flow pressure value according to the real-time online number of people and the real-time message sending volume, it includes:

[0022] If it is monitored that the real-time flow pressure value is lower than the preset pressure threshold, and / or, the current online number of people is lower than the preset number threshold, and / or, the current message sending volume is lower than the preset message sending volume, then increase the first flow limiting value of each live broadcast room;

[0023] The first flow limiting value is dynamically adjusted based on an inverse proportional relationship with the real-time online number of people.

[0024] In one embodiment, after the step of performing a flow limiting operation on the large live broadcast based on the adjusted flow limiting value, it includes:

[0025] When the resource occupied by the traffic of the large live broadcast room is not greater than the preset threshold, cancel the traffic limiting operation for the large live broadcast room.

[0026] In addition, to achieve the above object, the present application further provides a traffic scheduling device, and the traffic scheduling device includes:

[0027] A calculation module, configured to obtain the number of online people and the speech frequency of each live broadcast room, and calculate the traffic resource occupancy ratio of each live broadcast room based on the number of online people and the speech frequency;

[0028] A marking module, configured to mark the live broadcast rooms with the traffic resource occupancy ratio greater than the preset threshold in each live broadcast room as large live broadcast rooms;

[0029] An adjustment module, configured to adjust the traffic limiting value of the large live broadcast room based on a preset traffic limiting rule and the number of online people in the large live broadcast room;

[0030] An execution module, configured to perform a traffic limiting operation on the large live broadcast room based on the adjusted traffic limiting value.

[0031] In addition, to achieve the above object, the present application further provides a terminal device, and the terminal device includes a memory, a processor, and a traffic scheduling program stored on the memory and executable on the processor. When the traffic scheduling program is executed by the processor, the steps of the traffic scheduling method described above are implemented.

[0032] In addition, to achieve the above object, the present application further provides a computer-readable storage medium, and a traffic scheduling program is stored on the computer-readable storage medium. When the traffic scheduling program is executed by a processor, the steps of the traffic scheduling method described above are implemented.

[0033] One or more technical solutions proposed by the present application have at least the following technical effects:

[0034] First, obtain the number of online people and the speech frequency of each live broadcast room, and calculate the traffic resource occupancy ratio of each live broadcast room based on the number of online people and the speech frequency, so as to quantify the actual consumption of system resources by each live broadcast room. When the traffic resource occupancy ratio of a certain live broadcast room exceeds the preset threshold, it is marked as a large live broadcast room, forming a differential identification mechanism to avoid the resource allocation imbalance caused by all live broadcast rooms sharing the threshold under the fixed traffic limiting mode. Secondly, based on a preset traffic limiting rule and the number of online people in the large live broadcast room, adjust the traffic limiting value of the large live broadcast room. Directly associate the traffic limiting intensity with the user scale, and construct an elastic traffic limiting gradient matching the real-time load.

[0035] This application differentiates between high-traffic live rooms and ordinary live rooms, enabling small and medium-sized live rooms to still obtain basic resource guarantees under high system load. It solves the technical problem of the lack of an effective traffic scheduling mechanism when the system encounters a large traffic impact in a scenario of mixed traffic in multiple live rooms. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic flowchart of the first exemplary embodiment of the traffic scheduling method of this application;

[0037] Figure 2 It is a schematic flowchart of the second exemplary embodiment of the traffic scheduling method of this application;

[0038] Figure 3 It is a system architecture diagram related to the traffic scheduling method of this application;

[0039] Figure 4 It is a schematic diagram of the module structure of the traffic scheduling device in the embodiment of this application;

[0040] Figure 5 It is a schematic diagram of the device structure of the hardware operating environment related to the traffic scheduling method in the embodiment of this application.

[0041] The realization, functional features, and advantages of the purpose of this application will be further described in combination with the embodiments with reference to the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0042] It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application.

[0043] The main technical solution of this application is: obtaining the number of online users and the speech frequency of each live room, calculating the traffic resource occupancy ratio of each live room based on the number of online users and the speech frequency; marking the live rooms with the traffic resource occupancy ratio greater than a preset threshold among each live room as large live rooms; adjusting the traffic limit value of the large live rooms based on a preset traffic limit rule and the number of online users of the large live rooms; performing a traffic limit operation on the large live rooms based on the adjusted traffic limit value.

[0044] This application actually takes into account that in the current real-time interaction scenario, chat room systems generally adopt an elastic expansion mechanism based on resource utilization rate, and cope with traffic fluctuations by horizontal scaling. However, in the scenario of mixed traffic in multiple live rooms, when high-concurrency live rooms and small and medium-traffic live rooms are running simultaneously, especially when the instantaneous traffic of popular live broadcasts surges, the existing technology relies on CPU or memory utilization rate thresholds to trigger expansion. Due to the delay in resource allocation, it is difficult for the system to complete emergency response in a short time, resulting in service stability risks. To address the above problems, a fixed flow limiting strategy is generally adopted at present, where all live rooms share a unified flow limiting threshold, lacking differential scheduling capabilities, which makes the traffic of high-active live rooms easily occupy the resources of small and medium live rooms, causing an imbalance in resource allocation. The system can only passively bear the load under sudden traffic impacts until expansion is triggered, and there is a lack of a dynamic load reduction mechanism during this period, posing a potential risk of service collapse. The above problems highlight the lack of a traffic scheduling mechanism in the existing technology in the scenario of mixed traffic in multiple live rooms, and there is an urgent need to explore a more efficient solution.

[0045] Based on this, the embodiments of this application propose a solution: predicting the traffic pressure value for a future preset time period based on the pre-collected historical online number and historical message volume, and obtaining the traffic pressure curve for the future preset time period; allocating resources for the future preset time period according to the traffic pressure curve for the future preset time period. Obtain the online number and speech frequency of each live room, and calculate the proportion of traffic resource occupancy of each live room based on the online number and speech frequency; mark the live rooms with the proportion of traffic resource occupancy greater than a preset threshold in each live room as large live rooms; adjust the flow limiting value of the large live rooms based on the preset flow limiting rules and the online number of the large live rooms; perform a flow limiting operation on the large live rooms based on the adjusted flow limiting value. When the traffic occupied resources of the large live rooms do not exceed the preset threshold, cancel the flow limiting operation on the large live rooms.

[0046] Specifically, the following are the detailed steps of the first exemplary embodiment of the traffic scheduling method of this application:

[0047] Refer to Figure 1 , Figure 1 is the flowchart of the first exemplary embodiment of the traffic scheduling method of this application. In this embodiment, the traffic scheduling method includes steps S10 to S40:

[0048] Step S10, obtain the online number and speech frequency of each live room, and calculate the proportion of traffic resource occupancy of each live room based on the online number and speech frequency;

[0049] Specifically, first obtain the real-time online number and real-time speech frequency of each live broadcast room. The real-time online number is an important indicator to measure the scale of active users in the live broadcast room. The more online people, usually the greater the demand for system resources by the live broadcast room. The real-time speech frequency reflects the active degree of user interaction in the live broadcast room. A high speech frequency means more message transmission and processing requirements.

[0050] Furthermore, calculate the proportion of traffic resource occupancy of each live broadcast room based on the online number and speech frequency.

[0051] A feasible implementation method. For the i-th live broadcast room, its proportion of traffic resource occupancy Q i can be calculated by the following formula:

[0052]

[0053] where Pi is the real-time online number of the i-th live broadcast room, Mi is the real-time speech frequency (TPS, that is, the number of transactions processed per second) of the i-th live broadcast room, N is the total number of live broadcast rooms simultaneously on air in the system, and Q i is the proportion of traffic resource occupancy of the i-th live broadcast room.

[0054] Through the above formula, the traffic resource occupancy of each live broadcast room can be quantified and normalized. This calculation method comprehensively considers two key factors, the online number and the speech frequency, and can more accurately reflect the actual demand of each live broadcast room for system resources. For example, a live broadcast room with a large online number and a high speech frequency will have a higher proportion of traffic resource occupancy, indicating a greater demand for system resources; while a live broadcast room with a small online number and a low speech frequency will have a lower proportion of traffic resource occupancy.

[0055] It should be noted that the system resources here mainly include the CPU, memory, network bandwidth, etc. of the server. The weights of different resources in traffic scheduling may be different. Usually, the weights of the CPU and network bandwidth are relatively high because they have a more direct impact on message processing and transmission.

[0056] Another feasible implementation method. For live broadcast rooms that are on air simultaneously in multiple sessions, the proportion of traffic resource occupancy of each live broadcast room in each session can be calculated in the following way: Determine the benchmark proportion of traffic resource occupancy of each live broadcast room in each session by analyzing historical data and the allocation of system resources. For example, according to past experience, small live broadcast rooms may occupy 10% of the traffic resources, medium-sized live broadcast rooms occupy 20%, and large live broadcast rooms occupy 30%. Then, adjust the benchmark proportion according to the real-time online number and speech frequency.

[0057] Step S20, mark the live broadcast rooms with the proportion of traffic resource occupancy greater than the preset threshold in each live broadcast room as large live broadcast rooms;

[0058] Specifically, based on the traffic resource occupancy ratios of each live streaming room obtained in step S10, and according to a preset threshold, check the traffic resource occupancy ratio of each live streaming room one by one. If the traffic resource occupancy ratio of a certain live streaming room exceeds the preset threshold, mark it as a large live streaming room. The threshold is dynamically set based on the total system resources, historical traffic data, and the high availability goal of the system design. For example, when the system load is low, the threshold can be appropriately increased to allow more live streaming rooms to occupy resources; while when the system load is high, the threshold needs to be decreased to strictly control the resource occupancy of large traffic live streaming rooms.

[0059] Step S30, adjust the traffic limiting value of the large live streaming room based on the preset traffic limiting rules and the number of online users in the large live streaming room;

[0060] Specifically, calculate an appropriate traffic limiting value according to the number of online users in the large live streaming room and the preset traffic limiting rules. The traffic limiting rules can be formulated based on historical data and system experience. For example, based on historical experience, when the number of online users in the live streaming room is 20,000, the traffic limiting value can be set to 50 TPS; when the number of online users is 100,000, the traffic limiting value is reduced to 10 TPS. This dynamic adjustment mechanism can flexibly control the speech frequency according to the scale and traffic pressure of the live streaming room, avoiding resource waste or system overload caused by a fixed traffic limiting value.

[0061] When adjusting the traffic limiting value, comprehensively consider the real-time traffic resource occupancy ratio of the large live streaming room and the current overall load situation of the system. If the system resources are tight, in order to quickly reduce the system load, the traffic limiting value will be more strict; if the system resources are relatively abundant, the traffic limiting value can be appropriately relaxed to improve the user experience of the live streaming room. The adjusted traffic limiting value will be sent to the traffic limiter in the message upstream service through the intelligent scheduling service, and the traffic limiter intercepts the exceeding requests according to the new traffic limiting value.

[0062] Step S40, perform a traffic limiting operation on the large live streaming room based on the adjusted traffic limiting value;

[0063] In a feasible implementation manner, the intelligent scheduling service sends a dynamic traffic limiting instruction to the traffic limiter in the message upstream service according to the adjusted traffic limiting value above. After receiving the instruction, the traffic limiter immediately adjusts the traffic limiting strategy and intercepts the speech requests that exceed the traffic limiting value. The traffic limiting operation is real-time and can quickly respond to traffic changes to ensure that the traffic resource occupancy of the large live streaming room does not exceed the set threshold.

[0064] In a feasible implementation manner, steps S01 - S02 may be included before step S10:

[0065] S01. Based on the pre - collected historical online number and historical message distribution volume, predict the traffic pressure value for a preset future period to obtain the traffic pressure curve for the preset future period.

[0066] In a feasible implementation manner, step S01 may include step S011:

[0067] Step S011. Based on the pre - collected historical online number and historical message distribution volume, combined with the preset activity factors within the preset future period, predict the traffic pressure value and draw the traffic pressure curve for the preset future period.

[0068] In a feasible implementation manner, extract historical data from the database or log file. These data may include the online number and the corresponding message distribution volume of each live - broadcast room in multiple past time periods. Clean and pre - process these data to remove outliers and noise data to ensure the accuracy and reliability of the data. Then, analyze the historical data, draw the trend charts of the historical online number and message distribution volume, and observe their change rules and characteristics, such as whether there are periodic fluctuations, the time points when the peaks appear, etc. Next, consider the preset activity factors within the preset future period, such as the time nodes of lottery draws, quizzes, etc. These activity factors may cause an increase in the online number and message distribution volume, thus affecting the traffic pressure. According to the historical data and activity factors, select an appropriate time - series prediction algorithm, such as the ARIMA model, exponential smoothing method, etc., to predict the traffic pressure value for the preset future period. During the prediction process, comprehensively consider the periodicity, trend of the data, and the influence of activity factors to improve the prediction accuracy. Finally, draw the traffic pressure curve for the preset future period according to the predicted traffic pressure values in chronological order. This curve intuitively shows the traffic pressure conditions at different future time points and provides a basis for subsequent resource allocation. In this way, the change of traffic pressure in the future period can be understood in advance, so as to more reasonably plan and allocate resources and ensure the stable operation of the system.

[0069] Step S02. According to the traffic pressure curve for the preset future period, allocate resources for the preset future period.

[0070] Specifically, conduct an in-depth analysis of the above flow-pressure curve to identify the peak and trough periods of flow and pressure, as well as the trends and patterns of pressure changes. Based on this information, evaluate the resource requirements that the system may face at different time points, such as the computing power of the server, network bandwidth, storage capacity, etc. Next, combine the current resource status of the system, including the existing number of servers, performance parameters, network configuration, etc., and formulate corresponding resource allocation plans. For the predicted high flow-pressure periods, increase server resources in advance, such as starting more virtual machine instances through an elastic scaling mechanism, or deploying additional service processes on physical servers. In addition, data storage can be expanded, that is, according to the prediction of the message distribution volume, expand the database in advance or add cache servers to ensure the efficient reading, writing, and storage of data.

[0071] It should be noted that during the resource allocation process, it is necessary to comprehensively consider the balance between cost and performance, avoid over-allocation resulting in resource waste, and ensure that the system can operate stably under high flow pressure. Finally, test and verify the allocated resources, simulate the flow-pressure situation in the preset future period, check the response ability and performance of the system, and adjust and optimize the resource allocation plan in a timely manner to ensure its effectiveness and reliability.

[0072] In a feasible implementation manner, after step S40, step S50 may be included:

[0073] Step S50, when the resource occupied by the traffic of the large live broadcast room is not greater than the preset threshold, cancel the traffic limiting operation on the large live broadcast room.

[0074] Specifically, after the system executes the traffic limiting operation, it will continuously monitor the resource occupancy of the large live broadcast room. By obtaining the online number and speech frequency data of the live broadcast room in real time, the system can dynamically calculate the current resource occupancy ratio. When the resource occupancy ratio of the large live broadcast room drops below the preset threshold, the system will trigger the process of canceling the traffic limiting operation.

[0075] In a feasible implementation manner, before canceling the traffic limiting operation, the system will conduct a comprehensive evaluation of the current traffic situation. If the resource occupancy ratio of the large live broadcast room remains below the threshold for a certain period of time (such as 5 minutes), it is considered that the pressure on the system resources by this live broadcast room has been significantly reduced, and thus the traffic limiting operation is canceled. This process needs to ensure that the decrease in traffic is stable to avoid frequent opening and closing of the traffic limiting operation due to short-term traffic fluctuations, which may have a negative impact on system performance and user experience.

[0076] After the traffic limiting operation is cancelled, the system will record relevant logs, including key data such as the time of cancelling the traffic limiting, the current proportion of traffic resource occupancy, the number of online users, and the speech frequency. These log information will be used for subsequent monitoring and analysis to help the operation and maintenance personnel evaluate the effect of the traffic limiting operation and optimize the traffic limiting strategy. At the same time, the system will continue to monitor the traffic situation of the large live room in real time so that the traffic limiting operation can be restarted in time when the traffic rises again.

[0077] In addition, the system will also mark the live rooms where the traffic limiting operation is cancelled for special attention in subsequent traffic monitoring. If a certain live room frequently triggers the traffic limiting operation, the system may send a warning message to the operation and maintenance personnel, indicating that further analysis and optimization of the live room are required. For example, it may be necessary to adjust the interaction strategy of the live room or optimize the resource allocation mechanism of the system to better handle high-traffic scenarios.

[0078] Furthermore, referring to Figure 2 , Figure 2 is a schematic flowchart of the second exemplary embodiment of the traffic scheduling method of the present application. In this embodiment, on the basis of the first embodiment, the traffic scheduling method includes the following steps:

[0079] Step S60, calculate the real-time traffic pressure value according to the real-time number of online users and the real-time message sending volume;

[0080] Step S70, trigger different levels of warning and expansion operations based on different thresholds reached by the real-time traffic pressure value.

[0081] Specifically, before implementing the above step S60, obtain the number of online users and the speech frequency of each live room, calculate the proportion of traffic resource occupancy of each live room based on the number of online users and the speech frequency, mark the live rooms with the proportion of traffic resource occupancy greater than the preset threshold in each live room as large live rooms, adjust the traffic limiting value of the large live rooms based on the preset traffic limiting rules and the number of online users in the large live rooms, and perform the traffic limiting operation on the large live rooms based on the adjusted traffic limiting value.

[0082] On the basis of implementing the above traffic scheduling, in order to further enhance the system's ability to respond to traffic emergencies, a dynamic capacity expansion strategy is introduced. These two parts complement each other. When the above traffic scheduling strategy quickly reduces the system load by identifying large live rooms and adjusting the flow limiting value, the dynamic capacity expansion strategy is immediately activated. It accurately judges the current traffic carrying state of the system based on the traffic pressure value calculated in real time. Once the traffic pressure value touches the preset threshold, the system will automatically trigger the corresponding level of warning and synchronously execute the capacity expansion operation to add additional processing capacity to the system. In this way, the two work together to quickly relieve the impact brought by the traffic peak and ensure that the system has sufficient resource support when facing continuously increasing traffic, thus comprehensively guaranteeing the stability and fluency of the live broadcast system and improving the user experience.

[0083] Therefore, further, according to the real-time online number and the real-time message sending volume, calculate the real-time traffic pressure value, and trigger different levels of warnings and capacity expansion operations based on different thresholds reached by the real-time traffic pressure value.

[0084] According to the real-time online number and the real-time message sending volume, calculate the real-time traffic pressure value. Specifically,

[0085] The system continuously collects the real-time online number and the real-time message sending volume of each live room through real-time monitoring. The real-time message sending volume can include the TPS of speech messages and instruction messages. The online number data comes from the active connection number statistics maintained by the long connection gateway service, and the message sending volume is obtained through the number of messages processed per second recorded by the message uplink service. Based on the above data, the following formula can be used to calculate the real-time traffic pressure value:

[0086]

[0087] Among them, N is the total number of live rooms currently on air, P n is the real-time online number of the nth live room, M n is the TPS of instruction messages of the nth live room, I n is the TPS of instruction messages (such as non-speech operations like likes and gifts) of the nth live room, K is the number of currently available server instances, and C max is the maximum push capacity of a single instance.

[0088] During the calculation process, set to update the data every preset time to ensure real-time performance.

[0089] Exemplarily, if there are currently 3 live streaming rooms with online numbers of 20,000, 10,000, and 5,000 respectively, message sending volumes of 50 TPS, 30 TPS, and 10 TPS respectively, instruction message TPS of 20 TPS, 10 TPS, and 5 TPS respectively, and K = 5, then the traffic pressure value is calculated as Q = 0.68, indicating that the current system load is 68%. After the calculation is completed, the Q value is compared with a preset threshold to provide a basis for subsequent early warning and capacity expansion.

[0090] In a feasible implementation manner, step S70 may include steps S71 to S73:

[0091] Step S71, when the real-time traffic pressure value reaches the first threshold, trigger a first-level early warning and perform resource pre-allocation;

[0092] Step S72, when the real-time traffic pressure value reaches the second threshold, trigger a second-level early warning and perform elastic capacity expansion operation;

[0093] Step S73, when the real-time traffic pressure value reaches the third threshold, trigger a second-level early warning and perform extreme capacity expansion operation.

[0094] In a feasible implementation manner, when the traffic pressure value reaches the first threshold, the system triggers a first-level early warning, and at this time, resource pre-allocation is started. The system quickly calculates the required resources, predicts future resource requirements based on historical data and preset activity factors, starts standby server instances in advance, and adjusts the network configuration to optimize traffic distribution to ensure being prepared before the traffic peak.

[0095] If the traffic pressure value continues to rise to the second threshold, a second-level early warning is triggered, and the elastic capacity expansion operation is immediately executed. The system dynamically increases server resources according to the real-time traffic pressure and resource usage conditions. This includes quickly starting new virtual machine instances or deploying additional service processes on physical servers, while optimizing the database connection pool and increasing cache server resources to improve data processing and storage capabilities, so as to effectively cope with medium-level traffic bursts.

[0096] When the traffic pressure value reaches the third threshold, the system enters the extreme capacity expansion state. At this time, the system will mobilize all available resources, including temporarily renting cloud servers, to ensure that the system is not overwhelmed by the traffic peak. The system will quickly connect to the API interface of the cloud service provider to request additional computing resources, and after these resources are online, re-distribute the traffic to ensure that each live streaming room can obtain a basic smooth experience. At the same time, the system will perform degradation processing on non-critical services to reduce unnecessary resource consumption and ensure the stable operation of core services.

[0097] Through step-by-step response, the system can adjust resource allocation in a timely manner under different traffic pressures, effectively respond to traffic emergencies, ensure the stability and high availability of the system, and provide users with a smooth live streaming experience.

[0098] Further, in a feasible implementation manner, after step S60, steps S81 - S82 may be included:

[0099] Step S81, if the monitored real-time traffic pressure value is lower than the preset pressure threshold, and / or the current number of online users is lower than the preset number threshold, and / or the current message distribution volume is lower than the preset message distribution volume, then increase the first flow-limiting value of each live broadcast room;

[0100] Specifically, when it is detected that the real-time traffic pressure value is lower than the preset pressure threshold, it indicates that the overall resource load of the current system is at a relatively low level and has additional processing capabilities. At this time, obtain the data of the number of online users and the message distribution volume in each live broadcast room, and further analyze the resource occupancy of each live broadcast room. If the current number of online users is lower than the preset number threshold, and / or the current message distribution volume is lower than the preset message distribution volume, the system will determine that the live broadcast room is in a low-activity state. In this case, the intelligent scheduling service will automatically trigger the flow-limiting value adjustment mechanism to increase the first flow-limiting value of this live broadcast room.

[0101] In addition, set a maximum flow-limiting threshold to prevent the system from being impacted by sudden traffic due to overly relaxed flow-limiting values. After increasing the flow-limiting value, the system dynamically updates the configuration through the flow limiter in the message upstream service, allowing more speech requests to pass through, thereby increasing the interaction frequency and user participation in the live broadcast room. During the adjustment process, the system continuously monitors the resource usage situation to ensure that the increased flow-limiting value will not cause the CPU or memory resources to be overloaded. If the resource usage rate approaches the warning threshold, the system will automatically callback the flow-limiting value to maintain stability.

[0102] Step S82, the first flow-limiting value is dynamically adjusted based on an inverse relationship with the real-time number of online users.

[0103] The dynamic adjustment of the first flow-limiting value is achieved based on the real-time number of online users and the preset inverse relationship model.

[0104] Specifically, the system has a built-in inverse function relationship:

[0105]

[0106] Among them, L is the real-time flow-limiting value (TPS), K is the benchmark constant, P is the real-time number of online users, and α is the smoothing factor, which is used to avoid the abnormal increase of the flow-limiting value caused by too small a denominator when the number of online users is extremely low.

[0107] Through this formula, the flow-limiting value decreases as the number of online users increases, and vice versa.

[0108] Exemplarily, when the number of online users is 500, the flow limiting value is calculated as: L = 10 5 / (500 + 100) ≈ 166 TPS;

[0109] When the number of online users rises to 2000, the flow limiting value drops to L = 10 5 / (2000 + 100) ≈ 47 TPS. The system re - collects the online user data every 1 second and updates the flow limiting value to ensure real - time adjustment.

[0110] Furthermore, to cope with sudden traffic fluctuations, a sliding window mechanism can be introduced. The weighted average of the number of online users in the last 3 time windows is taken as the input, avoiding frequent jumps in the flow limiting value due to instantaneous fluctuations. When it is detected that the flow limiting value of a certain live - broadcast room has been increased 3 times in a row due to a decrease in the number of online users, the system will record the upward trend of the activity of this live - broadcast room and synchronously optimize the K value in the inverse ratio model to adapt to the characteristics of different live - broadcast rooms (for example, the K value can be appropriately increased for entertainment - type live - broadcast rooms). The above adjustment process is completely automated without manual intervention, which not only ensures the stability of the system but also maximizes the resource utilization rate and user experience.

[0111] Furthermore, based on Figure 3 , Figure 3 FIG.

[0112] There are two types of clients. One is the APP used by users, and the other is the host platform used by hosts. Users and hosts establish long - connections with the long - connection gateway service by entering the live - broadcast room for message interaction. The APP pushes the speech to the message up - stream service through a short - connection, and the host platform pushes the host's speech and various activity instructions to the message up - stream service through a short - connection. The message up - stream service receives the short - link messages from various clients, packages the messages and writes them into the data middleware for consumption by the down - stream service. The data middleware is used to decouple the up - and down - stream services and smooth the message traffic peaks. The long - connection gateway service is used to manage the long - connection requests of client users, maintain them in memory, and at the same time consume the messages from the data middleware and push them to the clients through long - connections. The data storage service is used to consume the messages from the data middleware and store them in the database, recording various interaction messages in the chat room. The intelligent scheduling service is used to collect real - time data, calculate and predict the traffic pressure value in real - time, provide progressive warnings and adjust the flow limiting value of the up - stream service limiter at the same time.

[0113] The scheduling process of the traffic scheduling method of this application based on the above - mentioned chat room system is as follows:

[0114] Users and streamers enter the live streaming room through their respective clients and establish long connections with the long connection gateway service for message interaction. The user APP pushes the user's speech to the message upstream service through a short connection, while the streamer platform pushes the streamer's speech and various activity instructions to the message upstream service through a short connection.

[0115] The message upstream service receives short connection messages from the client layer, wraps and processes these messages, and then writes them into the data middleware for consumption by the downstream service.

[0116] The data middleware is used to decouple the upstream and downstream services and perform traffic peak shaving to mitigate the impact of traffic peaks on the system.

[0117] The long connection gateway service manages the long connection requests of client users and maintains these requests in memory. At the same time, it consumes messages from the data middleware and pushes the messages to the client through the long connection.

[0118] After consuming messages from the data middleware, the data storage service stores these messages in the database to record various interaction messages in the chat room.

[0119] The intelligent scheduling service first collects real-time data, including the number of online users, the real-time speech interaction frequency, the message distribution volume, and the hardware resource consumption, etc. According to the collected real-time data, the intelligent scheduling service calculates the current traffic pressure value. When the traffic pressure value reaches the warning threshold, the intelligent scheduling service issues a warning to notify the operation and maintenance and development personnel. The intelligent scheduling service dynamically adjusts the traffic limiting value of the upstream service limiter according to the traffic pressure value and the warning information. For example, it reduces the traffic limiting value during traffic peaks to reduce the system load; it increases the traffic limiting value during traffic troughs to improve the activity of the live streaming room. For the identified high-traffic live streaming rooms, the intelligent scheduling service will perform traffic isolation and limit their speech TPS. When the traffic pressure value of the high-traffic live streaming room decreases, the intelligent scheduling service will automatically restore its traffic limiting value. The intelligent scheduling service works in coordination with other services (such as the message upstream service, the long connection gateway service, and the data middleware) to achieve intelligent and balanced traffic scheduling. For example, the intelligent scheduling service can notify the long connection gateway service to reduce the message push frequency to reduce the network bandwidth occupancy.

[0120] Through the above scheduling process, the system can achieve intelligent and balanced traffic scheduling, improving the high availability and stability of the system.

[0121] In addition, this application also proposes a traffic scheduling device, and the traffic scheduling device includes:

[0122] A calculation module 10, configured to obtain the number of online users and the speech frequency of each live streaming room, and calculate the traffic resource occupancy ratio of each live streaming room based on the number of online users and the speech frequency;

[0123] A marking module 20 is configured to mark the live rooms in which the proportion of the occupied traffic resources is greater than a preset threshold in each live room as large live rooms;

[0124] An adjustment module 30 is configured to adjust the traffic limiting value of the large live rooms based on a preset traffic limiting rule and the number of online users in the large live rooms;

[0125] An execution module 40 is configured to perform a traffic limiting operation on the large live rooms based on the adjusted traffic limiting value.

[0126] The traffic scheduling device provided in this application adopts the traffic scheduling method in the above embodiment, aiming to solve the technical problem that in a multi-live-room mixed traffic scenario, the system lacks an effective traffic scheduling mechanism when encountering a large traffic impact. Compared with the prior art, the beneficial effects of the traffic scheduling device provided in this application are the same as those of the traffic scheduling method provided in the above embodiment, and other technical features in the traffic scheduling device are the same as the features disclosed in the method of the above embodiment, which will not be elaborated herein.

[0127] This application provides a traffic scheduling device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the traffic scheduling method in the first embodiment above.

[0128] The traffic scheduling device in the embodiment of this application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The illustrated traffic scheduling device is only an example and should not impose any limitation on the functions and usage scope of the embodiments of this application.

[0129] Such as Figure 5As shown in the figure, the traffic scheduling device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to the program stored in the read-only memory 1002 or the program loaded from the storage device 1003 into the random access memory 1004. In the random access memory 1004, various programs and data required for the operation of the traffic scheduling device are also stored. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other through a bus 1005. The input / output interface 1006 is also connected to the bus. Generally, the following systems may be connected to the input / output interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the traffic scheduling device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a traffic scheduling device with various systems, it should be understood that it is not required to implement or have all the shown systems. More or fewer systems may be implemented or had alternatively.

[0130] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are executed.

[0131] The traffic scheduling device provided by the present application adopts the traffic scheduling method in the above-mentioned embodiment, aiming to solve the technical problem that in the multi-live-streaming-room mixed traffic scenario, when the system encounters a large traffic impact, there is a lack of an effective traffic scheduling mechanism. Compared with the prior art, the beneficial effects of the traffic scheduling device provided by the present application are the same as those of the traffic scheduling method provided by the above-mentioned embodiment, and other technical features in the traffic scheduling device are the same as those disclosed in the method of the previous embodiment, which will not be elaborated here.

[0132] It should be understood that each part disclosed in this application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.

[0133] As described above, the above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application, and all of them should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

[0134] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the traffic scheduling method in the above embodiments.

[0135] The computer-readable storage medium provided by this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system or device. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0136] The above computer-readable storage medium can be included in the traffic scheduling device; it can also exist separately without being assembled into the traffic scheduling device.

[0137] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN: Local Area Network) or a wide area network (WAN: Wide Area Network), or it can be connected to an external computer (for example, by connecting through the Internet using an Internet service provider).

[0138] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutively represented blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0139] The modules described in the embodiments of this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.

[0140] The readable storage medium provided by this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned traffic scheduling method, aiming to solve the technical problem of the lack of an effective traffic scheduling mechanism when the system encounters a large traffic impact in a multi-live-stream mixed traffic scenario. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the traffic scheduling method provided by the above embodiments, and will not be elaborated here.

[0141] The present application also provides a computer program product, including a computer program, which implements the steps of the traffic scheduling method as described above when executed by a processor.

[0142] The computer program product provided by the present application aims to solve the technical problem that in the scenario of mixed traffic in multiple live broadcast rooms, the system lacks an effective traffic scheduling mechanism when encountering a large traffic impact. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the traffic scheduling method provided by the above embodiments, and will not be elaborated here.

[0143] Compared with the prior art, the traffic scheduling method, device, equipment, medium and computer product proposed in the embodiments of the present application extract the service feature information of the target service, perform data standardization processing on the service feature information to obtain standard feature data, perform hash processing on the standard feature data to obtain unique feature data, perform numerical processing and splicing processing on the unique feature data to obtain the first service feature value, accumulate the first service feature values of the target service to obtain the target service feature value, and finally compare the target service feature value with the feature value set to obtain the traffic scheduling result. It is more efficient, flexible and reliable than the traditional method of generating a unique key value or a continuous serial number for each service to identify duplicate services. Based on the solution of the present application, by simply transforming the services in complex scenarios through a series of steps, and finally transforming them into the comparison of two numbers, the comparison process is very intuitive and efficient. The system only needs to simply compare whether these two numerical values are equal to quickly determine whether two services are exactly the same.

[0144] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or system including that element.

[0145] The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0146] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of the present application.

[0147] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A traffic scheduling method, characterized in that, The described traffic scheduling method includes: Obtaining the online number of people and the speech frequency of each live broadcast room, and calculating the traffic resource occupancy ratio of each live broadcast room based on the online number of people and the speech frequency; Marking the live broadcast rooms with a traffic resource occupancy ratio greater than a preset threshold in each live broadcast room as large live broadcast rooms; Adjusting the traffic limiting value of the large live broadcast rooms based on a preset traffic limiting rule and the online number of people in the large live broadcast rooms; Performing a traffic limiting operation on the large live broadcast rooms based on the adjusted traffic limiting value.

2. The traffic scheduling method according to claim 1, wherein Before the step of obtaining the online number of people and the speech frequency of each live broadcast room, and calculating the traffic resource occupancy ratio of each live broadcast room based on the online number of people and the speech frequency, it includes: Predicting the traffic pressure value for a preset future time period based on the pre-collected historical online number of people and historical message sending volume, and obtaining a traffic pressure curve for the preset future time period; Allocating resources for the preset future time period according to the traffic pressure curve for the preset future time period.

3. The traffic scheduling method according to claim 2, wherein The step of predicting the traffic pressure value for a preset future time period based on the pre-collected historical online number of people and historical message sending volume, and obtaining a traffic pressure curve for the preset future time period includes: Predicting the traffic pressure value based on the pre-collected historical online number of people and historical message sending volume, in combination with a preset activity factor within the preset future time period, and drawing a traffic pressure curve for the preset future time period.

4. The traffic scheduling method according to claim 1, characterized in that After the step of obtaining the online number of people and the speech frequency of each live broadcast room, and calculating the traffic resource occupancy ratio of each live broadcast room based on the online number of people and the speech frequency, it includes: Calculating the real-time traffic pressure value according to the real-time online number of people and the real-time message sending volume; Triggering different levels of early warning and capacity expansion operations based on different thresholds reached by the real-time traffic pressure value.

5. The traffic scheduling method according to claim 4, wherein The step of triggering different levels of early warning and capacity expansion operations based on different thresholds reached by the real-time traffic pressure value includes: When the real-time traffic pressure value reaches the first threshold, triggering a first-level early warning and performing pre-allocation of resources; When the real-time traffic pressure value reaches the second threshold, triggering a second-level early warning and performing elastic capacity expansion operations; When the real-time traffic pressure value reaches the third threshold, triggering a second-level early warning and performing extreme capacity expansion operations.

6. The traffic scheduling method according to claim 4, wherein After the step of calculating the real-time traffic pressure value according to the real-time online number of people and the real-time message sending volume, it includes: If it is monitored that the real-time traffic pressure value is lower than a preset pressure threshold, and / or, the current online number of people is lower than a preset number threshold, and / or, the current message sending volume is lower than a preset message sending volume, then increasing the first traffic limiting value of each live broadcast room; The first traffic limiting value is dynamically adjusted based on an inverse relationship with the real-time online number of people.

7. The traffic scheduling method according to claim 1, wherein After the step of performing a traffic limiting operation on the large live broadcast based on the adjusted traffic limiting value, it includes: When the traffic occupied resources of the large live broadcast room are not greater than a preset threshold, canceling the traffic limiting operation on the large live broadcast room.

8. A traffic scheduling device, characterized in that, The device includes: A calculation module, configured to obtain the online number of people and the speech frequency of each live broadcast room, and calculate the traffic resource occupancy ratio of each live broadcast room based on the online number of people and the speech frequency; A marking module, configured to mark the live broadcast rooms with a traffic resource occupancy ratio greater than a preset threshold in each live broadcast room as large live broadcast rooms; An adjustment module, configured to adjust the traffic limiting value of the large live broadcast room based on a preset traffic limiting rule and the number of online users in the large live broadcast room; An execution module, configured to perform a traffic limiting operation on the large live broadcast room based on the adjusted traffic limiting value.

9. A traffic scheduling device, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the computer program is configured to implement the steps of the traffic scheduling method according to any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the traffic scheduling method according to any one of claims 1 to 7.