Load balancing method and device for audio and video service cluster and electronic equipment

By using TWAMP protocol in the audio and video service cluster for network detection and dynamic resource allocation, the problem that traditional load balancing methods cannot evenly allocate long-term stateful services, and improve the stability and user experience of audio and video services.

CN120342960APending Publication Date: 2025-07-18中国邮政储蓄银行股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510493576.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

Traditional load balancing methods cannot evenly distribute long-term and stateful service loads to different service nodes, resulting in a decline in the stability and user experience of real-time audio and video services.

Method used

The media entrance service node is used to send the status information of the media forwarding service node, and network detection is carried out through the TWAMP protocol, network quality is evaluated and resource allocation is dynamically adjusted. Combined with indicators such as network connectivity, packet loss rate, time delay and bandwidth, resource allocation of audio and video service clusters is optimized.

Benefits of technology

It improves the long-term stability and user experience of audio and video services, reduces latency and packet loss rates, improves transmission fluency and clarity, and meets the needs of high concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342960A_ABST
    Figure CN120342960A_ABST
Patent Text Reader

Abstract

The invention provides a load balancing method and device for an audio and video service cluster and electronic equipment. The method comprises the following steps of: sending state information of a media forwarding service node to a terminal by adopting a media entry service node under the condition that the terminal is detected to be connected to a network and request an audio / video service, and sending the state information of the media forwarding service node to the terminal under the condition that the state information of the media forwarding service node received by the terminal represents that the state is normal, starting a network detection service based on a TWAMP protocol to carry out network detection on each media forwarding service node so as to determine a network quality score of the terminal and obtain operation information of each media forwarding service node, and carrying out resource allocation on the media forwarding service nodes of the audio and video service cluster according to the operation information of the media forwarding service nodes and the network quality score of the terminal. The problem that a traditional load balancing method cannot uniformly distribute long-time continuous and stateful service loads to different services is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of load balancing for audio - video service clusters. Specifically, it relates to a load balancing method, device, computer - readable storage medium, and electronic device for an audio - video service cluster. Background Art

[0002] Real - time audio - video refers to the technology and applications of real - time transmission of audio and video data over the Internet or local area network. This technology allows users to communicate and interact in real - time with almost no delay. Real - time audio - video is widely used in fields such as video conferencing, online education, telemedicine, live streaming, and social networks.

[0003] With the rapid progress of information technology, real - time audio - video conferencing and real - time audio - video calls have deeply penetrated into every corner of people's daily lives, and the requirements for load balancing of real - time audio - video service clusters are also getting higher and higher. However, in terms of load balancing of service clusters in the field of real - time audio - video, whether using traditional NAT, DNS, or reverse proxy, for each short - time stateless request, such as an http request, the request is dispersed to any one of the service nodes in the service cluster for processing. However, in the field of real - time audio - video, the requests and tasks of real - time audio - video are long - term and stateful, such as creating a room, joining a room, managing a room, leaving a room, etc., which have a sequence and state transition. It is not possible to allocate the task of joining a room to a service node without that room. After successfully joining the room, relevant service node resources need to be used for a long time to process the transmission, encoding, and decoding of audio - video data until the leaving - room task. Traditional load - balancing methods cannot evenly distribute long - term and stateful service loads to different services, so they are not suitable for application in the field of real - time audio - video. Summary of the Invention

[0004] The main objective of this application is to provide a load - balancing method, device, computer - readable storage medium, and electronic device for an audio - video service cluster, so as to at least solve the problem that traditional load - balancing methods cannot evenly distribute long - term and stateful service loads to different services.

[0005] To achieve the above object, according to one aspect of the present application, a load balancing method for an audio - video service cluster is provided, including: when detecting that a terminal is connected to the network and requests an audio - video service, using a media entry service node to send status information of a media forwarding service node to the terminal, where the media entry service node is an allocation node for the audio - video service, and the media forwarding service node is a processing node for processing the audio - video service; when the status information of the media forwarding service node received by the terminal indicates normal status, starting a network detection service based on the TWAMP protocol to perform network detection on each media forwarding service node to determine the network quality score of the terminal, where the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth; obtaining operation information of each media forwarding service node, and performing resource allocation for the media forwarding service nodes of the audio - video service cluster according to the operation information of the media forwarding service node and the network quality score of the terminal.

[0006] Optionally, starting a network detection service based on the TWAMP protocol to perform network detection on each media forwarding service node to determine the network quality score of the terminal includes: when the network connectivity between the terminal and each media forwarding service node is normal connectivity, the network detection service based on the TWAMP protocol respectively determines the network bandwidth score, network time delay score, and network packet loss rate score of each media forwarding service node; based on the network bandwidth score, the network time delay score, and the network packet loss rate score, determining the multiple network quality scores of the load connected to each media forwarding service node.

[0007] Optionally, the status information includes the number of running rooms and the remaining bandwidth. Obtaining the status information of each media forwarding service node and performing resource allocation for the media forwarding service nodes of the audio - video service cluster according to the operation information of the media forwarding service node and the network quality score of the terminal includes: obtaining the number of running rooms and the remaining bandwidth of each media forwarding service node, and evaluating the available resources of each media forwarding service node according to the number of running rooms and the remaining bandwidth, where a running room represents a spatial carrier for audio - video interaction of multiple terminals; arranging the multiple network quality scores in descending order to obtain a network quality score sequence; performing resource allocation for the media forwarding service nodes of the audio - video service cluster according to the available resources of each media forwarding service node and the network quality score sequence.

[0008] Optionally, based on the network bandwidth score, the network latency score, and the network packet loss rate score, determine multiple network quality scores for the connection between the load and each of the media forwarding service nodes, including: determining multiple network quality scores for the connection between the load and each of the media forwarding service nodes according to the formula: i = ax + by + cz, where i is the network quality score, x is the network bandwidth score, y is the network latency score, z is the network packet loss rate score, and a, b, and c are weight coefficients, and a + b + c = 1.

[0009] Optionally, before allocating resources to the media forwarding service nodes of the audio and video service cluster according to the running information of the media forwarding service nodes and the network quality scores of the terminals, the method further includes: monitoring each of the media forwarding service nodes to obtain a monitoring result; in the case where the monitoring result indicates that the running state of the target media forwarding service node is abnormal, allocating the resources of the target media forwarding service node to other media forwarding service nodes according to the status information and the network quality scores, where the other media forwarding service nodes represent the media forwarding service nodes with normal running states.

