Detailed Description
Before describing the specific embodiments of the technical solution of the present application in detail, a network architecture and an application scenario suitable for supporting implementation of the technical solution of the present application are disclosed. The solution of the present application is applicable to a typical network live platform, which, as shown in fig. 1, consists of a live server 83, a media server 85, a peer-to-peer network and terminal devices 90, 92 as sharing nodes in the peer-to-peer network.
The live broadcast server is responsible for managing creation of a live broadcast room, receiving and distributing live broadcast streams. The media server is responsible for processing tasks such as encoding, transcoding and storing the live stream, and ensures that the live stream can be transmitted to the audience in a proper format and quality. A peer-to-peer network (P2P network) is a distributed network composed of a plurality of terminal devices, which serve as sharing nodes in the peer-to-peer network, as both clients and servers in the transmission of live streams, and assist in the distribution of live streams by sharing their respective upstream bandwidths.
The sharing node in the peer-to-peer network refers to a terminal device participating in a live stream sharing task. Each sharing node not only requests the live stream of the current live broadcast room which is being accessed by the sharing node for playing to realize local consumption, but also serves as a transmission node to provide the live stream for other sharing nodes under the condition that the surplus bandwidth resources and the network conditions of the sharing node meet the network service score. The live server can also act as a management server of the peer-to-peer network in the architecture, and is responsible for coordinating and managing the connection and data transmission between the sharing nodes, including the distribution of live streams and the distribution of sharing tasks.
The media server can send the processed live stream to a source node specially responsible for storing, the source node can also be regarded as a sharing node mainly responsible for providing downlink transmission live stream in the peer-to-peer network, the media server sends the storage address of the live stream stored to the source node to the live server, and the live server distributes the storage address to each sharing node directly or through a management server of the peer-to-peer network. The source nodes for storing the live stream refer to nodes with original data of the live stream and are responsible for providing an initial source of the live stream.
The peer-to-peer network is facilitated by the management server implementing the management of the individual sharing nodes by installing a computer program product running the live stream sharing task scheduling method according to the present application, enabling the individual sharing nodes to establish a connection and to implement the mutual sharing service of live streams. The peer-to-peer network can create corresponding live stream sharing tasks for the sharing nodes corresponding to each live stream, all sharing nodes sharing based on the same live stream are constructed into the same sharing circle, a corresponding live stream sharing list is maintained for the sharing nodes, and sharing node information participating in the live stream sharing tasks is recorded, wherein the sharing node information comprises network addresses, bandwidth conditions and connection states of the sharing nodes. When a new shared node joins the network, the management server can match the shared node with the existing shared node according to the network state information of the shared node, the spare bandwidth resources and the like, and assist in establishing connection. In this way, the live stream data can be directly exchanged between the sharing nodes without completely relying on a centralized server, so that the load of the server is reduced, and the efficiency and stability of live stream transmission are improved. By the method, the peer-to-peer network realizes the effective distribution of the live streams, and simultaneously optimizes the use of network resources, so that the sharing service of the live streams is more efficient and reliable. In some embodiments, the live server and the management server may be integrally implemented in the same server.
In such a network architecture, the terminal device runs a live application through which a user can view live content. The live broadcast application program not only provides the playing function of the live broadcast stream, but also integrates a computer program product realized by the live broadcast stream sharing task scheduling method, and the computer program product mainly comprises service logic which needs to be matched with a sharing node in the method. When a user starts a live broadcast application program and selects one live broadcast room to watch, the application program firstly acquires a live broadcast stream from a live broadcast server and plays the live broadcast stream on equipment of the user to realize local consumption. Meanwhile, according to the technical scheme of the application, the application program also evaluates the network condition of the application program to determine whether the application program can participate in the sharing task of other live streams.
If the network service condition of the current sharing node exceeds the preset condition wide limit interval and the spare bandwidth resources exist, the live broadcast application program pulls live broadcast streams of the external live broadcast room from the peer-to-peer network by utilizing the resources and transmits the live broadcast streams to other sharing nodes needing the live broadcast streams. The process not only improves the utilization efficiency of network resources, but also enhances the robustness and flexibility of live stream transmission.
The live broadcasting room in the application can be a video live broadcasting room, the live broadcasting stream of which is generally video data, or a voice live broadcasting room, and the live broadcasting stream of which is generally pure audio data. The audio data of the voice live broadcasting room has relatively low requirement on system overhead, and the technical scheme provided by the application has more efficiency advantage when being applied to terminal equipment such as a smart phone.
According to the technical scheme, the live broadcast application program not only can provide traditional live broadcast watching experience, but also can dynamically participate in the parallel transmission of the live broadcast stream according to network conditions, and the parallel sharing service of the live broadcast stream of the external live broadcast room is opened. The integration makes each terminal device running the live broadcast application become a flexible sharing node, not only can play the live broadcast stream, but also can intelligently participate in the distribution process of the live broadcast stream according to the network condition and the resource condition.
By the method, network resources can be utilized to the maximum extent while the transmission efficiency and stability of the live stream are maintained, smoother and higher-quality live experience is provided for users, and platform-level benefits are brought. Therefore, the combination of the network architecture and the application scene provides an actual and effective implementation environment for the technical scheme of the application.
Referring to fig. 2, according to the method for scheduling live stream sharing nodes provided by the present application, in some embodiments of the method, the method includes the following steps:
Step S3100, receiving network state information periodically reported by a sharing node pre-registered as a consumption type in a peer-to-peer network in the process of consuming the current live stream which is being pulled and transmitted by the sharing node, wherein the network state information comprises resource consumption information and network quality information of the corresponding sharing node;
The sharing node in the application can comprise a node which consumes the live stream and displays the live stream to the graphical user interface of the live stream, and can be understood to be a node which directly opens the graphical user interface to users in a live broadcasting room, or can comprise a node which does not consume the live stream and still can assist in pulling and transmitting the live stream. It is to be understood that the current live stream of the present application refers to a live stream being consumed by a consumption type sharing node, and the additional live stream refers to a live stream that the consumption type sharing node does not participate in consumption but is consumed by other sharing nodes. When the sharing node accesses the peer-to-peer network, the sharing node registers with the management server first, so as to submit some basic information, such as UUID, consumption type and the like, and inform the management server through the consumption type, so as to indicate whether the sharing node needs to consume the live stream.
The application mainly focuses on the consumption type sharing nodes so as to examine whether the consumption type sharing nodes have resource allowance to provide pull transmission services for other additional live streams. The consumption type sharing nodes can periodically report own network state information in the process of consuming the current live stream which is being pulled and transmitted. These include two main parts, resource usage information and network quality information. The resource consumption information covers key indexes such as bandwidth use allowance, CPU use allowance, memory use allowance, GPU use allowance and the like of the sharing node, and the indexes mainly reflect the current resource occupation condition of the sharing node and the quantity of available resources. The network quality information includes parameters such as packet loss rate and delay value, which directly affect the transmission quality and user experience of the live stream. In addition, the method can further comprise information such as network penetration configuration type and the like to indicate NAT type configured by the sharing node, so that the management server knows penetration capability of the sharing node to match live stream sharing tasks.
In order to report network status information to the management server, the shared node needs to embed a corresponding monitoring reporting component in the live broadcast application program that it runs. Specifically, the shared node can collect each specific index data corresponding to the resource consumption information and the network quality information of the shared node in real time through the built-in monitoring reporting component, and then package the data into network state information and report the network state information to the management server. The reporting process can be completed through a preset communication protocol and interface, for example, HTTP, webSocket protocols can be adopted, and data can be sent to the management server through an API interface.
The reported network state information needs to contain enough details so that the management server can accurately evaluate the state of the shared node. For example, bandwidth usage margin may be determined by monitoring network interface traffic of the shared node, CPU and memory usage margin may be obtained by performance monitoring tools provided by the operating system, and packet loss rate and delay values may be measured by network quality testing tools, such as ping or traceroute.
In practical applications, different sharing nodes may have different hardware configurations and network environments, so the reported network state information needs to be able to reflect these differences. And the management server evaluates and sorts the sharing nodes according to the information and by combining with a preset strategy and algorithm, so as to provide decision support for the subsequent live stream sharing task scheduling.
Step S3200, determining the real-time resource redundancy of the consumption type sharing nodes according to the periodically reported resource usage information, and sorting the consumption type sharing nodes according to the real-time resource redundancy to obtain a resource sorting list;
The real-time resource redundancy of the consumption type sharing nodes can realize accurate assessment of the current available resources of the sharing nodes, and accordingly, the consumption type sharing nodes can be identified which consumption type sharing nodes have enough resource redundancy to participate in the sharing task of the additional live stream.
The real-time resource margin is determined based on resource usage information reported periodically by the shared nodes. The resource usage information includes key indexes such as bandwidth usage allowance, CPU usage allowance, memory usage allowance, GPU usage allowance and the like, and reflects the current resource occupation condition of the sharing node and the available resources. For example, bandwidth usage margin may be determined by monitoring network interface traffic of the shared node, CPU and memory usage margin may be obtained by a performance monitoring tool provided by the operating system, and GPU usage margin may be measured by a particular GPU monitoring tool.
In order to convert the resource usage information into real-time resource redundancy, the allowance of each specific index in the resource usage information needs to be quantized, and the real-time resource redundancy is obtained by weighting, fusing and calculating each specific index. The weighting coefficients used for weighting can be set according to the importance and contribution degree of different resources and can be manually preset experience values. For example, bandwidth resources may be particularly important for live streaming and may therefore be given a higher weight. Of course, the weight coefficient can also be adjusted according to the actual application scene and the service requirement.
After the weighted fusion calculation, the obtained result is a quantized numerical value representing the real-time resource redundancy, and the numerical value comprehensively reflects the resource condition of the shared node. And then, sorting the consumption type sharing nodes according to the real-time resource redundancy to generate a resource sorting list. The list is arranged according to the real-time resource redundancy descending order of the sharing nodes, and the sharing node with the highest resource redundancy is arranged at the forefront, which shows that the sharing node has the most resources for additional live stream sharing tasks.
In practical applications, the resource ordered list may be used for subsequent shared node selection and task allocation. The higher the real-time resource margins of the sharing nodes, the greater the likelihood that they will be selected to perform additional live stream sharing tasks. Therefore, the management server can reasonably distribute live stream sharing tasks according to the real-time resource conditions of the sharing nodes, optimize resource utilization and improve the efficiency and stability of live stream transmission.
Step S3300, determining a real-time network quality score of the consumption type sharing node according to the periodically reported network quality information;
The real-time network quality score may be determined based on network quality information periodically reported by the shared nodes. The network quality information mainly comprises two key parameters, namely a packet loss rate and a delay value, which directly influence the transmission quality and the user experience of the live stream. The packet loss rate refers to the proportion of packets lost during transmission in a certain period of time, and the delay value refers to the time elapsed from transmission to reception of the packets. These two parameters can comprehensively reflect the network transmission performance of the shared node.
In order to quantify the network quality information into a real-time network quality score, the network quality information reported by each shared node needs to be added into a corresponding quality information queue. The quality information queue is used for storing network quality information of the shared nodes in a certain time window so as to carry out statistical analysis.
Next, based on the quality information queues, the proportion of network quality information with poor quality to the whole queue is counted. Specifically, when the packet loss rate of the shared node exceeds a preset packet loss rate threshold or the delay value exceeds a preset delay threshold, the network quality information of the node is marked as having poor quality. The preset threshold is set according to the general requirements of network transmission and the characteristics of live streams, which are the references for evaluating the quality of the network.
After the statistics are completed, the proportion of poor quality is determined as the mathematical quality score of the shared node. This score is a quantified indicator that characterizes the network quality status of the shared nodes. The mathematical quality score may be calculated by multiplying the poor quality ratio by a predetermined scoring radix or by more complex calculations based on the poor quality ratio and other factors (e.g., network stability, historical quality records, etc.).
And finally, setting and maintaining the effective duration of the mathematical quality score according to the interval of the mathematical quality score of each sharing node. Within the effective time limit, the mathematical quality score is used as a real-time network quality score of the sharing node for subsequent sharing node selection and task allocation. The setting of the effective duration considers the dynamic change of the network state, and ensures that the score can reflect the current network condition in time.
In the implementation, different packet loss rate thresholds and delay value thresholds, as well as different scoring cardinality and effective duration, can be set according to different network environments and service requirements. For example, in a high bandwidth, low latency network environment, the threshold may be set more stringent to ensure high quality transmission of the live stream. In a scenario where bandwidth is limited or the network environment is unstable, the threshold may be relaxed appropriately to accommodate different network conditions.
And S3400, screening a target sharing node from the resource sequencing list according to the real-time network quality score and the real-time resource redundancy, and pulling and transmitting the additional live stream for the sharing node consuming the additional live stream through the target sharing node.
The purpose of screening the target shared nodes is to identify those shared nodes from the ordered list of resources that have both good network quality scores and sufficient resource margins to support additional live streaming. By comprehensively considering the real-time network quality scores and the real-time resource redundancy of the sharing nodes, the selected sharing nodes can be ensured to effectively provide live streaming services for other sharing nodes.
Specifically, the management server may screen out the target sharing nodes meeting the conditions from the resource sorting list according to the real-time network quality score and the real-time resource redundancy of the sharing nodes, and against a preset screening policy and a threshold. The real-time network quality score reflects the network transmission performance of the shared node, and the real-time resource margin characterizes the current available resource status of the shared node. Together, these two metrics determine whether the sharing node is suitable to take on additional live stream sharing tasks.
During the screening process, the management server may employ various policies to determine the target shared node. For example, one strategy may be to select those sharing nodes that have a real-time network quality score above a certain value and a real-time resource-rich redundancy that is located in the first few of the ordered list of resources. Such shared nodes not only perform well in the network, but also have sufficient resource margins to handle additional live streaming tasks. Another strategy may be to prioritize those sharing nodes that have a higher resource margin, but a network quality score in a slightly lower interval, especially where the network quality score is generally lower, to maximize the efficiency of resource utilization.
In addition, the screening policy may be adjusted according to the network penetration configuration type. For example, for live stream sharing tasks requiring high penetration, the management server may prefer those sharing nodes with better NAT penetration. This may be achieved by analyzing the network penetration configuration types reported by the shared nodes, selecting those configuration types indicating shared nodes with high penetration capabilities.
In practical applications, the process of screening the target shared node is dynamic and can be adjusted according to the real-time state of the shared node and the change of network conditions. The management server continuously monitors the status of the shared nodes and updates the resource ordering list and the network quality score according to the latest network status information to ensure that the most suitable shared node is always selected as the target node for executing the additional live stream sharing task.
Through the comprehensive consideration and dynamic adjustment screening mechanism, the management server can effectively optimize resource allocation, improve the efficiency and stability of live stream transmission, and simultaneously ensure the fluency and high quality of user experience. In this way, the management server can ensure that at any given time, there is an optimal shared node to be used to support the pulling and transmission of additional live streams, thereby improving the performance of the overall live stream sharing network.
According to the above embodiments, the present application can pointedly solve various problems existing in the conventional live streaming technology and achieve corresponding beneficial effects, including but not limited to:
Firstly, by receiving network state information, including resource consumption information and network quality information, reported periodically by shared nodes pre-registered as consumption types in a peer-to-peer network, the dynamic state of each node can be mastered in real time. And then, determining the real-time resource redundancy of the consumption type sharing nodes according to the resource consumption information, and sorting according to the redundancy to generate a resource sorting list, so that the nodes with enough resource redundancy can be accurately identified. Meanwhile, the real-time network quality score of the shared node is determined according to the network quality information, and the transmission capacity of the node is further evaluated. And finally, screening target sharing nodes with real-time network quality scores and real-time resource redundancy meeting a preset strategy from the resource sorting list, and pulling and transmitting additional live streams for sharing nodes consuming the additional live streams through the nodes, so that efficient utilization and reasonable scheduling of node resources are realized.
And secondly, each terminal device accessing the live broadcasting room to consume the corresponding live broadcasting stream is mobilized to serve as a sharing node, and meanwhile, the sharing service of a plurality of live broadcasting streams is served, so that the data transmission pressure of the centralized server can be remarkably reduced, and more live broadcasting stream transmission tasks are distributed to each sharing node with resource allowance, so that the load of the server is relieved, and the phenomenon of blocking and interruption caused by overload of the server is reduced. Meanwhile, through real-time monitoring and evaluation of the network state of the nodes, the problems of network delay and packet loss can be effectively reduced, the stability and fluency of live stream transmission are improved, and better viewing experience is provided for users. From a full platform perspective, the scale effect is significant.
In addition, the application fully utilizes the uplink bandwidth and the computing resource of the terminal equipment in the peer-to-peer network, avoids the idle and waste of the resource and improves the resource utilization rate of the whole network. And through a reasonable node scheduling strategy, the transmission path of the live stream can be dynamically adjusted according to the real-time state of the node, so that the transmission efficiency is further optimized, and the efficient distribution of the live stream is ensured.
On the basis of any embodiment of the method, the real-time resource redundancy of the consumption type sharing nodes is determined according to the periodically reported resource usage information, and the consumption type sharing nodes are ordered according to the real-time resource redundancy to obtain a resource ordering list, which comprises the following steps:
step S3210, extracting various resource usage indexes of the consumption type sharing node from the periodically reported resource usage information, wherein the resource usage indexes comprise bandwidth usage allowance, CPU usage allowance, memory usage allowance and GPU usage allowance;
In determining the real-time resource redundancy of the consumption type sharing node, first, a key resource usage index is required to be extracted from the periodically reported resource usage information. Specifically, the resource usage index to be extracted from the resource usage information reported by the sharing node includes a bandwidth usage allowance, a CPU usage allowance, a memory usage allowance, and a GPU usage allowance. These indicators reflect the current usage and available margins of the shared node in terms of network bandwidth, processing power, storage power and graphics processing power, respectively.
The bandwidth usage allowance refers to the amount of network bandwidth that the sharing node is currently unoccupied and is directly related to the data transmission capability that the sharing node is capable of providing. CPU usage margin and memory usage margin respectively represent unused portions of the CPU and memory resources of the shared node, which are important indicators for measuring the processing capacity and data storage capacity of the shared node. GPU usage margins are related to graphics processing capabilities, particularly for live streaming where high definition video processing and rendering is required.
The specific values of the resource usage indicators are normalized by the sharing nodes in advance so as to ensure that different resource usage data can be compared and fused under a unified measure. Specifically, the shared node first calculates a bandwidth usage allowance, subtracts the occupied bandwidth from the total bandwidth of the shared node, and divides the obtained result by the total bandwidth, thereby obtaining a value between 0 and 1, which represents the proportion of the unused portion of the bandwidth to the total bandwidth. For other resource usage indexes such as CPU, memory and GPU, the usage index is realized by subtracting the respective usage rate from 100%, namely if the CPU usage rate is 70%, the normalized allowance is 30%. The processing mode provides a unified quantization standard for each resource consumption index, so that the resource consumption indexes can be directly compared, convenience is provided for subsequent weighted fusion calculation, and fairness and accuracy of different resources in comprehensive evaluation are ensured.
Step S3220, carrying out weighted fusion on the allowance corresponding to each resource consumption index according to a preset weight coefficient to obtain the real-time resource redundancy of the consumption type sharing node, wherein the weight coefficient reflects the importance and contribution of different resources;
And weighting and quantifying each normalized resource consumption index (bandwidth use allowance, CPU use allowance, memory use allowance and GPU use allowance) according to the importance and contribution degree of the normalized resource consumption index to live stream transmission. The weighting coefficients required for weighting may be preset reflecting the importance of different resources in the live stream sharing task. For example, bandwidth resources may be given higher weight because it directly affects the data transmission rate and the quality of the live stream. The weights of the CPU and memory resources may be inferior because they affect the ability to process live streams. GPU usage margin is also important for scenes that require high definition video processing, especially in graphics-intensive applications.
The process of weighted fusion is accomplished by multiplying each resource usage indicator by its corresponding weight coefficient, and then adding the weight values. This calculation, i.e. the real-time resource margin, is a comprehensive indicator reflecting the availability of the shared node in all critical resources. For example, if a shared node has a high bandwidth margin but CPU utilization is near full load, the limitation of CPU resources may reduce its ability to handle additional live streams despite the abundance of bandwidth resources. Thus, by weighted fusion, the overall resource condition of the shared node can be more accurately assessed.
In particular implementations, the weighting coefficients may be adjusted based on actual network conditions, traffic demands, and historical data. For example, in environments where network bandwidth is generally high, the weight of CPU and memory resources may be increased to more focus on processing power. Conversely, in bandwidth limited environments, bandwidth resources may be weighted higher. In addition, the weighting coefficients may also be adjusted according to the specific use of the shared node, for example, for a node that primarily processes high definition video, the weighting of GPU resources may be increased.
And step S3230, sorting the consumption type sharing nodes in a descending order according to the real-time resource redundancy to generate a resource sorting list.
After the weighted fusion is completed, the real-time resource redundancy of each shared node is used as a comprehensive index to reflect the overall availability of the shared node in the aspect of key resources. Next, all shared nodes are ranked according to this composite index. The ordering process uses a descending order, i.e., the sharing node with the highest resource redundancy is ranked at the front of the list, while the node with the lowest resource redundancy is ranked at the end of the list. This ordering ensures that the most resource efficient sharing node can be preferentially considered for additional live stream sharing tasks.
The generation of the resource ordering list is dynamic, and the resource ordering list is updated according to the resource consumption information and the network state reported by each sharing node in real time. This means that as the status of the shared node resources changes, their location in the ordered list of resources will change accordingly. For example, if the bandwidth usage of a shared node suddenly increases, resulting in a decrease in its bandwidth margin, its real-time resource margin will decrease and move down the ordered list of resources. Conversely, if a shared node releases a lot of resources, its real-time resource margin will increase and may rise in the list.
The generation and updating of the ordered list of resources is critical to the scheduling of live stream sharing tasks. It not only helps the management server to quickly identify the sharing node with the most abundant resources, but also provides a clear framework for distributing live stream sharing tasks among the sharing nodes. In this way, it can be ensured that live stream sharing tasks are assigned to sharing nodes that have the most capacity to handle them, thereby optimizing the performance and efficiency of the overall live stream sharing network.
According to the method and the device, the real-time resource redundancy of the sharing nodes is accurately evaluated and dynamically ordered to select the target sharing node of the live stream sharing task, so that the resource utilization efficiency and the transmission stability of the live stream sharing network are remarkably improved. The management server can comprehensively consider the resource condition of each shared node by weighting and fusing the margins of key resources such as bandwidth, CPU, memory, GPU and the like and distributing different weights according to the importance of the key resources to live stream transmission, so as to ensure that the task with high priority is distributed to the node with the most sufficient resources. The refined resource management not only optimizes the distribution path of the live broadcast stream and reduces the dependence on a central server, but also improves the expansibility and the adaptability of the network, so that when the network fluctuation and the resource competition are faced, the resource allocation strategy can be responded and adjusted quickly, the continuity and the quality of the live broadcast stream are ensured, and smoother and higher-quality live broadcast experience is provided for users.
On the basis of any embodiment of the method, the method for determining the real-time network quality score of the consumption type sharing node according to the periodically reported network quality information comprises the following steps:
Step S3310, adding the network quality information periodically reported by each consumption type sharing node into a quality information queue corresponding to the sharing node;
Each sharing node periodically reports its network quality information including, but not limited to, key parameters such as packet loss rate and delay value. These parameters are direct indicators of evaluating network transmission performance, directly affecting the real-time transmission quality and user experience of the live stream. To systematically process the data, the management server establishes a quality information queue for each shared node for storing all network quality information reported by the node within a certain time window.
The quality information queue is constructed by updating the data reported by each sharing node in real time. Whenever a sharing node reports new network quality information, the data is added to the corresponding quality information queue, thereby ensuring that the data in the queue can reflect the latest network state of the sharing node. The quality information queue allows the management server to track trends in the quality of the shared node network and the length of the queue can be set to define the range of historical data, such as data of the last 30 seconds or minutes.
In actual operation, the updating and maintaining of the quality information queue needs to consider the real-time performance and accuracy of the data. The management server may receive the report of the shared node at preset time intervals (e.g., every 30 seconds or every minute) and add it to the queue. Meanwhile, the queue can arrange data according to time sequence, so that the data reported earliest is arranged at the front end of the queue, and the data reported latest is arranged at the tail end of the queue.
In addition, the reported network quality information needs to be stored in a structured format so that the management server can easily parse and process. For example, each piece of reported data may include a timestamp, a packet loss rate, a delay value, etc., which together form a complete network quality record. In this way, the management server can accurately extract and analyze the network quality information of each shared node, and further calculate a real-time score reflecting the network performance of the shared node.
Step S3320, counting the proportion of network quality information with poor quality in the total network quality information of the whole queue based on the quality information queue, determining the proportion as the mathematical quality score of the corresponding shared node, wherein when the packet loss rate in the network quality information is greater than a preset packet loss rate threshold value or the time delay is greater than a preset time delay threshold value, the network quality information with poor quality is confirmed;
Determining a real-time network quality score for a shared node requires analysis and evaluation of network quality information reported by the shared node.
First, based on the data in the quality information queue, the proportion of network quality information having poor quality is calculated. The method specifically can be obtained by counting the number of records in the quality information queue, wherein the packet loss rate exceeds a preset threshold value or the delay value exceeds a preset threshold value, and dividing the number of records by the total number of records in the queue. The preset threshold is a standard set based on network transmission performance requirements and live stream characteristics and is used for evaluating the quality of the network. For example, if the preset packet loss rate threshold is 1% and the delay threshold is 100 milliseconds, any record exceeding these values will be considered poor quality.
The calculated ratio is then determined as a mathematical quality score for the shared node. This score is a quantified indicator that reflects the network quality status of the shared nodes. The calculation of the mathematical quality score may be performed using simple proportional calculations, or may be based on more complex algorithms, taking into account other factors such as network stability and historical quality records. For example, if there are 10 records in the queue, where the packet loss rate of 3 records exceeds a preset threshold, the mathematical quality score may be 0.3 (i.e., 30% poor quality records).
And step S3330, setting and maintaining effective duration of the mathematical quality score according to the interval of the mathematical quality score of each sharing node, and taking the mathematical quality score as the real-time network quality score of the corresponding sharing node in the effective duration.
After determining the real-time mathematical quality score of the shared node, the effective duration of the mathematical quality score needs to be set and maintained to ensure that the mathematical quality score can reflect the network state of the shared node in real time to become a network quality score. Specifically, the setting may be based on the interval in which the mathematical quality score is located, which means that different scoring intervals may correspond to different effective durations. For example, higher scoring shared nodes may have a longer effective duration because their network state is more stable, while lower scoring shared nodes may have a shorter effective duration because their network state may require more frequent updates to capture rapid changes.
Specifically, the management server determines the state of its network quality based on the mathematical quality score of the shared node and assigns an effective duration accordingly. This effective duration may be based on preset adjustment rules, for example, the effective duration may be set to 10 minutes if the score is in the top 25% interval, and the effective duration may be reduced to 5 minutes or less if the score is in the bottom 25% interval. Such a setting ensures that the score can be updated in time to cope with rapid changes in network conditions.
Within the effective time limit, the mathematical quality score is used as a real-time network quality score for the shared node for subsequent shared node selection and task allocation. This means that during this time the management server will use this score to evaluate whether the sharing node is suitable to take on additional live stream sharing tasks. For example, a shared node with a high real-time network quality score may be preferentially selected to transmit high quality live streams, while nodes with lower scores may be limited or excluded from critical tasks.
In addition, the effective duration is set by taking the dynamic property of the network into consideration. Network conditions may change rapidly due to a variety of factors (e.g., increased number of users, network congestion, etc.), and thus, it is necessary to update the score and adjust the effective duration in real time. The management server monitors the change in network status and updates the score and effective duration of the shared nodes as necessary to maintain accuracy and timeliness of the scheduling decisions.
By means of the mechanism, the live stream sharing node scheduling method can ensure that a scoring system has enough flexibility to cope with the instant change of the network, can maintain stability, and reduces unnecessary calculation and resource allocation overhead caused by frequent change. The design improves the efficiency and reliability of live stream transmission and optimizes the performance of the whole live stream sharing network.
By means of the algorithm, the effective duration of the shared node can be dynamically adjusted according to the mathematical quality score of the shared node, and the actual network quality score is updated accordingly. The method not only can reflect the network state of the sharing node in real time, but also can ensure that the management server can quickly respond and adjust the task allocation of the sharing node when the network condition changes, thereby optimizing the performance and efficiency of the whole live stream sharing network.
According to the embodiment, the resource scheduling efficiency and the transmission stability of the live stream sharing network are remarkably improved by accurately evaluating and dynamically adjusting the network quality scores and the effective durations of the sharing nodes. By establishing a quality information queue for each shared node, the management server can continuously track and analyze the network state of the node, ensuring that the network quality score (QosScore) accurately reflects the current network conditions. By using a preset packet loss rate and delay value threshold, the information proportion of poor network quality can be identified and counted, so that the mathematical quality score of each shared node is calculated, and the score is directly related to the real-time network performance of the node.
By setting the effective time length corresponding to different scoring intervals, the timeliness of scoring can be ensured, so that a high scoring node has longer effective time length when the network is stable, and a low scoring node updates the scoring more frequently to capture the rapid change of the network. The dynamic adjustment mechanism enables the management server to respond quickly according to the latest network state, preferentially allocate tasks to shared nodes with good network states, and limit or exclude nodes with poor network states, so that the transmission path and quality of the live stream are optimized.
In addition, the embodiment also enhances the adaptability and the robustness of the network, allows the task allocation of the sharing node to be adjusted in time when the network fluctuates and changes, and keeps the continuity and the quality of the live stream. The method not only improves the efficiency and user experience of live stream transmission, but also reduces the load of the server, reduces network delay and packet loss rate, and finally realizes the overall performance optimization of the live stream sharing network.
In a more specific embodiment of the implementation of step S3330 of the present application, adjusting the effective duration of the shared node based on its mathematical quality score may be implemented by a more specific algorithm to ensure timeliness and accuracy of the network quality score (QosScore, also the mathematical quality score prior to validation). The algorithm determines the value of the effective duration (Intervel) based on the interval at QosScore and sets the timeout (QosExpireTs) for the network quality score accordingly.
In summary, the algorithm implementation principle of adjusting the effective duration of the shared node based on the mathematical quality score of the shared node can be summarized by firstly defining a series of scoring thresholds and corresponding effective duration values, wherein each scoring threshold corresponds to one effective duration, the scoring thresholds are arranged from high to low, and the effective duration is longer than the scoring threshold with high score. And after the mathematical quality scores of the sharing nodes are calculated, corresponding effective duration is given according to the scoring intervals defined by the sharing nodes, and the current time stamp is recorded. The timeout of the mathematical quality score is then set based on the effective duration value, and if the effective duration is greater than zero, the timeout is correspondingly increased while taking into account the addition of an additional security margin value to accommodate rapid changes in the network. If the effective duration is much greater than zero, the score immediately fails. Finally, according to the comparison of the overtime time and the current time, whether the mathematical quality score is still effective is determined, so that the actual network quality score of the sharing node is updated, the real-time performance and accuracy of the score are ensured, the management server can rapidly adjust task allocation according to the latest network state, and the performance and efficiency of the live stream sharing network are optimized. Specific implementation examples on the algorithm level are given below against this principle:
First, a number of different scoring thresholds (score_1, score_2, score_3, score_4) are defined according to the number of intervals expected, which constitute the Score interval of QosScore, and are arranged in order of score_1> score_2> score_3> score_4. Meanwhile, a plurality of effective duration values (Vaue _1, vaue_2, vaue_3 and vaue_4) are correspondingly defined, the relation of Vaue _1> vaue_2> vaue_3> vaue_4 is met, and the effective duration corresponding to different scoring intervals is represented.
When QosScore of a shared node is calculated, the effective duration Intervel is determined according to the comparison of the value and the preset threshold. If QosScore is greater than or equal to the highest threshold score_1, intervel is assigned the longest validity period Vaue _1 and the current timestamp is recorded, ensuring that the Score is valid for Vaue _1. If QosScore has a value between score_2 and score_1, intervel is assigned the next longest effective duration Vaue _2. Similarly, if QosScore has a value between score_3 and score_2, or below score_4, intervel is assigned to Vaue _3 and Vaue _4, respectively.
Next, a timeout QosExpireTs of QosScore is set according to the value Intervel. If Intervel is greater than 0, i.e., qosScore is in an active state, qosExpireTs will increase the time of Intervel and take the smaller of QosExpireTs and QosExpireTs plus an additional value Vaue _x as the final timeout. This additional value Vaue x may be used as a security margin to accommodate rapid changes in network conditions. If Intervel is equal to 0, i.e., qosScore is in an invalid state, qosExpireTs is set to 0, indicating that the score is immediately disabled.
Finally, the current actual network quality Score is calculated. If QosExpireTs is greater than the current timestamp, i.e., qosScore is still within the validity time limit, score will be assigned a value of QosScore, indicating that the current network quality Score is valid. If QosExpireTs is less than or equal to the current timestamp, i.e., qosScore has exceeded the validity time limit, score is assigned a value of 0, indicating that the current network quality Score has failed and needs to be reevaluated.
According to the embodiment, the efficiency and the stability of the live stream sharing network are remarkably improved by accurately managing the network quality score (QosScore) and the effective duration of the sharing node. By defining a series of scoring thresholds and corresponding effective duration values, the effective duration of the sharing nodes can be dynamically adjusted according to the real-time mathematical quality scores of the sharing nodes, and timeliness and accuracy of the scores are ensured. The mechanism allows the management server to quickly make a scheduling decision according to the current network state of the shared node, preferentially allocate tasks to nodes with good network state, and simultaneously avoid allocating critical tasks to nodes with poor network state, thereby optimizing the transmission path and quality of the live stream.
In addition, the embodiment enhances the adaptability of the system to rapid changes in the network by introducing an additional safety margin value (Vaue _x), and ensures the stability and reliability of the scoring system. By updating the actual network quality scores of the shared nodes in real time, the change of network conditions can be responded in time, live stream interruption or quality degradation caused by network fluctuation is reduced, and user experience is improved. Finally, the embodiment not only improves the efficiency of live stream transmission, but also reduces the load of a server, reduces network delay and packet loss rate, optimizes the performance and efficiency of the whole live stream sharing network, and provides smoother and higher-quality live experience for users.
On the basis of any embodiment of the method, the method for screening the target sharing node from the resource ordered list according to the real-time network quality score and the real-time resource redundancy comprises the following steps:
Step S3410, responding to a live stream sharing task matching request submitted by a sharing node needing to consume additional live streams, and acquiring a network penetration configuration type of the sharing node;
When the sharing node is accessing a live broadcasting room and consuming the corresponding current live broadcasting stream of the live broadcasting room, after the sharing node evaluates that the resource allowance of the sharing node is enough to bear the pulling transmission task of other additional live broadcasting streams, the live broadcasting stream sharing task matching request can be submitted to the management server, and the management server receives the live broadcasting stream sharing task matching request from the sharing node, wherein the request indicates that the sharing node expects to share the pulling transmission transaction of other additional live broadcasting streams and hopes to participate in the sharing task of the additional live broadcasting streams. The sharing node may provide its network penetration configuration type, i.e., NAT type, when submitting a matching request. NAT (network address translation) types describe how NAT devices sharing the network where the node is located handle packets, which directly affects the connectivity between the node and other network nodes, especially in P2P networks.
NAT types include Full Cone, restricted Cone RESTRICTED CONE, port-restricted Cone RESTRICTED CONE, symmetrical, and the like. The opening degree of each NAT type to the external connection is different, the full cone NAT is most open to the external connection, and the symmetrical NAT is most limited. The NAT type of the sharing node determines the capability of the node to successfully establish the P2P connection, thereby affecting the allocation of live stream sharing tasks.
Step S3420, adapting a preset selection strategy according to the network penetration configuration type, and correspondingly determining screening thresholds of the real-time network quality score and the real-time resource redundancy;
and the management server adapts a preset selection strategy according to the NAT type provided by the sharing node so as to determine a real-time network quality score and a screening threshold value of real-time resource redundancy of the node. This means that for shared nodes with different NAT types, the management server may set different scoring and resource-rich requirements to ensure efficient execution of the shared tasks. For example, for a full cone NAT node, the management server may set a lower network quality scoring threshold due to its strong connectivity, while for a symmetric NAT node, a higher scoring threshold may need to be set to ensure successful task performance due to its limited connectivity.
In one embodiment, the management server adjusts the filtering threshold according to the opening degree of the NAT type to optimize task allocation. For full cone NAT nodes, the screening threshold is set to be greater than 70% of network quality score and greater than 50% of resource margin, for limiting cone and port limiting cone NAT nodes, the threshold is increased to be greater than 80% of network quality score and greater than 60% of resource margin, and for symmetric NAT nodes, the threshold is highest, the network quality score is greater than 90% and the resource margin is greater than 70%.
This selection strategy ensures that the available resources are maximized and that those nodes that are most likely to successfully complete the task are preferentially selected, even in situations where network conditions are limited. By the method, the management server can reasonably distribute live stream sharing tasks according to the network penetration capacity of the sharing nodes, improve the success rate of task execution and optimize the performance of the whole live stream sharing network.
Step S3430, determining the sharing node with the real-time network quality score and the real-time resource margin exceeding the corresponding screening threshold values from the resource sorting list as the target sharing node.
When determining the target sharing node, the real-time network quality score and the real-time resource redundancy of the sharing nodes in the resource sequencing list can be compared with the screening threshold values of the real-time network quality score and the real-time resource redundancy, so that the sharing nodes with good network states and enough resource redundancy to bear the additional live stream sharing task can be identified.
After determining the screening threshold, the management server will traverse the ordered list of resources and select those sharing nodes for which both the real-time network quality score and the real-time resource margin exceed respective preset screening thresholds. These selected sharing nodes will be considered as target sharing nodes, which will participate in the pulling and transmission tasks of the additional live stream. For example, if the screening threshold set by the management server is that the network quality score is greater than 80% and the resource margin is greater than 60%, only the sharing node satisfying both conditions will be selected as the target node to perform the live stream sharing task.
According to the embodiment, the efficiency and the stability of the live stream sharing network are remarkably improved by accurately adapting a preset selection strategy according to the network penetration configuration type (NAT type) of the sharing node and setting the screening threshold of the real-time network quality score and the real-time resource redundancy according to the preset selection strategy. According to the embodiment, the management server is allowed to reasonably distribute live stream sharing tasks according to the network penetration capacity of the sharing nodes, and the nodes most likely to successfully finish the tasks are preferentially selected, so that the success rate of task execution is improved. By the method, available resources can be utilized to the maximum extent, the transmission path and quality of the live broadcast stream are optimized, network delay and packet loss rate are reduced, and smoother and higher-quality live broadcast experience is provided for users. In addition, the embodiment also enhances the adaptability and the robustness of the network, allows the task allocation of the sharing nodes to be adjusted in time when the network fluctuates and changes, maintains the continuity and the quality of the live stream, and optimizes the performance of the whole live stream sharing network.
On the basis of any embodiment of the method of the present application, pulling, by the target sharing node, the additional live stream for the sharing node consuming the additional live stream, including:
step S3440, a live stream sharing task corresponding to the additional live stream is sent to a target sharing node;
After selecting the target sharing nodes for bearing the live stream sharing tasks, the live stream sharing tasks corresponding to the additional live streams can be sent to the nodes, so that the nodes can start to provide pulling and transmission services of the additional live streams for other sharing nodes.
The assignment of a task is accomplished by an explicit instruction containing specific details of the task, such as an identifier of the live stream, a network address of the source node, an operation that the target shared node needs to perform, etc. The instruction is sent to the target sharing node through a preset communication protocol, so that accurate transmission of task information and smooth execution of tasks are ensured.
Step S3450, after the receiving target sharing node determines whether the network condition of the receiving target sharing node meets the preset condition corresponding to the supporting sharing service, the receiving target sharing node corresponds to the returned decision result, and when the decision result characterization is met, the target sharing node is added as a member node of the sharing ring of the additional live broadcast stream;
The management server needs to verify whether the network status of the target sharing node meets the preset condition, so as to ensure that the target sharing node can smoothly provide pulling and transmission services of the live stream. For this purpose, the management server waits for the decision result returned by the target sharing node. The decision result is derived from the target sharing node's evaluation of its own network conditions, indicating whether it has sufficient bandwidth, low latency and sufficient processing power to handle additional live streaming tasks. The target sharing node can determine the decision result by comparing with the corresponding preset performance threshold according to the key performance indexes such as the network bandwidth use condition, the CPU, the memory load and the like.
If the self-evaluation result of the target sharing node shows that it meets or exceeds these preset conditions, it will return a positive decision result to the management server indicating that it is ready and able to assume the sharing service. After receiving the positive feedback, the management server formally adds the node into the shared circle of the additional live stream, so that the node becomes a member node. The sharing circle is a node list maintained by the management server and contains all sharing nodes authorized to participate in the sharing task of the specific live stream.
Step S3460, receiving a pulling request from a sharing node consuming an additional live stream by a member node in the sharing circle, and providing a pulling transmission service of the additional live stream for the sharing node consuming the additional live stream according to a network condition determined by the member node in real time.
When the target shared nodes are added to the shared circle, as members of the shared circle, the nodes will begin to receive pull requests from the shared nodes that need to consume additional live streams. They provide pulling and transmission services of live streams to requesting nodes according to network conditions determined in real time by themselves. This includes pulling the direct-current data from the source node or other sharing node and transmitting it to the sharing node requesting service, ensuring smooth transmission and efficient distribution of the direct-current stream.
The member nodes can monitor key performance indexes such as network bandwidth, delay, packet loss rate and the like in real time so as to ensure that the member nodes can meet the requirements of providing live streaming services. Based on these real-time data, the member node will decide whether to accept the pull request from the other sharing node. If the network condition of the member node meets a preset performance threshold, such as sufficient bandwidth margin and low latency, it will accept the request and begin pulling the dc data. After the data pulling is completed, the member node transmits the live stream to the sharing node requesting the service.
In addition, the member node can continuously evaluate the network state of the member node in the process of providing the service so as to ensure the continuity and stability of the service. If network conditions deteriorate, such as a sudden increase in bandwidth usage or a delay increase, the member node may re-evaluate whether itself can continue to provide service and report status changes to the management server in time.
According to the embodiment, through accurate task assignment and network state evaluation, the efficiency and reliability of the live stream sharing network are remarkably improved. By sending specific live stream sharing tasks to the target sharing nodes and determining whether the nodes can bear additional live stream tasks according to the real-time network conditions of the nodes, the management server can effectively schedule resources and ensure stable transmission of live streams. The method not only optimizes the distribution path of the live broadcast stream and reduces the dependence on a central server, but also improves the expansibility and the adaptability of the network, so that the resource allocation can be responded and adjusted rapidly when the network fluctuates and changes. As a result, user experience is improved, fluency and quality of live streams are guaranteed, network delay and packet loss rate are reduced, and powerful technical support is provided for development of live services.
On the basis of any embodiment of the method, the pull transmission service of the additional live stream is provided for the sharing node consuming the additional live stream according to the network condition determined by the member node in real time, and the method comprises the following steps:
step S4110, monitoring the network bandwidth use condition and the resource load condition of the member node in real time, and calculating the currently available bandwidth use allowance and resource redundancy;
each member node can monitor own network bandwidth use condition and resource load condition in real time so as to accurately evaluate whether the member node has enough network conditions to support the pulling and transmission service of the additional live stream.
Specifically, the member node may determine the bandwidth usage margin by counting node periodically transmitted traffic, denoted as flow_send, and tracking the pull request traffic flow_add_second generated per second for a preset period of time to form a queue flow_queue, and accumulating the traffic flow_all. If the pull request is canceled, the corresponding flow_removed_second is removed from the flow_queue and the flow_all is updated. By comparing the accumulated flow_all plus the sending flow_send with the self-defined bandwidth threshold flow_threshold, the member node can determine whether the current estimated bandwidth capacity meets the request, and the determined bandwidth allowance is the effective bandwidth usage allowance.
For the determination of the resource redundancy, the member node evaluates the resource usage including CPU, memory and GPU in the manner previously described. This is consistent with the aforementioned determination method, that is, the real-time resource redundancy is obtained by analyzing the resource usage index of the shared node, such as the CPU usage allowance, the memory usage allowance, and the GPU usage allowance, and performing weighted fusion according to the preset weight coefficient.
Accordingly, the member node can obtain the bandwidth use allowance and the resource redundancy which are currently available by the member node, and the data are used for later evaluating whether the member node can bear the pulling transmission task of the additional live stream.
Step S4120, according to the network conditions characterized by the bandwidth usage allowance and the resource allowance obtained by calculation, evaluating whether the member node has enough network conditions to support the pull transmission service of the additional live stream;
After obtaining the data of the bandwidth usage allowance and the resource redundancy, the member node compares the data with a preset performance threshold. These preset thresholds may be set according to historical data and traffic requirements to ensure quality and efficiency of live streaming. If the bandwidth usage margin and the resource margin of a member node are both above or equal to these thresholds, then the node may be considered to have sufficient network conditions to support the pull transport services of additional live streams.
For example, if the preset bandwidth threshold is 100Mbps and the current bandwidth usage allowance of the member node is 150Mbps, the preset resource redundancy threshold is 70% and the resource redundancy of the member node is 80%, the member node meets the preset requirement and can bear the additional live stream sharing task. Conversely, if the bandwidth usage margin or resource margin of the member node is below these thresholds, it will not be able to assume additional live stream tasks to avoid affecting the quality and stability of the existing live stream.
In step S4130, when the evaluation result indicates that the network condition meets the preset requirement, the member node responds to the pull stream request of the sharing node consuming the additional live stream, establishes a data transmission connection with the member node, pulls the additional live stream from the source node or other sharing nodes through the established connection, and transmits the additional live stream to the sharing node consuming the additional live stream.
After confirming that the bandwidth utilization allowance and the resource redundancy allowance of the member node meet the preset performance threshold, the member node actively responds to the streaming requests from other sharing nodes. And establishing a data transmission connection with a requester of the streaming request, and then establishing a stable network connection with a sharing node requesting the live stream by utilizing available bandwidth and resources so as to transmit the live stream data.
After establishing the connection, the member node pulls additional live stream data from the source node or other shared nodes. After the data is acquired, the member node transmits the live streams to the sharing node requesting the service. In the transmission process, the member node can dynamically adjust the transmission rate and the strategy according to the change of the network condition so as to ensure the fluency and the stability of the live stream. For example, if a sudden decrease in network bandwidth or a delay increase is detected, the member node may decrease the transmission rate or select a better transmission path to accommodate these changes.
In addition, the member node continuously monitors the network state of the member node in the process of providing the service, so that the continuity and stability of the service are ensured. If the network conditions deteriorate to a point where the quality of live stream transmission cannot be maintained, the member nodes will report to the management server in time and may pause or terminate service to avoid affecting the overall quality of the live stream.
According to the method, the device and the system, the member node evaluates the network bandwidth use allowance and the resource redundancy of the member node, so that efficient scheduling of the live stream sharing task is achieved. By monitoring and comparing the key indexes with a preset threshold in real time, the member node can accurately judge whether the member node has enough network resources to bear additional live stream transmission tasks. The method ensures that only nodes with enough resources can participate in pulling and transmission of the live stream, thereby improving the stability and quality of the live stream transmission. In addition, the transmission strategy and the capability of continuously monitoring the network state are dynamically adjusted, so that member nodes can adapt to the change of network conditions, and the transmission efficiency of the live stream is optimized. Finally, the refined resource management and scheduling mechanism not only improves the user experience and reduces the delay and the packet loss rate, but also enhances the overall performance and the reliability of the live stream sharing network, and provides smoother and higher-quality live experience for the user.
On the basis of any embodiment of the method, the pull transmission service of the additional live stream is provided for the sharing node consuming the additional live stream according to the network condition determined by the member node in real time, and the method comprises the following steps:
Step S4210, collecting a plurality of network performance indexes of the member node in real time, wherein the network performance indexes comprise any plurality of packet loss rate and delay value, network penetration configuration type score, CPU use allowance, memory use allowance and GPU use allowance corresponding to the current live stream which the member node is accessing;
In this embodiment, a plurality of specific network performance indexes of the member node are collected in real time, so as to evaluate whether the node can bear the pulling and transmission services of the additional live stream. Specifically, the network performance indicators that the member node needs to collect include bandwidth usage allowance, packet loss rate, delay value, network penetration configuration type score, CPU usage allowance, memory usage allowance, and GPU usage allowance. These metrics can comprehensively reflect the network status and resource availability of the nodes.
Bandwidth usage allowance refers to the amount of network bandwidth that a member node is currently unoccupied and is directly related to the data transfer capability that the node is capable of providing. The packet loss rate and the delay value are key parameters for measuring the network transmission quality, and directly influence the real-time transmission quality and the user experience of the live stream. The network penetration configuration type score reflects the connection capability of the nodes in the P2P network, and the influence of different NAT types on the connection between the nodes is different. CPU, memory and GPU use margins respectively represent processing capacity, data storage capacity and graphics processing capacity of the node. In actual operation, the member nodes collect the network performance indexes according to a preset time interval (for example, every 30 seconds or every minute) for real-time analysis, so as to evaluate whether the network conditions of the nodes meet the pulling and transmission requirements of the additional live stream.
Step S4220, carrying out weighted calculation on all the collected network performance indexes according to preset weight coefficients to obtain network service scores comprehensively reflecting the network conditions of member nodes, wherein the weight coefficients of the packet loss rate and the delay value are configured as negative items;
And weighting and calculating the collected network performance indexes according to preset weight coefficients to obtain the network service score comprehensively reflecting the network conditions of the member nodes. Accordingly, the total index value of each network performance index is determined. For example, for network response metrics, including packet loss rate and delay value, they are weighted by a specific weight coefficient to form a unified overall metric value. In this embodiment, the weighting coefficients of the packet loss rate and delay value are configured as negative terms, as these indicators generally reflect adverse aspects of network performance, with lower values indicating better network performance.
Specifically, the network response index focuses on the network performance index corresponding to the live stream being consumed by the member node, and the total index value can be calculated by the following formula that ScoreStreamFloated = LossRateStreamA ×w1+ RTTSTREAMA ×w2, wherein LossRateStreamA represents the packet loss rate, RTTSTREAMA represents the delay value, and w1 and w2 are corresponding weight coefficients. These weight coefficients are set according to the importance of the network response index, and typically the values of w1 and w2 will be such that the packet loss rate and delay value will be of the appropriate weight in the final score.
The network configuration index is a network penetration configuration type score, and is set based on the NAT type of the member node. Different NAT types are friendly to P2P connections to different degrees, thereby affecting the transmission efficiency of the live stream. Thus, depending on the NAT type, a different fixed score ScoreFixed is set, where Full Cone NAT is X, port-RESTRICTED CONE NAT is Y, RESTRICTED CONE NAT and SYMMETRIC NAT are Z, and X > Y > Z.
The overhead metrics include CPU utilization margin, GPU utilization margin, and memory utilization margin, which are quantized into a machine score float score ScoreMachineFloated by weighted fusion. For example ScoreMachineFloated = CPULeft ×f1+ GPULeft ×f2+ MemLeft ×f3, where f1, f2, and f3 are corresponding weight coefficients, and f1> f3> f2 reflect the importance of different resources in live streaming.
Finally, the network service score ScoreFinal is obtained by weighted fusion of the total values of the indexes, and the formula is ScoreFinal = ScoreFixed fa+ ScoreMachineFloatedfb-ScoreStreamFloatedfc. Here, fa, fb, and fc are weight coefficients, and fc > fa > fb are made to be arranged from large to small according to the importance of each index, and the weighting result of the network response index items is configured to be negative by setting its weight to a negative number to reflect its negative influence on the network service quality.
Through this weighted calculation, the network service score ScoreFinal comprehensively considers the effects of network configuration, network response and overhead, providing a quantified network service condition assessment result. The score not only reflects the network service condition of the member node, but also is directly related to the decision of whether to start a new channel and whether to maintain an existing channel, thereby providing scientific basis for the allocation and execution of the live stream sharing task.
Step S4230, comparing the calculated network service score with a preset condition wide limit interval, and limiting the pull transmission service of at least one additional live stream by the member node according to a preset limiting strategy when the network service score is lower than the condition wide limit interval;
The conditional grace period is a range of values set to ensure the quality and efficiency of live stream transmission. When the network service score of an member node is below this preset threshold, it means that the network conditions of the node are insufficient to support the pulling and transmission of additional live streams, or there is a potential risk that service interruption or quality degradation may result. In this case, the member node will restrict the pull transport service of the at least one additional live stream according to a preset restriction policy. Such a limiting strategy may be to disconnect a partial pull request, suspend a new pull request, reduce the transmission rate in order to guarantee preferentially the quality of service of the live stream currently being transmitted.
And step S4240, when the condition width limit interval is higher than the condition width limit interval, responding to a stream pulling request of a sharing node consuming the additional live stream, establishing data transmission connection with the sharing node consuming the additional live stream, pulling the additional live stream from a source node or other sharing nodes through the established connection, and transmitting the additional live stream to the sharing node consuming the additional live stream.
When the network service score of the member node is higher than the preset condition wide limit interval, the node has good network conditions and can support the pulling and transmission services of the additional live stream. In this case, the member node will actively respond to the pull request from the other shared node, initiating the establishment procedure of the data transfer connection. And a stable network connection is established between the network connection and the sharing node requesting the live stream so as to efficiently transmit the live stream data.
After establishing the connection, the member node will pull additional live stream data from the source node or other shared node. After the data is acquired, the member node transmits the live streams to the sharing node requesting the service. In addition, the member node continuously monitors the network state of the member node in the process of providing the service, so that the continuity and stability of the service are ensured. If the network conditions deteriorate to a point where the quality of live stream transmission cannot be maintained, the member nodes will report to the management server in time and may pause or terminate service to avoid affecting the overall quality of the live stream.
According to the embodiment, the member nodes monitor and evaluate the network performance indexes of the member nodes in real time, so that the accurate scheduling and efficient management of the live stream sharing task are realized. The method ensures that only nodes with good network conditions can bear additional live stream transmission tasks, and the priority insurance member node consumes the stability of the current live stream of the accessing live broadcast room, so that the transmission quality and user experience of the live stream are improved from the full-platform perspective.
In the embodiment, key indexes such as a packet loss rate, a delay value, a network penetration configuration type score, a CPU (central processing unit) use allowance, a memory use allowance, a GPU use allowance and the like are acquired in real time, and weighting calculation is performed by combining a preset weight coefficient, so that a network service score comprehensively reflecting network service conditions is obtained, when the network service score is higher than a preset condition wide limit interval, member nodes actively respond to a streaming request, establish data transmission connection with a request node, and pull additional live streams from a source node or other sharing nodes for transmission. In the transmission process, the transmission strategy is dynamically adjusted to adapt to the change of network conditions such as suspending service or reducing the transmission rate, so that the stable transmission of the live stream is ensured, and the quality and stability of the live stream are ensured. In general, the application of the embodiment remarkably improves the efficiency and reliability of the live stream sharing network, optimizes the resource allocation, reduces the network delay and the packet loss rate, and improves the transmission quality of the live stream, thereby providing a smoother and higher-quality live experience for users. This approach also enhances the adaptability and robustness of the network so that the system can quickly respond and maintain the continuity and quality of service in the face of network fluctuations and changes.
Referring to fig. 3, a live stream sharing node scheduling device provided in an aspect of the present application includes a state monitoring module 3100, a resource ordering module 3200, a node scoring module 3300, and a service executing module 3400, where the state monitoring module 3100 is configured to receive network state information periodically reported by a sharing node pre-registered as a consumption type in a peer-to-peer network in a process of consuming a current live stream being transmitted by the sharing node, where the network state information includes resource usage information and network quality information of a corresponding sharing node, the resource ordering module 3200 is configured to determine a real-time resource surplus of the consumption type sharing node according to the periodically reported resource usage information, order the consumption type sharing node according to the real-time resource surplus to obtain a resource ordering list, the node scoring module 3300 is configured to determine a real-time network quality score of the consumption type sharing node according to the periodically reported network quality information, and the service executing module 3400 is configured to screen out a target sharing node from the resource ordering list according to the real-time network quality score and the real-time resource surplus, and to obtain an additional live stream for the live stream being transmitted by the target sharing node.
On the basis of any embodiment of the device, the resource ordering module 3200 comprises an index extraction module, a resource quantization module and a node ordering module, wherein the index extraction module is used for extracting various resource usage indexes of a consumption type sharing node from periodically reported resource usage information, the resource usage indexes comprise bandwidth usage allowance, CPU usage allowance, memory usage allowance and GPU usage allowance, the resource quantization module is used for carrying out weighted fusion on the corresponding allowance of each resource usage index according to a preset weight coefficient to obtain real-time resource redundancy of the consumption type sharing node, the weight coefficient reflects importance and contribution of different resources, and the node ordering module is used for ordering the consumption type sharing node in a descending order according to the real-time resource redundancy to generate a resource ordering list.
On the basis of any embodiment of the device, the node scoring module 3300 comprises a reporting and queuing module, a scoring operation module and a scoring determining module, wherein the reporting and queuing module is used for adding network quality information reported by each consumption type sharing node period into a quality information queue corresponding to the sharing node, the scoring operation module is used for counting the proportion of the network quality information with poor quality in the quality information queue to the total network quality information of the whole queue based on the quality information queue, determining the proportion as the mathematical quality score of the corresponding sharing node, wherein when the packet loss rate in the network quality information is larger than a preset packet loss rate threshold value or the time delay is larger than a preset time delay threshold value, the network quality information with poor quality is confirmed, and the scoring determining module is used for setting and maintaining the effective time length of the mathematical quality score according to the interval where the mathematical quality score of each sharing node is located, and taking the mathematical quality score as the real-time network quality score of the corresponding sharing node in the effective time length.
On the basis of any embodiment of the device, the service execution module 3400 comprises a configuration determining module, a threshold determining module and a target screening module, wherein the configuration determining module is used for responding to a live stream sharing task matching request submitted by a sharing node needing to consume additional live streams to acquire a network penetration configuration type of the sharing node, the threshold determining module is used for correspondingly determining screening thresholds of the real-time network quality score and the real-time resource redundancy according to a preset selection strategy matched with the network penetration configuration type, and the target screening module is used for determining the sharing node with the real-time network quality score and the real-time resource redundancy exceeding the corresponding screening thresholds from the resource ordering list as a target sharing node.
On the basis of any embodiment of the device, the service execution module 3400 comprises a task pushing module, a node self-decision module and a pulling response module, wherein the task pushing module is configured to send a live stream sharing task corresponding to the additional live stream to a target sharing node, the node self-decision module is configured to receive a decision result returned correspondingly after the target sharing node determines whether a network condition of the target sharing node meets a preset condition corresponding to supporting sharing service, when the decision result characterization is met, the target sharing node is added as a member node of a sharing ring of the additional live stream, and the pulling response module is configured to receive a pulling request from the member node in the sharing ring for consuming the additional live stream, and provide a pulling transmission service of the additional live stream for the sharing node for consuming the additional live stream according to the network condition determined by the member node in real time.
On the basis of any embodiment of the device, the pull stream response module comprises a node monitoring module, a condition evaluation module and a pull stream execution module, wherein the node monitoring module is used for monitoring network bandwidth use conditions and resource load conditions of member nodes in real time, calculating currently available bandwidth use allowance and resource allowance, the condition evaluation module is used for evaluating whether the member nodes have enough network conditions to support pull transmission services of additional live streams according to network conditions represented by the calculated bandwidth use allowance and resource allowance, and the pull stream execution module is used for responding to pull stream requests of sharing nodes consuming the additional live streams when the evaluation results indicate that the network conditions meet preset requirements, establishing data transmission connection with the pull stream requests, pulling the additional live streams from source nodes or other sharing nodes by the member nodes through the established connection, and transmitting the additional live streams to the sharing nodes consuming the additional live streams.
On the basis of any embodiment of the device, the pull stream response module comprises an index detection module, a pull stream execution module and a pull stream execution module, wherein the index detection module is used for acquiring a plurality of network performance indexes of member nodes per se in real time, including any multiple items of packet loss rate and delay value, network penetration configuration type score, CPU (central processing unit) use allowance, memory use allowance and GPU use allowance corresponding to the current live stream being accessed by the member nodes, the score determination module is used for carrying out weighted calculation on the acquired network performance indexes according to a preset weight coefficient to obtain a network service score comprehensively reflecting the network conditions of the member nodes, the weight coefficient of the packet loss rate and the delay value is configured as a negative item, the limit execution module is used for comparing the calculated network service score with a preset condition wide range, when the network service score is lower than the condition wide range, the member nodes limit the pull stream transmission service of at least one additional live stream according to a preset limit strategy, and when the network service score is higher than the condition wide range, the pull stream execution module is used for responding to the pull stream request of a shared additional stream consumption sharing node, the pull stream is connected with the additional live stream sharing node or the additional live stream sharing node, and the additional stream transmission source is connected with the live stream sharing node is established.
The application further provides a live stream sharing node scheduling device. As shown in fig. 4, the internal structure of the live stream sharing node scheduling device is schematically shown. The live stream sharing node scheduling device includes a processor, a computer readable storage medium, a memory, and a network interface connected by a system bus. The computer readable nonvolatile storage medium of the live stream sharing node scheduling device stores an operating system, a database and computer readable instructions, wherein the database can store an information sequence, and when the computer readable instructions are executed by a processor, the processor can realize a live stream sharing node scheduling method.
The processor of the live stream sharing node scheduling device is used for providing computing and control capabilities and supporting the operation of the whole live stream sharing node scheduling device. The memory of the live stream sharing node scheduling device may store computer readable instructions, which when executed by the processor, may cause the processor to execute the live stream sharing node scheduling method of the present application. The network interface of the live stream sharing node scheduling device is used for communicating with the terminal connection.
It will be appreciated by those skilled in the art that the structure shown in fig. 4 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation of the live stream sharing node scheduling apparatus to which the present application is applied, and that a specific live stream sharing node scheduling apparatus may include more or less components than those shown in the drawings, or may combine some components, or have a different arrangement of components.
The processor in this embodiment is configured to perform specific functions of each module in fig. 3, and the memory stores program codes and various types of data required for executing the above modules or sub-modules. The network interface is used for realizing data transmission between the user terminals or the servers. The nonvolatile readable storage medium in this embodiment stores therein program codes and data required for executing all modules in the live-stream sharing node scheduling apparatus of the present application, and the server can call the program codes and data of the server to execute the functions of all modules.
The present application also provides a non-transitory readable storage medium storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the live stream sharing node scheduling method of any of the embodiments of the present application.
The application also provides a computer program product comprising computer programs/instructions which when executed by one or more processors implement the steps of the method of any of the embodiments of the application.
It will be appreciated by those skilled in the art that implementing all or part of the above-described methods according to the embodiments of the present application may be implemented by a computer program for instructing relevant hardware, where the computer program may be stored in a non-volatile readable storage medium, and where the program, when executed, may include the steps of the embodiments of the methods described above. The storage medium may be a computer readable storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
In summary, the application exhibits significant advantages in application. Firstly, it greatly promotes the efficiency and stability of live stream transmission. By accurately evaluating the resource redundancy and the network quality of the shared nodes and reasonably scheduling the node resources, the live broadcast stream can be distributed through an optimal transmission path, delay and packet loss phenomena in the data transmission process are reduced, and smooth playing of the live broadcast content is ensured. And secondly, the pressure of the centralized server is effectively relieved, and the load and the operation cost of the server are reduced. And part of transmission tasks are distributed to each sharing node, so that the server can concentrate on the processing of core services, and the reliability and expansibility of the whole live broadcast system are improved. In addition, the method and the device fully utilize idle resources of terminal equipment in the peer-to-peer network, improve the utilization rate of the resources, and provide richer live broadcast contents and better viewing experience for users. Meanwhile, the method has good flexibility and adaptability, the scheduling strategy can be dynamically adjusted according to the real-time network state and the node condition, the network change and the user demand can be responded quickly, and the robustness and the user experience of the live broadcast system are enhanced. In a word, the application provides a high-efficiency, stable and economic solution for the live broadcast industry, and has wide application prospect and important popularization value.