[0010] Optionally, the method further includes: when the room numbers of multiple terminals connecting to the target running room are the same and the terminals are connected to different target media forwarding service nodes, establishing a transmission channel between each of the target media forwarding service nodes based on the data center interconnection technology of the media entry service node.

[0011] Optionally, before obtaining the running information of each of the media forwarding service nodes, the method further includes: detecting whether the running state of each of the media forwarding service nodes is normal and detecting whether the resource state of each of the media forwarding service nodes is full; before using the media entry service node to send the status information of the media forwarding service node to the terminal, the method further includes: initializing the media entry service node.

[0012] According to another aspect of the present application, there is provided a load balancing device for an audio - video service cluster, including: a sending unit, configured to, when detecting that a terminal is connected to a network and requests an audio - video service, send status information of a media forwarding service node to the terminal by using a media entry service node, where the media entry service node is an allocation node of the audio - video service, and the media forwarding service node is a processing node for processing the audio - video service; a starting unit, configured to, when the terminal receives that the status information of the media forwarding service node indicates normal status, start a network detection service based on the TWAMP protocol to perform network detection on each of the media forwarding service nodes to determine a network quality score of the terminal, where the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth; a first allocation unit, configured to obtain operation information of each of the media forwarding service nodes, and perform resource allocation on the media forwarding service nodes of the audio - video service cluster according to the operation information of the media forwarding service nodes and the network quality score of the terminal.

[0013] According to still another aspect of the present application, there is provided a computer - readable storage medium, where the computer - readable storage medium includes a stored program, and when the program runs, it controls a device where the computer - readable storage medium is located to execute any one of the load balancing methods for an audio - video service cluster.

[0014] According to yet another aspect of the present application, there is provided an electronic device, including: one or more processors, a memory, and one or more programs, where the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include those for executing any one of the load balancing methods for an audio - video service cluster.

[0015] Applying the technical solution of the present application, when it is detected that the terminal is connected to the network and requests an audio-visual service, the media entry service node is used to send the status information of the media forwarding service node to the terminal. Among them, the media entry service node is the allocation node of the audio-visual service, and the media forwarding service node is the processing node for processing the audio-visual service; when the terminal receives the status information of the media forwarding service node indicating normal status, start the network detection service based on the TWAMP protocol to perform network detection on each media forwarding service node to determine the network quality score of the terminal. Among them, the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth; obtain the operation information of each media forwarding service node, and perform resource allocation on the media forwarding service nodes of the audio-visual service cluster according to the operation information of the media forwarding service node and the network quality score of the terminal. By using the network quality as a basis for load balancing, triggering detection when the terminal network changes, detecting based on the TWAMP protocol, calculating a unified and quantifiable network quality score, and dynamically adjusting the resource allocation of the audio-visual service by real-time monitoring the status information of the media forwarding service node and the network quality score of the terminal, effectively improving the long-term stability and user experience of the audio-visual service, which can significantly reduce the delay and packet loss rate of the audio-visual service, improve the fluency and clarity of audio-visual transmission, and meet the requirements of audio-visual services in high-concurrency scenarios. It solves the problem that traditional load balancing methods cannot evenly distribute the load of long-term continuous and stateful services to different services. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The specification drawings forming a part of the present application are used to provide a further understanding of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0017] Figure 1 It shows a hardware structure block diagram of a mobile terminal for performing a load balancing method of an audio-visual service cluster according to an embodiment of the present application;

[0018] Figure 2 It shows a schematic flow chart of a load balancing method of an audio-visual service cluster according to an embodiment of the present application;

[0019] Figure 3 It shows an architecture block diagram of a load balancing system of an audio-visual service cluster according to an embodiment of the present application;

[0020] Figure 4 It shows a schematic flow chart of a specific load balancing method of an audio-visual service cluster according to an embodiment of the present application;

[0021] Figure 5The block diagram of a load balancing device for an audio - video service cluster provided according to an embodiment of the present application is shown.

[0022] Among them, the above - mentioned drawings include the following reference numerals:

[0023] 102, a processor; 104, a memory; 106, a transmission device; 108, an input / output device; 51, a sending unit; 52, a starting unit; 53, a first allocation unit. Detailed implementation manners

[0024] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the drawings and in combination with the embodiments.

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above - mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so as to describe the embodiments of the present application here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non - exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these process, method, product or device.

[0027] As introduced in the background art, traditional load balancing methods cannot evenly distribute the loads of long - duration and state - ful services to different services. To solve the problem that traditional load balancing methods cannot evenly distribute the loads of long - duration and state - ful services to different services, embodiments of the present application provide a load balancing method, device, computer - readable storage medium and electronic device for an audio - video service cluster.

[0028] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention.

[0029] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is a hardware structural block diagram of a mobile terminal for a load balancing method of an audio-video service cluster according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal may include one or more ( Figure 1 only one is shown in Figure 1 ) processors 102 (the processors 102 may include, but are not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown in Figure 1 is only schematic and does not limit the structure of the above mobile terminal. For example, the mobile terminal may further include more or fewer components than

[0030] shown in

[0031] Figure 1 shown, or have a different configuration from

[0030] shown.

[0030] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the load balancing method of the audio-video service cluster in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the mobile terminal through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] In this embodiment, a load balancing method for an audio and video service cluster running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0032] Figure 2 It is a flowchart of the load balancing method for the audio and video service cluster according to the embodiment of the present application. As Figure 2 shown, the method includes the following steps:

[0033] Step S201, when it is detected that the terminal is connected to the network and requests an audio and video service, use the media entry service node to send the status information of the media forwarding service node to the above terminal, where the above media entry service node is the allocation node of the above audio and video service, and the above media forwarding service node is the processing node that processes the above audio and video service;

[0034] Among them, the status information of the media forwarding service node includes whether the current service status is normal and whether the resource status is normal.

[0035] Among them, the media entry service is the running node of the load balancing method, that is, the task assigner of real-time audio and video. According to the correspondence between the terminal information and service information in the distributed cache middleware, the load balancing is carried out based on the service and resource status of the media forwarding information, etc. The media forwarding service node is the specific service node that processes tasks, including the above-mentioned specific task processing of network detection, creating a room, joining a room, managing a room, leaving a room, etc. with a long state.

[0036] The audio and video service cluster includes, in addition to the media entry service and the media forwarding service, a monitoring center, a registration center, and a distributed cache middleware;

[0037] The monitoring center is responsible for the resource monitoring of all services, records the media forwarding service information and resource status into the distributed cache middleware, and adopts a registration and listening mechanism with the media entry service. When the various indicators of a certain media forwarding service node exceed the indicator threshold set for full load and return to normal, it notifies the media entry service to update the resource status in the distributed cache middleware to full load and normal. When full load occurs, the media entry service will no longer allocate rooms to this media forwarding service node.

[0038] The registration center is responsible for the registration and configuration management of all services, facilitating the quick perception of the online or offline status of services. It records the information and status of each media forwarding service in the distributed cache middleware. It adopts a registration and monitoring mechanism with the media entry service. When a service goes online or offline, it notifies the media entry service to update the resource status in the distributed cache middleware to normal and abnormal respectively. When an exception occurs, the media entry service will reallocate all the rooms assigned to this media forwarding service to other media forwarding services to achieve failover.

[0039] The distributed cache middleware mainly serves as a data recording node, undertaking the recording of three types of information read and written by the media entry service node, including the correspondence between terminal information and service information, and the service and resource status of all media forwarding information. The data is updated using a registration and monitoring mechanism.

[0040] Step S202: When the above terminal receives the above status information indicating normal status from the above media forwarding service node, start the network detection service based on the TWAMP protocol to perform network detection on each of the above media forwarding service nodes to determine the network quality score of the above terminal, where the above network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth.

[0041] Among them, TWAMP (Two-Way Active Measurement Protocol) is a standard protocol for measuring two-way network performance. It provides a standardized method to measure network latency, packet loss rate, jitter, and other performance metrics.

[0042] Specifically, before performing network detection on each of the above media forwarding service nodes, it is also necessary to configure the network detection reflector based on the TWAMP protocol on each media forwarding service node. After the terminal receives the media forwarding service information, enable the network detection service based on the TWAMP protocol for each media forwarding service to start network detection. The terminal performs an end-to-end network assessment (connectivity, packet loss, latency, bandwidth) on each media forwarding service, calculates the network status factors to obtain a score, and sends the score and ranking to the server for recording in the distributed cache middleware.

[0043] Through the above step S202, the network quality of the terminal connecting to each media forwarding service node is quantified to obtain a network quality score, which can be used as a basis for load balancing calculation and lay a foundation for subsequent load balancing.

[0044] Step S203: Obtain the operation information of each of the above media forwarding service nodes, and perform resource allocation for the media forwarding service nodes in the audio and video service cluster according to the operation information of the media forwarding service nodes and the network quality score of the terminal.

[0045] Among them, the operation information of the media forwarding service node includes the service status (whether it is normal), resource status (whether it is full), the number of rooms in operation, and the remaining bandwidth of the media forwarding service node.

[0046] Specifically, by using the TWAMP protocol for network detection, the network conditions between the terminal and each media forwarding service node can be accurately evaluated, including but not limited to network connectivity, packet loss rate, time delay, and bandwidth. These parameters are crucial for the quality of audio and video services. Based on the collected network quality scores and the operation information of the media forwarding service nodes, the system can intelligently perform resource allocation to ensure the efficient and stable operation of audio and video services, solving the problem of unstable services caused by network fluctuations and uneven resource allocation in traditional audio and video services.

[0047] In this embodiment, when it is detected that the terminal is connected to the network and requests audio and video services, the media entry service node is used to send the status information of the media forwarding service node to the terminal. Among them, the media entry service node is the allocation node for the audio and video services, and the media forwarding service node is the processing node for processing the audio and video services; when the terminal receives the status information of the media forwarding service node indicating normal status, start the network detection service based on the TWAMP protocol to perform network detection on each of the media forwarding service nodes to determine the network quality score of the terminal, where the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth; obtain the operation information of each of the media forwarding service nodes, and perform resource allocation for the media forwarding service nodes in the audio and video service cluster according to the operation information of the media forwarding service nodes and the network quality score of the terminal. By using the network quality as a basis for load balancing, triggering detection when the terminal network changes, detecting based on the TWAMP protocol, calculating a unified and quantifiable network quality score, and dynamically adjusting the resource allocation of audio and video services by real-time monitoring the status information of the media forwarding service nodes and the network quality score of the terminal, the long-term stability and user experience of audio and video services are effectively improved. This can significantly reduce the latency and packet loss rate of audio and video services, improve the smoothness and clarity of audio and video transmission, and meet the requirements for audio and video services in high-concurrency scenarios. It solves the problem that traditional load balancing methods cannot evenly distribute the load of long-term continuous and stateful services to different services.

[0048] In the specific implementation process, in step S202: Start the network detection service based on the TWAMP protocol to detect the network of each of the above media forwarding service nodes to determine the network quality score of the above terminal, including: when the network connectivity between the above terminal and each of the above media forwarding service nodes is normal, the above network detection service based on the TWAMP protocol respectively determines the network bandwidth score, network time delay score, and network packet loss rate score of each of the above media forwarding service nodes; based on the above network bandwidth score, the above network time delay score, and the above network packet loss rate score, determine the multiple above network quality scores of the connection between the above load and each of the above media forwarding service nodes.

[0049] Among them, for the audio - video system, connectivity is the foundation. Without connectivity, there is no point in talking about packet loss, time delay, and bandwidth. In addition, considering the actual experience scenario, the bandwidth satisfaction affects the bit rate of audio - video, and thus affects the clarity, but as long as it is greater than the service requirement, it can be satisfied. The lower the time delay and packet loss rate, the better the customer perception. Therefore, the priority from large to small is bandwidth, time delay, and packet loss. Thresholds for bandwidth, time delay, and packet loss rate can be set according to the corresponding audio - video requirements respectively, so as to determine the corresponding scores.

[0050] When the network connectivity is normal, this method respectively obtains the network bandwidth, time delay, and packet loss rate scores of each media forwarding service node through the TWAMP protocol. These scores reflect the actual performance of the network between the terminal and the service node. By comprehensively considering these scores, a comprehensive score that comprehensively reflects the network quality can be obtained, that is, the network quality score. This scoring mechanism ensures that the system can dynamically adjust the resource allocation strategy according to the actual network environment of the terminal, optimize the audio - video service experience, and solve the problem of service quality degradation caused by changes in network conditions.

[0051] Specifically, the above - mentioned status information includes the number of running rooms and the remaining bandwidth. Obtain the status information of each of the above media forwarding service nodes, and perform resource allocation for the media forwarding service nodes of the audio - video service cluster according to the above - mentioned running information of the media forwarding service nodes and the above - mentioned network quality score of the terminal, including: obtain the number of running rooms and the remaining bandwidth of each of the above media forwarding service nodes, and evaluate the available resources of each of the above media forwarding service nodes according to the number of running rooms and the remaining bandwidth, where the running room represents the spatial carrier for the audio - video interaction of multiple above - mentioned terminals; sort the multiple above - mentioned network quality scores in descending order to obtain a network quality score sequence; perform resource allocation for the media forwarding service nodes of the above - mentioned audio - video service cluster according to the available resources of each of the above media forwarding service nodes and the above - mentioned network quality score sequence.

[0052] Among them, a room is a concept of logical isolation in the field of real-time audio and video. When multiple terminals join the same room, any terminal can download the real-time audio and video streams or image and text data uploaded by other terminals in the same room, and can also upload its own audio and video streams or image and text data to the room for other terminals to download; the audio and video streams of terminals in different rooms are isolated from each other.

[0053] The number of running rooms and the remaining bandwidth of this method are key indicators for evaluating the bearing capacity of media forwarding service nodes. The number of running rooms reflects the number of audio and video interactions that the service node is currently processing, while the remaining bandwidth is directly related to whether the service node can accept new audio and video streams. By obtaining these status information, the system can evaluate the available resources of the service node in real time. Combining with the network quality score of the terminal, it can preferentially select nodes with good network quality and sufficient resources for connection, avoiding the interruption or quality degradation of audio and video transmission caused by node overload or poor network. The implementation of this strategy effectively improves the overall stability and user experience of audio and video services, and solves the resource bottleneck problem of audio and video services in high-concurrency scenarios.

[0054] More specifically, based on the above-mentioned network bandwidth score, the above-mentioned network time delay score, and the above-mentioned network packet loss rate score, determine the multiple above-mentioned network quality scores of the above-mentioned load connected to each of the above-mentioned media forwarding service nodes, including: according to the formula: i = ax + by + cz, determine the multiple above-mentioned network quality scores of the above-mentioned load connected to each of the above-mentioned media forwarding service nodes, where i is the above-mentioned network quality score, x is the above-mentioned network bandwidth score, y is the above-mentioned network time delay score, z is the above-mentioned network packet loss rate score, and a, b, c are weight coefficients, and a + b + c = 1.

[0055] Among them, a can be set to 0.4, b can be set to 0.3, and c can be set to 0.3.

[0056] This method calculates the network quality score through a formula, where a, b, and c represent the relative importance of bandwidth, time delay, and packet loss rate in the total score, and the weights of these three parameters can be flexibly adjusted according to the application scenario. For example, in the live broadcast scenario, bandwidth may be more critical, so the value of a can be set higher. This scoring mechanism can quantify network performance, enabling the system to make decisions based on objective data rather than relying on preset thresholds, thereby more accurately matching terminals and service nodes, improving the transmission efficiency and stability of audio and video services, and solving the problem of unreasonable resource allocation caused by single network index evaluation.

[0057] Further, before allocating resources to the media forwarding service nodes of the audio-video service cluster according to the above operation information of the media forwarding service nodes and the above network quality score of the terminals, the above method further includes: monitoring each of the above media forwarding service nodes to obtain a monitoring result; in the case where the monitoring result indicates that the operation state of the target media forwarding service node is abnormal, allocating the resources of the target media forwarding service node to other media forwarding service nodes according to the above state information and the above network quality score, where the above other media forwarding service nodes represent the media forwarding service nodes with normal operation states.

[0058] The method continuously monitors the media forwarding service nodes, and can timely detect and respond to the abnormal operation of the service nodes, such as hardware failures, software errors, or network interruptions, etc. Once an abnormality is detected, the system will immediately recalculate the resource allocation plan and transfer the affected resources to the nodes with normal operation states to ensure the continuity and reliability of the audio-video service. This dynamic adjustment mechanism, through real-time monitoring and rapid response, effectively avoids service interruptions, improves the overall robustness of the system, and solves the problem of unavailable audio-video services caused by service node failures.

[0059] Even further, the above method further includes: when the room numbers of multiple above terminals connecting to the target running room are the same, and the above terminals are connected to different target media forwarding service nodes, establishing a transmission channel between each of the above target media forwarding service nodes based on the data center interconnection technology of the above media entry service node.

[0060] The method supports the connectivity of rooms between media forwarding services. In the case where multiple terminals attempt to connect to the same running room but are scattered among different media forwarding service nodes, the media entry service can establish point-to-point transmission channels between different media forwarding service nodes. Based on technologies such as Data Center Interconnect (DCI), the transmission delay between media forwarding services can be minimized, thereby maximizing the real-time audio-video experience of the terminals. The media entry service can identify and mark the data streams belonging to the same running room to ensure the efficient transmission of these data streams between media forwarding services, even if they were initially assigned to different service nodes. The realization of this function not only ensures the integrity of the audio-video stream but also promotes the rational utilization of resources, avoids the low transmission efficiency caused by the dispersion of data streams, and solves the problem of multi-node collaborative work in audio-video services.

[0061] Specifically, before obtaining the running information of each of the above media forwarding service nodes, the above method further includes: detecting whether the running status of each of the above media forwarding service nodes is normal, and detecting whether the resource status of each of the above media forwarding service nodes is full; before using the media entry service node to send the status information of the media forwarding service node to the above terminal, the above method further includes: performing initialization processing on the above media entry service node.

[0062] Before the system performs resource allocation, this method will first check the running status and resource status of the media forwarding service nodes to ensure that only the service nodes with normal status and not full load will be included in the consideration scope of resource allocation. This preprocessing step can avoid allocating audio and video streams to nodes that are already in a high-load or faulty state, thereby improving the effectiveness of resource allocation and the stability of audio and video services. At the same time, performing initialization processing on the media entry service node ensures that it can correctly receive and process audio and video service requests from the terminal, avoiding service access failures caused by improper configuration of the entry node, and solving the entry management problem of the audio and video service cluster.

[0063] The embodiment of the present application further includes intelligent dynamic path selection and optimization. In real-time audio and video services, the dynamics and uncertainties of the network are important factors affecting service quality. Based on load balancing, the present application introduces an intelligent dynamic path selection and optimization mechanism. This mechanism can dynamically adjust the connection path between the terminal and the service node according to the real-time network status to ensure the efficiency and stability of data transmission. The specific contents are as follows:

[0064] For example, when multiple terminals simultaneously request to join the same room, although according to the initial allocation based on geographical location and resource status, different terminals may be assigned to different media forwarding service nodes. However, the present invention further uses the TWAMP protocol to detect each connection path in real time, including network performance indicators such as path connectivity, latency, packet loss rate, and bandwidth. If the network quality of a certain path in the audio and video session deteriorates (such as an increase in latency or an increase in packet loss rate), the system will automatically re-evaluate the network score of the terminal and adjust the connection between the terminal and the service node according to the new score result, redirecting the terminal to a service node with better network quality, or optimizing the network transmission strategy of the existing path, such as adopting a more efficient data compression algorithm, adjusting codec parameters, etc., to adapt to network changes and ensure the smoothness of audio and video transmission.

[0065] By introducing an intelligent dynamic path selection and optimization mechanism, this application can effectively cope with the impact of network fluctuations, significantly improving the stability of real-time audio and video services and the user experience. Even in an environment with poor network conditions, by dynamically adjusting the connection path or optimizing the transmission strategy, it can ensure high-quality and low-latency audio and video transmission, thus supporting a wider range of application scenarios, such as distance education and telemedicine in low-bandwidth or unstable networks.

[0066] In order to enable those skilled in the art to more clearly understand the technical solution of this application, the implementation process of the load balancing method for the audio and video service cluster of this application will be described in detail below in combination with specific embodiments.

[0067] This embodiment relates to a load balancing system for an audio and video service cluster. The architecture block diagram of the load balancing system for the audio and video service cluster is as Figure 3 shown. The system (audio and video service cluster) mainly includes a media entry service node (the node where the load balancing method is located), a media forwarding service node (specific task processing node), a distributed cache middleware, a monitoring center, and a registration center (the basis for load balancing provision). The main functions of each service in the system are as follows:

[0068] 1. The media entry service is the operation node of the load balancing method, that is, the task distributor of real-time audio and video. According to the correspondence between the terminal information and service information in the distributed cache middleware, and based on the service and resource status of the media forwarding information, etc., load balancing is performed. The task types of load balancing include the following categories:

[0069] 1). Network detection task: Support the network detection service of the terminal, and the terminal performs network evaluation;

[0070] 2). Establish / join room task: When the room number in the distributed cache does not exist, the task of establishing a room is executed, and the most suitable media forwarding service is allocated through load balancing calculation; when the room number exists, the task of joining the room is executed, and at the same time, the most suitable media forwarding service is allocated through load balancing calculation. If the newly allocated media forwarding service is the same as the media forwarding service node for establishing the room, the result is directly returned and waiting for the terminal to join the corresponding room; if they are different, a connection channel is established between the two media forwarding service nodes, and the result is returned waiting for the terminal to join;

[0071] 3). Manage room task: This task is automatically executed when there are at least 2 terminals in the room, including audio and video codec parameter negotiation, configuring the correspondence between audio and video streams / messages, etc.;

[0072] 4). Leave room task: The leave room task is automatically triggered when the terminal exits;

[0073] 5) Adopt a registration and listening mechanism with the distributed cache middleware. When a room is established, updated, or destroyed, update the allocation relationships (room number, terminal information, media forwarding service information, etc.) in the distributed cache middleware.

[0074] 2. The media forwarding service node is the specific service node that processes tasks, including the long-term stateful specific task processing such as network detection, room establishment, room joining, room management, and room leaving mentioned above.

[0075] 3. The monitoring center is responsible for resource monitoring of all services, records the media forwarding service information and resource status in the distributed cache middleware, and adopts a registration and listening mechanism with the media entry service. When the indicators of a certain media forwarding service node exceed the indicator threshold set for full load and return to normal, notify the media entry service to update the resource status in the distributed cache middleware to full load and normal. When full load occurs, the media entry service will no longer allocate rooms to this media forwarding service node.

[0076] 4. The registration center is responsible for the registration and configuration management of all services, facilitating quick perception of the online or offline status of services, records the media forwarding service information and status in the distributed cache middleware, and adopts a registration and listening mechanism with the media entry service. When a service goes online and offline, notify the media entry service to update the resource status in the distributed cache middleware to normal and abnormal. When an abnormality occurs, the media entry service will reallocate all the rooms allocated to this media forwarding service to other media forwarding services to achieve failover.

[0077] 5. The distributed cache middleware mainly serves as a data recording node, undertaking the recording of three types of information read and written by the media entry service node, including the correspondence between terminal information and service information, and the service and resource status of all media forwarding information. The data is updated using a registration and listening mechanism.

[0078] This embodiment relates to a load balancing method for a specific audio and video service cluster. As Figure 4 shown, it specifically includes the following steps:

[0079] Step S1: Each time the terminal restarts and connects to the network and requests an audio and video service, send a media entry service initialization request;

[0080] Step S2: The media entry service returns the media forwarding service information with the current service status normal and the resource status normal (only one media forwarding service node is returned within the data center at the same physical location, and at the same time, generate a url accessible to the terminal), and configure the network detection reflection end based on the TWAMP protocol on this media forwarding service node;

[0081] Step S3: After the terminal receives the media forwarding service information, it enables the network detection of the network detection service for each media forwarding service based on the TWAMP protocol;

[0082] Step S4: The terminal performs an end-to-end network evaluation (connectivity, packet loss, latency, bandwidth) on each media forwarding service, calculates the network status factors to obtain a score, and sends the score and ranking to the server and records them in the distributed cache middleware.

[0083] For an audio-video system, connectivity is the foundation. Without connectivity, there is no point in discussing packet loss, latency, and bandwidth. In addition, considering the actual experience scenario, the bandwidth satisfaction affects the bit rate of the audio-video, which in turn affects the clarity, but as long as it is greater than the service requirement, it can be satisfied. The lower the latency and packet loss rate, the better the customer perception. Therefore, the priority from large to small is bandwidth, latency, and packet loss. According to the subjective score statistics results, the weights are set to 40%, 30%, and 30% respectively. In addition, for a real-time audio-video system, the upper limit of the tolerable packet loss rate is denoted as Loss max , the tolerable latency value is Delay max and Delay min , the bandwidth calculates the bandwidth limit value as Bandwidth according to the service requirement min .

[0084] Bandwidth score: If the measured bandwidth bandwidth is greater than or equal to Bandwidthmin, it is 100 points. If it is less, considering that as the bandwidth decreases, the video resolution will decrease proportionally, affecting the user experience. Therefore, a fitting calculation formula can be set according to different bandwidths and the resulting subjective score statistics.

[0085] Latency score: If the measured latency delay is greater than or equal to Delaymax, it is 0 points. If it is less than or equal to Delaymin, it is 100 points. In other cases, considering that as the latency increases, the video frame rate will drop rapidly, affecting the user experience, a fitting calculation can be set according to different latencies and the resulting subjective score statistics.

[0086] Packet loss rate score: If the measured packet loss rate loss is greater than or equal to Lossmax, it is 0 points. If it is less, as the packet loss increases, because of the retransmission mechanism, etc., the user experience will gradually deteriorate. A fitting calculation formula can be designed according to different packet loss rates and subjective score statistics.

[0087] Finally, the comprehensive network quality score is obtained based on the bandwidth score, latency score, and packet loss rate score.

[0088] Step S5: The media entry service obtains multiple factors such as the service status (whether normal), resource status (whether fully loaded), number of running rooms, remaining bandwidth, and network score and ranking of the current terminal of all media forwarding service nodes from the distributed cache middleware;

[0089] When a media forwarding service status is found to be abnormal, the media entry service will reallocate all rooms assigned to the media forwarding service to other media forwarding services according to the load balancing method to achieve failover;

[0090] When a media forwarding resource is found to be fully loaded, the media entry service will no longer allocate a room to the media forwarding service;

[0091] Step S6: If the media forwarding service status and resources are normal, resources are allocated according to the number of rooms where each media forwarding service is running and the network status score and ranking of the terminal. In order to prioritize user experience, the network status score weight is 60% and the number of rooms is 40%. The priority is calculated and selected according to the priority. If the priorities are the same, they are allocated according to the network status ranking.

[0092] The embodiment of the present application defines various stateful tasks in the field of real-time audio and video, designs a load balancing method that is suitable for the field of real-time audio and video, and calculates the quantified results based on the weights of business parameters (number of rooms) and technical parameters (service status, service resource status, network quality score) as the basis for load balancing calculation, solving the pain point that the traditional load balancing method is not suitable for cluster services in the field of real-time audio and video; innovatively uses network quality as a basis for load balancing, and designs a quantification and calculation method for network quality. When the terminal network changes, the detection is triggered, and the four values of connectivity, delay, packet loss rate and bandwidth are obtained based on TWAMP protocol detection and collection, and then the scoring calculation rules suitable for the field of real-time audio and video are used to calculate a unified quantifiable network quality score; and supports the room connectivity between media forwarding services to ensure the best terminal experience process. When multiple terminals in the same room are connected to different media forwarding services according to load balancing, the rooms between the media forwarding service nodes can be opened up to ensure the minimum delay between each terminal and the server, thereby maximizing the real-time audio and video experience of the terminal.

[0093] In summary, this embodiment, through a cluster load balancing design for real-time audio and video services, not only defines a variety of long-term, stateful tasks in the real-time audio and video field, but also designs a specific and well-founded load balancing method that adapts to the allocation of these tasks; in the process of designing the basis, the innovative design conforms to the quantitative scoring of network quality of real-time audio and video. In addition, in order to provide the best user experience, load balancing can connect to the same or connect to different media forwarding servers. In summary, this load balancing design not only solves the pain point that traditional load balancing methods are not suitable for cluster services in the real-time audio and video field, but also takes into account the guarantee of the best real-time audio and video experience.

[0094] The embodiment of the present application also provides a load balancing device for an audio and video service cluster. It should be noted that the load balancing device for the audio and video service cluster in the embodiment of the present application can be used to execute the load balancing method for the audio and video service cluster provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0095] The following introduces the load balancing device of the audio and video service cluster provided in the embodiment of the present application.

[0096] Figure 5 Schematic diagram of a load balancing device for an audio and video service cluster according to an embodiment of the present application. Figure 5 As shown, the device comprises:

[0097] The sending unit 51 is used to use the media entry service node to send the status information of the media forwarding service node to the terminal when detecting that the terminal is connected to the network and requests the audio and video service, wherein the media entry service node is the distribution node of the audio and video service, and the media forwarding service node is the processing node for processing the audio and video service;

[0098] The starting unit 52 is used to start the network detection service based on the TWAMP protocol to perform network detection on each of the media forwarding service nodes when the terminal receives the status information indicating that the status is normal, so as to determine the network quality score of the terminal, wherein the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay and network bandwidth;

[0099] The first allocation unit 53 is configured to obtain the operation information of each of the above media forwarding service nodes, and allocate resources to the media forwarding service nodes of the audio and video service cluster according to the operation information of the media forwarding service nodes and the network quality score of the terminal.

[0100] In this embodiment, the sending unit is configured to, when detecting that the terminal is connected to the network and requests an audio and video service, send the status information of the media forwarding service node to the terminal by using a media entry service node, where the media entry service node is an allocation node for the audio and video service, and the media forwarding service node is a processing node for processing the audio and video service; the starting unit is configured to, when the status information of the media forwarding service node received by the terminal indicates normal status, start a network detection service based on the TWAMP protocol to perform network detection on each media forwarding service node to determine the network quality score of the terminal, where the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth; the first allocation unit is configured to obtain the operation information of each media forwarding service node, and allocate resources to the media forwarding service nodes of the audio and video service cluster according to the operation information of the media forwarding service nodes and the network quality score of the terminal. By using the network quality as a basis for load balancing, triggering detection when the terminal network changes, detecting based on the TWAMP protocol, calculating a unified quantifiable network quality score, dynamically adjusting the resource allocation of the audio and video service by real-time monitoring the status information of the media forwarding service nodes and the network quality score of the terminal, effectively improving the long-term stability and user experience of the audio and video service, significantly reducing the delay and packet loss rate of the audio and video service, improving the smoothness and clarity of the audio and video transmission, and meeting the requirements for the audio and video service in high-concurrency scenarios. It solves the problem that traditional load balancing methods cannot evenly distribute the load of long-term continuous and stateful services to different services.

[0101] As an alternative solution, the startup unit includes a first determination module and a second determination module; the first determination module is configured to, when the network connectivity between the terminal and each of the media forwarding service nodes is in normal connection, respectively determine the network bandwidth score, network time delay score, and network packet loss rate score of each of the media forwarding service nodes based on the network detection service of the TWAMP protocol; the second determination module is configured to determine multiple network quality scores for the connection between the load and each of the media forwarding service nodes based on the network bandwidth score, the network time delay score, and the network packet loss rate score. This scoring mechanism ensures that the system can dynamically adjust the resource allocation strategy according to the actual network environment of the terminal, optimize the audio and video service experience, and solve the problem of degraded service quality caused by changes in network conditions. By obtaining these status information, the system can evaluate the available resources of the service nodes in real time. Combining with the network quality score of the terminal, it can preferentially select nodes with good network quality and sufficient resources for connection, avoiding interruptions or quality degradation of audio and video transmission caused by node overload or poor network conditions.

[0102] In an alternative solution, the first allocation unit includes a first acquisition module, an arrangement module, and an allocation module; the status information includes the number of running rooms and the remaining bandwidth. The first acquisition module is configured to acquire the number of running rooms and the remaining bandwidth of each of the media forwarding service nodes, and evaluate the available resources of each of the media forwarding service nodes based on the number of running rooms and the remaining bandwidth, where the running room represents the spatial carrier for audio and video interaction of multiple terminals; the arrangement module is configured to arrange the multiple network quality scores in descending order to obtain a network quality score sequence; the allocation module is configured to perform resource allocation on the media forwarding service nodes of the audio and video service cluster according to the available resources of each of the media forwarding service nodes and the network quality score sequence.

[0103] In an alternative solution, the second determination module includes a determination sub-module, which is configured to determine multiple network quality scores for the connection between the load and each of the media forwarding service nodes according to the formula: i = ax + by + cz, where i is the network quality score, x is the network bandwidth score, y is the network time delay score, z is the network packet loss rate score, and a, b, c are weight coefficients, and a + b + c = 1.

[0104] This scoring mechanism can quantify network performance, enabling the system to make decisions based on objective data rather than relying on preset thresholds, thereby more accurately matching terminals and service nodes, improving the transmission efficiency and stability of audio and video services, and solving the problem of unreasonable resource allocation caused by single network index evaluation.

[0105] An optional scheme, the device also includes a monitoring unit and a second allocation unit; the monitoring unit is used to monitor each of the above-mentioned media forwarding service nodes to obtain a monitoring result before allocating resources to the above-mentioned media forwarding service nodes of the audio and video service cluster according to the above-mentioned operating information of the above-mentioned media forwarding service nodes and the above-mentioned network quality score of the above-mentioned terminal; the second allocation unit is used to allocate the resources of the above-mentioned target media forwarding service node to other media forwarding service nodes according to the above-mentioned status information and the above-mentioned network quality score when the above-mentioned monitoring result indicates that the operating status of the target media forwarding service node is abnormal, wherein the above-mentioned other media forwarding service nodes represent the above-mentioned media forwarding service nodes with normal operating status.

[0106] This dynamic adjustment mechanism effectively avoids service interruptions through real-time monitoring and rapid response, improves the overall robustness of the system, and solves the problem of audio and video service unavailability caused by service node failures.

[0107] An optional solution, the device also includes a connectivity unit, which is used to establish a transmission channel between the above-mentioned target media forwarding service nodes based on the data center interconnection technology of the above-mentioned media entry service node when the room numbers of the target operating rooms connected to the multiple terminals are the same and the above-mentioned terminals are connected to different target media forwarding service nodes.

[0108] Specifically, it supports the connectivity between rooms of media forwarding services. When multiple terminals try to connect to the same running room but are scattered on different media forwarding service nodes, the data center interconnection technology based on the above-mentioned media entry service nodes can connect the rooms between the media forwarding service nodes, ensuring the minimum latency between each terminal and the server, thereby maximizing the real-time audio and video experience of the terminals.

[0109] An optional solution, the device also includes a detection unit and an initialization processing unit; the detection unit is used to detect whether the operating status of each of the above-mentioned media forwarding service nodes is normal before obtaining the operating information of each of the above-mentioned media forwarding service nodes, and detect whether the resource status of each of the above-mentioned media forwarding service nodes is fully loaded; the initialization processing unit is used to initialize the above-mentioned media entry service node before using the media entry service node to send the status information of the media forwarding service node to the above-mentioned terminal.

[0110] Specifically, before the system allocates resources, it will first check the operating status and resource status of the media forwarding service node to ensure that only service nodes that are in normal status and not fully loaded are included in the resource allocation considerations. This can avoid allocating audio and video streams to nodes that are already in a high-load or faulty state, thereby improving the effectiveness of resource allocation and the stability of audio and video services.

[0111] The load balancing device of the above audio - video service cluster includes a processor and a memory. The above sending unit, starting unit, first allocation unit, etc. are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions. The above modules are all located in the same processor; or, the above - mentioned each module is located in different processors in any combination form.

[0112] The processor contains a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set, and by adjusting the kernel parameters, the problem that the traditional load balancing method cannot evenly distribute the load of long - term continuous and stateful services to different services can be solved.

[0113] The memory may include non - permanent memory in computer - readable media, forms such as random access memory (RAM) and / or non - volatile memory, such as read - only memory (ROM) or flash memory (flash RAM), and the memory includes at least one storage chip.

[0114] The embodiment of the present invention provides a computer - readable storage medium. The above computer - readable storage medium includes a stored program. Wherein, when the above program runs, it controls the device where the above computer - readable storage medium is located to execute the load balancing method of the above audio - video service cluster.

[0115] Specifically, the load balancing method of the audio - video service cluster includes:

[0116] Step S201, when it is detected that the terminal is connected to the network and requests an audio - video service, use the media entry service node to send the status information of the media forwarding service node to the above terminal. Wherein, the above media entry service node is the allocation node of the above audio - video service, and the above media forwarding service node is the processing node for processing the above audio - video service;

[0117] Step S202, when the above terminal receives that the status information of the above media forwarding service node indicates normal status, start the network detection service based on the TWAMP protocol to perform network detection on each of the above media forwarding service nodes to determine the network quality score of the above terminal. Wherein, the above network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth;

[0118] Step S203, obtain the operation information of each of the above media forwarding service nodes, and perform resource allocation on the above media forwarding service nodes of the audio - video service cluster according to the above operation information of the above media forwarding service nodes and the above network quality score of the above terminal.

[0119] An embodiment of the present invention provides a processor, which is used to run a program. When the program runs, it executes the load balancing method of the above audio-visual service cluster.

[0120] Specifically, the load balancing method of the audio-visual service cluster includes:

[0121] Step S201, when it is detected that the terminal is connected to the network and requests an audio-visual service, use the media entry service node to send the status information of the media forwarding service node to the above terminal, where the media entry service node is the allocation node of the above audio-visual service, and the media forwarding service node is the processing node that processes the above audio-visual service;

[0122] Step S202, when the above terminal receives the status information of the above media forwarding service node indicating normal status, start a network detection service based on the TWAMP protocol to perform network detection on each of the above media forwarding service nodes to determine the network quality score of the above terminal, where the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth;

[0123] Step S203, obtain the running information of each of the above media forwarding service nodes, and perform resource allocation on the media forwarding service nodes of the audio-visual service cluster according to the running information of the above media forwarding service nodes and the network quality score of the above terminal.

[0124] An embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored on the memory and executable on the processor. When the processor executes the program, it implements at least the following steps:

[0125] Step S201, when it is detected that the terminal is connected to the network and requests an audio-visual service, use the media entry service node to send the status information of the media forwarding service node to the above terminal, where the media entry service node is the allocation node of the above audio-visual service, and the media forwarding service node is the processing node that processes the above audio-visual service;

[0126] Step S202, when the above terminal receives the status information of the above media forwarding service node indicating normal status, start a network detection service based on the TWAMP protocol to perform network detection on each of the above media forwarding service nodes to determine the network quality score of the above terminal, where the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth;

[0127] Step S203: Obtain the running information of each of the above media forwarding service nodes, and perform resource allocation for the media forwarding service nodes in the audio and video service cluster according to the running information of the media forwarding service nodes and the network quality score of the terminal.

[0128] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0129] This application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program initialized with at least the following method steps:

[0130] Step S201: When it is detected that the terminal is connected to the network and requests an audio and video service, use the media entry service node to send the status information of the media forwarding service node to the terminal, where the media entry service node is the allocation node of the audio and video service, and the media forwarding service node is the processing node for processing the audio and video service;

[0131] Step S202: When the status information of the media forwarding service node received by the terminal indicates normal status, start a network detection service based on the TWAMP protocol to perform network detection on each of the media forwarding service nodes to determine the network quality score of the terminal, where the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth;

[0132] Step S203: Obtain the running information of each of the above media forwarding service nodes, and perform resource allocation for the media forwarding service nodes in the audio and video service cluster according to the running information of the media forwarding service nodes and the network quality score of the terminal.

[0133] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.

[0134] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0135] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0136] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, thereby providing steps for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0138] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.

[0139] The memory may include non-permanent memory in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.

[0140] A computer-readable medium includes permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette tapes, magnetic tape disk storage, or other magnetic storage devices, or any other non-transitory media that can be used to store information that can be accessed by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media, such as modulated data signals and carrier waves.

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

[0142] The foregoing is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A load balancing method for an audio - video service cluster, characterized in that, Including: When it is detected that the terminal is connected to the network and requests an audio-video service, the media entry service node is used to send the status information of the media forwarding service node to the terminal, where the media entry service node is the allocation node of the audio-video service, and the media forwarding service node is the processing node that processes the audio-video service; When the status information of the media forwarding service node received by the terminal indicates normal status, start the network detection service based on the TWAMP protocol to perform network detection on each media forwarding service node to determine the network quality score of the terminal, where the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth; Obtain the operation information of each media forwarding service node, and perform resource allocation for the media forwarding service nodes in the audio-video service cluster according to the operation information of the media forwarding service node and the network quality score of the terminal.

2. The method according to claim 1, characterized in that, Starting the network detection service based on the TWAMP protocol to perform network detection on each media forwarding service node to determine the network quality score of the terminal includes: When the network connectivity between the terminal and each media forwarding service node is normal connectivity, the network detection service based on the TWAMP protocol respectively determines the network bandwidth score, network time delay score, and network packet loss rate score of each media forwarding service node; Based on the network bandwidth score, the network time delay score, and the network packet loss rate score, determine the multiple network quality scores of the load connected to each media forwarding service node.

3. The method according to claim 1, characterized in that, The status information includes the number of running rooms and the remaining bandwidth. Obtaining the status information of each media forwarding service node and performing resource allocation for the media forwarding service nodes in the audio-video service cluster according to the operation information of the media forwarding service node and the network quality score of the terminal includes: Obtain the number of running rooms and the remaining bandwidth of each media forwarding service node, and evaluate the available resources of each media forwarding service node according to the number of running rooms and the remaining bandwidth, where the running room represents the spatial carrier of the audio-video interaction of multiple terminals; Arrange the multiple network quality scores in descending order to obtain a network quality score sequence; Perform resource allocation for the media forwarding service nodes in the audio-video service cluster according to the available resources of each media forwarding service node and the network quality score sequence.

4. The method according to claim 2, wherein Based on the network bandwidth score, the network time delay score, and the network packet loss rate score, determining the multiple network quality scores of the load connected to each media forwarding service node includes: According to the formula: i = ax + by + cz, determine the multiple network quality scores of the load connected to each media forwarding service node, where i is the network quality score, x is the network bandwidth score, y is the network time delay score, z is the network packet loss rate score, and a, b, c are weight coefficients, and a + b + c = 1.

5. The method according to claim 1, characterized in that, Before allocating resources to the media forwarding service nodes of the audio and video service cluster according to the operating information of the media forwarding service nodes and the network quality score of the terminal, the method further includes: Monitoring each of the media forwarding service nodes to obtain a monitoring result; In the case where the monitoring result indicates that the operating state of the target media forwarding service node is abnormal, allocating the resources of the target media forwarding service node to other media forwarding service nodes according to the state information and the network quality score, where the other media forwarding service nodes represent the media forwarding service nodes with normal operating states.

6. The method according to claim 1, wherein The method further includes: When the room numbers of multiple terminals connecting to the target operating room are the same, and the terminals are connected to different target media forwarding service nodes, establishing a transmission channel between the target media forwarding service nodes based on the data center interconnection technology of the media entry service node.

7. The method according to claim 1, wherein: Before obtaining the operating information of each of the media forwarding service nodes, the method further includes: detecting whether the operating state of each of the media forwarding service nodes is normal, and detecting whether the resource state of each of the media forwarding service nodes is full. Before using the media entry service node to send the state information of the media forwarding service node to the terminal, the method further includes: initializing the media entry service node.

8. A load balancing device for an audio and video service cluster, characterized in that, including: A sending unit, configured to, when detecting that the terminal is connected to the network and requests an audio and video service, use the media entry service node to send the state information of the media forwarding service node to the terminal, where the media entry service node is the allocation node of the audio and video service, and the media forwarding service node is the processing node for processing the audio and video service; A starting unit, configured to, when the state information of the media forwarding service node received by the terminal indicates a normal state, start a network detection service based on the TWAMP protocol to perform network detection on each of the media forwarding service nodes to determine the network quality score of the terminal, where the network quality score is determined by at least one of network connectivity, network packet loss rate, network time delay, and network bandwidth; A first allocation unit, configured to obtain the operating information of each of the media forwarding service nodes, and allocate resources to the media forwarding service nodes of the audio and video service cluster according to the operating information of the media forwarding service nodes and the network quality score of the terminal.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein when the program runs, it controls the device where the computer-readable storage medium is located to execute the load balancing method of the audio and video service cluster according to any one of claims 1 to 7.

10. An electronic device, characterized in that, including: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a method for load balancing of the audio and video service cluster according to any one of claims 1 to 7.