Method and apparatus for determining streaming server, server, platform and medium

By calculating the streaming load of the streaming media server and selecting the target server based on preset constraints, the problem of unbalanced streaming media server load is solved, achieving load balancing and efficient data stream access.

CN118764487BActive Publication Date: 2026-02-13CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411161885.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2026-02-13
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

The existing problem of unbalanced load on streaming media servers makes it impossible to guarantee that a balanced load will always be selected between servers with sufficient capacity and support for different transmission protocols.

Method used

By acquiring the performance data of each streaming media server, calculating its streaming load, and selecting the streaming media server with the lowest load and that meets the constraints as the target server based on the streaming load and preset constraints, load balancing is ensured.

Benefits of technology

Load balancing of streaming media servers was achieved, ensuring that each server had sufficient performance spare capacity, and guaranteeing the efficiency and stability of data stream access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764487B_ABST
    Figure CN118764487B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a kind of determination method, device, server, platform and medium of streaming media server, applied to cloud computing field.The method comprises: obtaining the data stream access request sent by service server;According to the performance data of each streaming media server, the stream load of each streaming media server is calculated;The streaming media server that meets the preset constraint condition and the stream load is lowest is determined as target streaming media server;The identification of target streaming media server is returned to service server.The method is used to realize the effect of streaming media server load balancing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of cloud computing, and particularly relates to a determination method and device of a streaming media server, a server, a platform and a medium. BACKGROUND

[0002] With the development of Internet technology, online transmission of streaming media has become the main direction of development of audio and video media. By connecting a sending end and a receiving end through a streaming media server, media data is streamed, meeting the needs of media transmission scenarios with high real-time requirements. How to select a suitable streaming media server becomes a focus in media data streaming.

[0003] In the prior art, selection of a streaming media server is mainly realized through classification and comparison of transmission protocols. Specifically, according to a transmission protocol used by a media data stream service, a streaming media server supporting the transmission protocol is searched for, and the media data stream service is allocated to the corresponding streaming media server for execution. For example, a cluster contains servers A1 and A2, wherein the transmission protocol used by the media data stream service is protocol one, server A1 supports protocol one, and server A2 supports protocol two, and server A1 is determined as the target streaming media server of the media data stream service.

[0004] However, the existing streaming media server has the problem of uneven load. SUMMARY

[0005] The embodiments of the present application provide a determination method, device, server, platform and medium of a streaming media server, so as to achieve the effect of load balancing of the streaming media server.

[0006] In a first aspect, the embodiments of the present application provide a determination method of a streaming media server, comprising:

[0007] obtaining a data stream access request sent by a service server;

[0008] calculating a stream load of each streaming media server according to performance data of each streaming media server;

[0009] determining a streaming media server satisfying a preset constraint condition and having the lowest stream load as a target streaming media server;

[0010] returning an identifier of the target streaming media server to the service server.

[0011] In a possible implementation, before calculating the stream load of each streaming media server according to the performance data of each streaming media server, the method comprises:

[0012] obtaining performance data periodically reported by each streaming media server;

[0013] The performance data includes processor information, network bandwidth information, a number of current carried information streams, a protocol type of each information stream, and a traffic bandwidth of each information stream.

[0014] In a possible implementation, the stream load of each stream media server is calculated according to the performance data of each stream media server, including:

[0015] For each stream media server, a preset protocol weight corresponding to each information stream is determined based on the protocol type of each information stream.

[0016] A preset traffic weight corresponding to each information stream is determined based on the traffic bandwidth of each information stream.

[0017] The stream load of the stream media server is calculated based on the number of information streams, the preset traffic weight and the preset protocol weight of each information stream.

[0018] In a possible implementation, the stream media server that meets the preset constraint condition and has the lowest stream load is determined as the target stream media server, including:

[0019] For each stream media server, the number of processor cores of the stream media server is determined based on the processor information.

[0020] The available total bandwidth of the stream media server is determined based on the network bandwidth information.

[0021] The preset constraint condition corresponding to the stream media server is determined based on the number of processor cores, the available total bandwidth, the number of information streams, and the traffic bandwidth of each information stream.

[0022] The stream media server that meets the corresponding preset constraint condition is determined as an intermediate stream media server.

[0023] The intermediate stream media server with the lowest stream load is determined as the target stream media server.

[0024] In a second aspect, an embodiment of the present application provides a determination apparatus of a stream media server, including:

[0025] An acquisition module is configured to acquire a data stream access request sent by a service server.

[0026] A first processing module is configured to calculate a stream load of each stream media server according to performance data of each stream media server.

[0027] A determination module is configured to determine a stream media server that meets a preset constraint condition and has the lowest stream load as a target stream media server.

[0028] A second processing module is configured to return an identifier of the target stream media server to the service server.

[0029] In a possible implementation, the first processing module is further configured to:

[0030] obtain performance data periodically reported by each streaming media server;

[0031] The performance data comprises processor information, network bandwidth information, a number of information streams currently carried by the streaming media server, a protocol type of each information stream, and a traffic bandwidth of each information stream.

[0032] In a possible implementation, the first processing module is further configured to:

[0033] For each streaming media server, determine a preset protocol weight corresponding to each information stream based on the protocol type of each information stream;

[0034] determine a preset traffic weight corresponding to each information stream based on the traffic bandwidth of each information stream;

[0035] calculate a stream load of the streaming media server based on the number of information streams, the preset traffic weight, and the preset protocol weight of each information stream.

[0036] In a possible implementation, the determining module is further configured to:

[0037] For each streaming media server, determine a number of processor cores of the streaming media server based on the processor information;

[0038] determine a total available bandwidth of the streaming media server based on the network bandwidth information;

[0039] determine a preset constraint condition corresponding to the streaming media server based on the number of processor cores, the total available bandwidth, the number of information streams, and the traffic bandwidth of each information stream;

[0040] determine a middle streaming media server that meets the preset constraint condition as the target streaming media server.

[0041] determine a middle streaming media server that meets the preset constraint condition as the target streaming media server.

[0042] In a third aspect, an embodiment of the present application provides a scheduling server, comprising a memory and a processor.

[0043] The memory stores computer execution instructions.

[0044] The processor executes the computer execution instructions stored in the memory, so that the processor performs the first aspect and / or various possible implementations of the first aspect.

[0045] In a fourth aspect, an embodiment of the present application provides a cloud computing platform, comprising a service server, a scheduling server and a plurality of streaming media servers;

[0046] The scheduling server is configured to perform the method according to the first aspect and / or various possible implementation manners of the first aspect.

[0047] The service server is configured to send the to-be-processed data stream to a target streaming media server corresponding to the target scheduling server based on the identifier of the target scheduling server returned by the scheduling server.

[0048] The target streaming media server is configured to perform at least one of the following processing on the to-be-processed data stream: playing processing, recording processing and analyzing processing.

[0049] In a possible implementation manner, each streaming media server supports a plurality of streaming media transmission protocols, and different streaming media servers support the same streaming media transmission protocol.

[0050] In a fifth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are configured to implement the first aspect and / or various possible implementation manners of the first aspect when executed by a processor.

[0051] In a sixth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, and the computer program is configured to implement the first aspect and / or various possible implementation manners of the first aspect when executed by a processor.

[0052] The method and device for determining a streaming media server, the server, the platform and the medium provided by the embodiments of the present application obtain a data stream access request sent by a service server, and calculate the flow load of each streaming media server according to the performance data of each streaming media server, so as to select and allocate the streaming media server based on the flow load. Compared with the prior art, the embodiments of the present application select the streaming media server by using the flow load of the streaming media server and a preset constraint condition, so as to determine the lowest and most suitable streaming media server for the access server of the job data stream. The performance of the streaming media server for data stream access is ensured to be sufficient, so as to guarantee the load balancing of the streaming media server. BRIEF DESCRIPTION OF DRAWINGS

[0053] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0054] Figure 1 A scene schematic diagram of media data stream processing service provided by the present application;

[0055] Figure 2The application scenario diagram of the determination method of the streaming media server suitable for the embodiment of the application

[0056] Figure 3 The flow of the determination method of the streaming media server provided by the embodiment of the application Figure 1 ;

[0057] Figure 4 The system architecture diagram of the streaming media server performance data reporting method provided by the embodiment of the application

[0058] Figure 5 The flow of the streaming media server performance data reporting method provided by the embodiment of the application

[0059] Figure 6 The flow of the determination method of the streaming media server provided by the application Figure 2 ;

[0060] Figure 7 The structural schematic diagram of the determination device of the streaming media server provided by the application

[0061] Figure 8 The flow of the data stream processing method based on the streaming media server provided by the embodiment of the application

[0062] Figure 9 The structural schematic diagram of the data stream processing device based on the streaming media server provided by the embodiment of the application

[0063] Figure 10 The hardware structural diagram of the scheduling server provided by the application.

[0064] Through the above-mentioned drawings, the specific embodiments of the application have been shown, and more detailed descriptions will be given hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the application by any means, but to illustrate the concept of the application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0065] The exemplary embodiments will be described in detail herein with reference to the accompanying drawings. The following description is presented with reference to the drawings to explain the present application. It should be noted that the present application can be implemented in various ways, and is not limited to the exemplary embodiments described herein. The following exemplary embodiments are described in detail with reference to the drawings. In the following description, identical or similar components are designated by the same reference numerals, and a repeated explanation is omitted.

[0066] First, the terms involved in the present application are explained:

[0067] GB28181 - "Video Surveillance Networking Transmission Protocol" (GB28181): is the mainstream protocol standard in the video monitoring scene. The media stream transmission protocol in GB28181 protocol adopts Real-time Transport Protocol (RTP) or Secure Real-time Transport Protocol (SRTP), and the media stream is encapsulated in Program Stream (MPEG-2 Program Stream, MPEG2-PS). It is necessary to support User Datagram Protocol (UDP) and Transmission Control Protocol (TCP) transmission on the underlying transmission protocol. GB28181 protocol relies on Session Initiation Protocol (SIP) signaling to establish a stream media transmission channel and only supports push mode.

[0068] Real Time Stream Protocol (RTSP): commonly used in video conferencing, security monitoring and other scenes, is the mainstream protocol standard in multiple business scenarios. The media stream transmission protocol in RTSP protocol also adopts RTP / RTCP transmission, and the media stream is encapsulated in raw audio and video frames. It is necessary to support UDP and TCP transmission on the underlying transmission protocol, and RTSP needs to support both push and pull modes.

[0069] Real Time Messaging Protocol (RTMP): commonly used in network live broadcast, network on-demand and other scenes, commonly used in device-side active push mode scenarios. RTMP protocol adopts block message transmission mode, and the media stream is encapsulated in the message format corresponding to RTMP. RTMP is established on TCP protocol on the underlying transmission protocol, only needs to support TCP protocol, and RTMP supports both push and pull modes.

[0070] HTTP Live Streaming (HLS) is a streaming media transmission protocol based on the Hypertext Transfer Protocol (HTTP). Due to its excellent native browser support, it is widely used in video-on-demand and live streaming. The HLS protocol achieves streaming by providing a media list file and supporting media file downloads via HTTP. Its transport layer protocol can be completed using only the standard HTTP protocol. The media stream is encapsulated as a transport stream (MPEG-2 Transport Stream, MPEG2-TS). Because HLS is based on the HTTP protocol, and the HTTP protocol is based on the TCP protocol, the underlying HLS transport protocol only supports the TCP protocol and only supports pull streaming mode.

[0071] Web Real-Time Communication (WebRTC) is an application programming interface (API) that enables real-time voice or video conversations in web browsers. WebRTC uses SRTP to encrypt RTP data, authenticate and ensure integrity, and protect against replay attacks. It is a security framework that provides confidentiality by encrypting the RTP payload and supporting original authentication. WebRTC's security features are a crucial component of its reliability, and its foundation is entirely built around RTP. The underlying Web RTP packets rely on UDP for transmission, and the underlying transport protocol only supports UDP. Furthermore, WebRTC streaming relies on signaling for connection establishment, therefore only push streaming mode is supported.

[0072] Figure 1 This is a schematic diagram illustrating a media data stream processing service scenario provided in this application. For example... Figure 1 As shown, specific application scenarios include: a business server 101, at least one streaming media cluster 102, multiple source stream clients 104, and multiple consumer clients 105. The streaming media cluster 102 includes at least one streaming media server 103.

[0073] The processing of the media data stream refers to that the service server 101 is connected with the plurality of streaming media clusters 102 and ensures that the communication connection is normal; the service server 101 processes the service based on the current media data stream to be processed, and determines the target streaming media server for processing the media data stream from the plurality of streaming media clusters 102 with normal communication connection. Each streaming media cluster 102 includes a plurality of streaming media servers 103. After determining the target streaming media server, the service server 101 controls the source streaming client 104, the target streaming media server and the consumer client 105 corresponding to the media data stream processing service to perform the distribution and / or playing processing of the media data stream.

[0074] In the prior art, the selection of the target streaming media server is determined according to the classification of the transmission protocol. Specifically, the streaming media server corresponding to the transmission protocol type is determined according to the transmission protocol type supported by the streaming media server and the transmission protocol type used by the media data stream. For example, the streaming media servers corresponding to the transmission protocol one include B1 and B2, and the streaming media servers corresponding to the transmission protocol two include B3 and B4. When the protocol corresponding to the media data stream is the transmission protocol two, the target streaming media server is determined by polling in the streaming media servers B3 and B4.

[0075] However, in the actual selection of the streaming media server, the selection according to the protocol only essentially considers the use times of the streaming media server. For example, there are four streaming media servers supporting the transmission protocol used by the media data stream, which are server C1, server C2, server C3 and server C4. Service one selects server C1 according to the polling method, service two selects server C2 according to the polling method, and so on, and the server selected by the subsequent service can be determined. Due to the differences in the media stream processing speed, the server load remaining and the data amount of the media data stream of different streaming media servers in the actual application, it is impossible to ensure that a streaming media server with sufficient remaining amount is selected every time, and it is also impossible to ensure the balance of the load between the servers supporting different transmission protocols and the servers of the same protocol. Therefore, it can be known that the prior art has the problem of unbalanced load of the streaming media server.

[0076] To address the aforementioned technical problems, this application proposes the following technical concept: Existing methods that classify media streaming servers according to transmission protocols and select them through round-robin within the corresponding combinations primarily aim to schedule and utilize media streaming server resources within a cluster. However, in practical applications, performance differences between different media streaming servers lead to uneven load distribution within the cluster. Therefore, this application calculates the streaming load of each media streaming server at the media stream data processing layer based on the most recent performance data of each server when the business server issues a data stream access request. Based on the streaming load of each server and its corresponding preset constraints, the target media streaming server with the lowest streaming load and meeting the preset constraints is selected. The preset constraints ensure that the remaining load capacity and network bandwidth of the media streaming server are sufficient to handle the data stream access. Then, the identifier of the target media streaming server is returned to the business server. In this way, the most suitable target media streaming server can be determined based on the streaming load of each server processing the media data stream, thereby ensuring load balancing among the media streaming servers.

[0077] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0078] Figure 2 This diagram illustrates an application scenario for the method of determining a streaming media server applicable to embodiments of this application. For example... Figure 2 As shown, this application scenario includes: a business server 201, a scheduling processor 202, at least one streaming media cluster 203, multiple source stream clients 205, and multiple consumer clients 206. Each streaming media cluster 203 includes at least one streaming media server 204.

[0079] In the determination of the streaming server, the streaming server 204 periodically reports the current performance data of each streaming server 204 to the scheduling server 202 through the streaming cluster 203; the scheduling server 202 receives the data stream request from the service server 201, and calculates the stream load of each streaming server 204 according to the latest performance data. The scheduling server 202 obtains the streaming server 204 satisfying the preset constraint condition according to the stream load of each streaming server 204 and the preset constraint condition, and determines the target streaming server satisfying the data stream request according to the selection rule of the lowest stream load. The scheduling server 202 returns the identifier of the target streaming server to the service server 201, and the service server 201 distributes the service corresponding to the data stream request to the target streaming server. The target streaming server connects the source stream client 205 and the consumption client 206 corresponding to the service, and transmits the data stream of the source stream client 205 to the consumption client 206 through the streaming processing.

[0080] Based on Figure 2 the application scenario shown, the embodiment of the present application further provides a determination method of a streaming server. Figure 3 The flow of the determination method of the streaming server provided by the embodiment of the present application Figure 1 . As Figure 3 shown, the method comprises the following steps:

[0081] S301, obtaining the data stream access request sent by the service server.

[0082] In this step, the implementation manner of obtaining the data stream access request sent by the service server can be:

[0083] The data stream access request sent by the service server is obtained in the form of responding to an external request. For example, the responding request manner can be: the service server obtains the corresponding data stream access request by responding to the request sent by the device or apparatus corresponding to the target access address based on the target access address carried in the data stream access request.

[0084] S302, calculating the stream load of each streaming server according to the performance data of each streaming server.

[0085] Optionally, before calculating the stream load of each streaming server, the performance data periodically reported by each streaming server also needs to be obtained;

[0086] The performance data comprises: processor information, network bandwidth information, the number of information streams currently carried, the protocol type of each information stream, and the traffic bandwidth of each information stream.

[0087] The performance data used in this step is the performance data periodically reported by the streaming media server. The performance data is the latest performance data reported by the streaming media server when obtaining the data stream access request. How to realize the reporting of the performance data is further explained in the following embodiments shown in Figure 4 and Figure 5 and will not be described here.

[0088] Optionally, in a possible implementation, the specific implementation of calculating the stream load can be as follows:

[0089] a1. For each streaming media server, determine a preset protocol weight corresponding to each information stream based on the protocol type of each information stream.

[0090] In this step, the protocol type of the information stream includes GB28181, RTSP, RTMP, HLS, and WEBRTC. The preset protocol weight corresponding to each information stream is related to the encapsulation manner of each protocol type for the information stream, the underlying transmission mechanism corresponding to each protocol type, and the complexity of the transmission and interaction of each information stream between servers.

[0091] For example, the preset protocol weight for each protocol type obtained based on a large amount of data can be as follows: protocol type: GB28181, preset protocol weight: 1.5; protocol type: RTSP, preset protocol weight: 1.2; protocol type: RTMP, preset protocol weight: 1; protocol type: HLS, preset protocol weight: 0.8; and protocol type: WEBRTC, preset protocol weight: 2.

[0092] It should be noted that the protocol type of the information stream and the preset protocol weight in this application are only exemplary descriptions and are not limited.

[0093] a2. Determine a preset traffic weight corresponding to each information stream based on the traffic bandwidth of each information stream.

[0094] In this step, the traffic bandwidth of each information stream is the network bandwidth occupied when the information stream is processed in the streaming media server. The preset traffic weight is determined by evaluating the performance of the streaming media server, combining the performance of the streaming media server under high load, and comprehensively analyzing the stability of the streaming media server.

[0095] For example, the preset traffic weight corresponding to each information stream in this step can be set as follows:

[0096] Traffic bandwidth range: less than 2Mbps, preset traffic weight: 1; traffic bandwidth range: greater than or equal to 2Mbps and less than or equal to 4Mbps, preset traffic weight: 1.5; traffic bandwidth range: greater than 4Mbps, preset traffic weight: 2.

[0097] It should be noted that the preset traffic weights of the information flows in the present application are described only for illustration and not for limitation.

[0098] a3, based on the number of information flows, the preset traffic weight of each information flow and the preset protocol weight, calculating the stream load of the stream media server.

[0099] In this step, the network bandwidth information is the total available bandwidth of the stream media server. The stream load calculation of the stream media server is related to the current network information of the stream media server and the carried information flows. The specific calculation method is referred to the following formula:

[0100]

[0101] Wherein, L represents the stream load of the stream media server; w represents the preset protocol weight corresponding to each information flow; β represents the preset traffic weight corresponding to each information flow; P represents the number of information flows corresponding to each protocol type; n represents that there are n protocol types.

[0102] S303, determining the stream media server satisfying the preset constraint condition and having the lowest stream load as the target stream media server.

[0103] Optionally, in a possible implementation, the specific implementation method of determining the target stream media server comprises:

[0104] b1, for each stream media server, determining the number of processor cores of the stream media server based on the processor information.

[0105] In this step, the determination method of the number of processor cores can be: obtaining the number of cores of the processor in the stream media through the command line query method; or obtaining the number of cores of the processor by reading the device configuration information of the stream media server. If the stream media processor runs in a virtualization environment, the number of cores of the processor in the stream media server can be queried by connecting the virtualization management configuration platform.

[0106] b2, determining the total available bandwidth of the stream media server based on the network bandwidth information.

[0107] In this step, the network bandwidth information contains the network category used by the current stream media server and the total available bandwidth.

[0108] b3, determine preset constraint conditions corresponding to the streaming media server based on the number of processor cores, the total available bandwidth, the number of information flows, and the traffic bandwidth of each information flow.

[0109] In this step, the preset constraint condition is that the stream load needs to be less than the upper limit of the load supported by the streaming media server, and the comprehensive traffic bandwidth needs to be lower than the total available bandwidth of the streaming media server.

[0110] The specific calculation formula is as follows:

[0111]

[0112]

[0113] Wherein, L represents the stream load of the streaming media server; C represents the number of processor cores in the streaming media server; 200 represents the preset upper limit of the load of each processor core; b represents the traffic bandwidth of each information flow; P represents the number of information flows corresponding to each protocol type; n represents that there are n protocol types; and B represents the total available bandwidth of the streaming media server.

[0114] Formula (2) is used to limit the total bandwidth of the information flows to be lower than the total available bandwidth of the streaming media server. Formula (3) is used to limit the stream load of the streaming media server to be lower than the load upper limit of the streaming media server.

[0115] b4, determine the streaming media server satisfying the corresponding preset constraint condition as an intermediate streaming media server.

[0116] In another possible implementation manner, if there is no streaming media server satisfying the preset constraint condition, it indicates that there is no streaming media server that can be used in the current streaming media cluster, and the scheduling failure information can be sent to the service server.

[0117] b5, determine the intermediate streaming media server with the lowest stream load as a target streaming media server.

[0118] In this step, if the number of intermediate streaming media servers is one, the intermediate streaming media server is determined as the target streaming media server. If there are multiple intermediate streaming media servers, the intermediate streaming media servers are sorted based on the stream loads, and the intermediate streaming media server with the lowest stream load is determined as the target streaming media server.

[0119] S304, return the identifier of the target streaming media server to the service server.

[0120] In this step, the identifier of the target streaming media server at least includes any one of the following: the address of the target streaming media server, the access interface of the target streaming media server, the name or code of the target streaming media server.

[0121] The return to the service server can be sending a data packet to the service server and / or sending a data connection request to the service server through a wired link or a wireless link.

[0122] In the embodiment, the stream load of each stream media server is calculated according to the latest performance data reported by each stream media server after obtaining the data stream access request of the service server. The stream media servers are screened according to the preset constraint condition, and the stream media server with the lowest stream load is determined as the target stream media server in the stream media servers meeting the preset constraint condition. The identifier of the determined target stream media server is sent to the service server, so as to determine the stream media server. Thus, the use of each stream media server is related to the stream load of the stream media server itself, and the actual load of each stream media server is considered, so as to realize the load balancing of the stream media server and solve the problem of unbalanced load of the stream media server in the prior art.

[0123] Figure 4 A system architecture diagram applied to the performance data reporting of the stream media server is provided for the embodiment of the application, which is used for further describing the performance data reporting in step S302. As shown in the figure, in a possible implementation manner, the architecture includes a scheduling server 401 and a plurality of stream media servers 402. Figure 4

[0124] The implementation manner includes that the stream media server periodically reports the performance data to the scheduling server through a heartbeat mechanism; the performance data reporting is in the form of sending a data transmission request to the scheduling server based on the HTTP protocol and sending the performance data to the scheduling server. The heartbeat mechanism refers to a method for ensuring whether the communication between various components of a system exists and performing state monitoring on the communication between the various components. In the step, the heartbeat mechanism is used for ensuring whether the communication between the scheduling server and the stream media server exists, and maintaining the heartbeat of the stream media server in the scheduling server through periodic data reporting.

[0125] Based on the architecture diagram shown in the figure, the embodiment of the application further provides a stream media server performance data reporting method. Figure 4 A flowchart of a stream media server performance data reporting method is provided for the embodiment of the application. As shown in the figure, the method includes the following steps. Figure 5 Figure 5

[0126] c1. Periodically trigger a heartbeat reporting task based on a heartbeat reporting program of the stream media server.

[0127] ​​​In this step, the period of triggering the heartbeat reporting task is set according to the actual streaming media server application scenario. For example, the period of the heartbeat reporting task is set to 10 seconds, and the streaming media server will trigger the reporting task based on the heartbeat reporting program every ten seconds.

[0128] c2, the heartbeat reporting program based on the streaming media server collects data.

[0129] In this step, the data collected by the heartbeat reporting program includes server information and information flow information carried by the server. The server information includes processor information, network bandwidth information, load information and memory information; the information flow information includes the identification of each information flow, the protocol type of each information flow and the traffic bandwidth of each information flow.

[0130] For example, the information flow information collected by the heartbeat reporting program can be:

[0131] GB28181 flow information: the current server carries the GB28181 flow identification, and the corresponding traffic bandwidth;

[0132] RTSP flow information: the current server carries the RTSP identification, and the corresponding traffic bandwidth;

[0133] RTMP flow information: the current server carries the RTSP identification, and the corresponding traffic bandwidth;

[0134] HLS flow information: the current server carries the RTSP identification, and the corresponding traffic bandwidth;

[0135] WEBRTC flow information: the current server carries the RTSP identification, and the corresponding traffic bandwidth.

[0136] c3, based on the heartbeat reporting program, the collected data is summarized and determined as performance data.

[0137] In this step, the collected data is summarized, and the number of information flows in the streaming media server is obtained by counting the information flows of each protocol type. The summary can also include: normalizing the format of the collected data, completing the collected data and removing the duplicate data.

[0138] c4, the performance data is reported to the scheduling server in the form of HTTP.

[0139] In this step, the performance data is added to the body of the HTTP request, and the performance data is reported by accessing the scheduling server.

[0140] Optionally, in one possible implementation, the performance data reporting cycle will start the next cycle according to the reporting period, and the current performance data will be obtained again when the reporting period is reached and the performance data will be reported.

[0141] c5. After receiving the performance data, the scheduling server corrects and stores the performance data.

[0142] In this step, the correction of performance data includes, but is not limited to: data format normalization, data cleaning, data deduplication, and filling in missing data values.

[0143] In this embodiment, a heartbeat mechanism is used to maintain the communication connection between the streaming media server and the scheduling server, and periodic performance data reporting is implemented based on the heartbeat mechanism. This achieves efficient and fast performance data uploading, while ensuring the stability of communication between the scheduling server and the streaming media server during data uploading.

[0144] Based on the above embodiments, Figure 6 Further implementation examples of determining the streaming media server are described below. Figure 6 The process of determining a streaming media server provided in this application Figure 2 .like Figure 6 As shown, the method includes:

[0145] d1. The business server adds a new data stream access request.

[0146] d2. The scheduling server receives data stream access requests from the business server.

[0147] d3. The scheduling server calculates the current streaming load for each streaming media server.

[0148] d4. The dispatch center will return the identifier of the target streaming media server that meets the preset constraints and has the minimum streaming load to the business server.

[0149] d5. The target streaming media server receives the data stream and processes the corresponding business logic.

[0150] In this step, the streaming media server's processing of the data stream includes at least one of the following: deconstruction of the transmission protocol corresponding to the data stream, data stream recording, and data stream playback processing. For specific processing methods of the data stream corresponding to the service, please refer to the following... Figure 8 The example shown.

[0151] Figure 7 A schematic diagram of the structure of the device for determining the streaming media server provided in this application is shown below. Figure 7 As shown, the device for determining the streaming media server provided in this embodiment includes:

[0152] The acquisition module 701 is used to acquire data stream access requests sent by the business server;

[0153] The first processing module 702 is configured to calculate a stream load of each stream media server according to performance data of each stream media server.

[0154] The determining module 703 is configured to determine a stream media server satisfying a preset constraint condition and having the lowest stream load as a target stream media server.

[0155] The second processing module 704 is configured to return an identifier of the target stream media server to a service server.

[0156] In a possible implementation, the first processing module 702 is further configured to:

[0157] obtain performance data periodically reported by each stream media server;

[0158] The performance data includes processor information, network bandwidth information, a number of information streams currently carried, a protocol type of each information stream, and a traffic bandwidth of each information stream.

[0159] In a possible implementation, the first processing module 702 is further configured to:

[0160] For each stream media server, determine a preset protocol weight corresponding to each information stream based on the protocol type of each information stream;

[0161] determine a preset traffic weight corresponding to each information stream based on the traffic bandwidth of each information stream;

[0162] calculate the stream load of the stream media server based on the number of information streams, the preset traffic weight and the preset protocol weight of each information stream.

[0163] In a possible implementation, the determining module 703 is further configured to:

[0164] For each stream media server, determine a number of processor cores of the stream media server based on the processor information, and determine an available total bandwidth of the stream media server based on the network bandwidth information;

[0165] determine a preset constraint condition corresponding to the stream media server based on the number of processor cores, the available total bandwidth, the number of information streams, and the traffic bandwidth of each information stream;

[0166] determine a stream media server satisfying the corresponding preset constraint condition as an intermediate stream media server;

[0167] determine an intermediate stream media server having the lowest stream load as the target stream media server.

[0168] The determination apparatus of the stream media server provided in the embodiment can execute the method provided in the method embodiment, and has similar implementation principles and technical effects. Details are not described herein again.

[0169] Figure 8 A flowchart of a data stream processing method based on a stream media server is provided in the embodiment. Based on the above-described embodiment, how to implement data stream processing based on a stream media server in step d5 is further explained. As shown in Figure 6 The method comprises the following steps: e1, the source stream client sends the to-be-processed data stream to the stream media server based on a preset transmission protocol; e2, the stream media server receives the to-be-processed data stream, performs protocol analysis on the to-be-processed data stream based on the transmission protocol of the to-be-processed data stream, simultaneously performs transcoding processing or transencapsulation processing on the to-be-processed data stream, and converts the to-be-processed data into a target data stream of a target transmission protocol; and e3, the stream media server pushes the target data stream to the consumption client based on the target transmission protocol. Figure 8

[0170] Based on the above-described embodiment, the application provides a cloud computing platform. The cloud computing platform is used to implement the stream media server determination method in any of the above-described embodiments. The cloud computing platform comprises a business server, a scheduling server, and a plurality of stream media servers.

[0171] The scheduling server is used to execute the method described in any of the above-described embodiments. Figures 3 to 6

[0172] The business server is used to send the to-be-processed data stream to the target stream media server corresponding to the target scheduling server based on the identifier of the target scheduling server returned by the scheduling server.

[0173] The target stream media server is used to perform at least one of the following processing on the to-be-processed data stream: playing processing, recording processing, and analyzing processing.

[0174] Optionally, each stream media server supports a plurality of stream media transmission protocols, and the stream media transmission protocols supported by different stream media servers are the same.

[0175] In a possible implementation manner, a specific implementation manner in which the stream media server supports a plurality of transmission protocols is that: a transmission protocol conversion module corresponding to each transmission protocol is set, and data streams of the plurality of transmission protocols are converted into data streams in a preset standard format, and the data streams are played, recorded, and analyzed based on the data streams in the preset standard format.

[0176] Figure 9 ​​A structural schematic diagram of a data stream processing apparatus based on a streaming media server is provided for an embodiment of the present application. As shown in the example Figure 9 The apparatus includes a GB28181 protocol module 901, an RTSP protocol module 902, an RTMP protocol module 903, an HLS protocol module 904, a WEBRTC protocol module 905, a preset standard format data stream processing module 906, a data stream playing module 907, a data stream recording module 908, and a data stream analysis module 909.

[0177] The GB28181 protocol module 901 is configured to transcode and encapsulate a data stream with a transmission protocol of GB28181 and determine the data stream as a preset standard format data stream.

[0178] The RTSP protocol module 902 is configured to transcode and encapsulate a data stream with a transmission protocol of RTSP and determine the data stream as a preset standard format data stream.

[0179] The RTMP protocol module 903 is configured to transcode and encapsulate a data stream with a transmission protocol of RTMP and determine the data stream as a preset standard format data stream.

[0180] The HLS protocol module 904 is configured to transcode and encapsulate a data stream with a transmission protocol of HLS and determine the data stream as a preset standard format data stream.

[0181] The WEBRTC protocol module 905 is configured to transcode and encapsulate a data stream with a transmission protocol of WEBRTC and determine the data stream as a preset standard format data stream.

[0182] The preset standard format data stream processing module 906 is configured to determine a subsequent processing mode of the data stream.

[0183] The data stream playing module 907 is configured to perform playing processing on the data stream.

[0184] The data stream recording module 908 is configured to perform recording processing on the data stream.

[0185] The data stream analysis module 909 is configured to perform analysis processing on the data stream.

[0186] Figure 10 A hardware structural diagram of a dispatch server is provided for the present application. As shown in the example Figure 10 The dispatch server provided in the present embodiment includes at least one processor 1001 and a memory 1002. Optionally, the dispatch server further includes a communication component 1003. The processor 1001, the memory 1002, and the communication component 1003 are connected through a bus 1004.

[0187] In the implementation process, the at least one processor 1001 executes the computer execution instructions stored in the memory 1002, so that the at least one processor 1001 executes the above-mentioned method.

[0188] The specific implementation process of the processor 1001 can be referred to the above-mentioned method embodiment of the processor 1001, and the implementation principle and technical effects are similar, and details are not described here. Figures 3-6 The specific implementation process of the processor 1001 can be referred to the above-mentioned method embodiment of the processor 1001, and the implementation principle and technical effects are similar, and details are not described here.

[0189] In the above-mentioned embodiments, it should be understood that the processor can be a central processing unit (English: Central Processing Unit, for short: CPU), and can also be other general-purpose processors, digital signal processors (English: Digital Signal Processor, for short: DSP), application specific integrated circuits (English: Application Specific Integrated Circuit, for short: ASIC) and the like. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution completion, or executed by hardware and software modules in the processor.

[0190] The memory can contain a random access memory (Random Access Memory, RAM), and can also include a non-volatile memory (Non-volatile Memory, NVM), for example, at least one disk memory.

[0191] The bus can be an industry standard architecture (Industry Standard Architecture, ISA) bus, a peripheral component interconnect (Peripheral Component, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, the bus in the drawings of the present application does not limit only one bus or one type of bus.

[0192] The present application also provides a computer program product, comprising a computer program, which is executed by the processor to realize the above-mentioned method.

[0193] The present application also provides a computer readable storage medium, which stores computer execution instructions, and when the processor executes the computer execution instructions, the above-mentioned method is realized.

[0194] The above-mentioned readable storage medium can be realized by any type of volatile or nonvolatile storage devices or their combinations, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0195] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.

[0196] The division of units is only a logical functional division, and in actual implementation, there can be another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0197] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.

[0198] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.

[0199] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0200] It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The aforementioned program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, and various media that can store program codes.

[0201] Finally, it should be noted that: those skilled in the art will easily think of other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application that follow the general principles of the present application and include common knowledge or conventional technical means in the art that are not disclosed in the present application, and is not limited to the precise structure described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is only limited by the appended claims.

Claims

1. A method for determining a streaming media server, characterized in that, include: Obtain the data stream access request sent by the business server; Calculate the streaming load of each streaming server based on its performance data; The streaming media server that meets the preset constraints and has the lowest streaming load is identified as the target streaming media server. The identifier of the target streaming media server is returned to the service server; Before calculating the streaming load of each streaming server based on its performance data, the following steps are included: Obtain the performance data periodically reported by each streaming media server; The performance data includes: processor information, network bandwidth information, number of currently carried information streams, protocol type of each information stream, and bandwidth of each information stream; The step of calculating the streaming load of each streaming media server based on its performance data includes: For each streaming media server, a preset protocol weight is determined based on the protocol type of each information stream; Based on the bandwidth of each information flow, determine the preset traffic weight corresponding to each information flow; Based on the number of information streams, the preset traffic weight of each information stream, and the preset protocol weight, the streaming load of the streaming media server is calculated using the following formula: Where L represents the streaming load of the streaming media server; w represents the preset protocol weight for each information stream; β represents the preset traffic weight for each information stream; P represents the number of information streams corresponding to each protocol type; and n represents the existence of n protocol types. The step of determining the streaming media server that meets the preset constraints and has the lowest streaming load as the target streaming media server includes: For each streaming media server, the number of processor cores of the streaming media server is determined based on the processor information; The total available bandwidth of the streaming media server is determined based on the network bandwidth information; Based on the number of processor cores, the total available bandwidth, the number of information streams, and the bandwidth of each information stream, preset constraints are determined for the streaming media server. These preset constraints require that the stream load be less than the upper limit of the streaming media server's supported load, and that the combined bandwidth be lower than the total available bandwidth of the streaming media server. The calculation formula is as follows: Where L represents the streaming load of the streaming media server; C represents the number of processor cores in the streaming media server; 200 represents the preset load limit per processor core; b represents the bandwidth of each information stream; P represents the number of information streams corresponding to each protocol type; n represents the existence of n protocol types; and B represents the total available bandwidth of the streaming media server. Streaming media servers that meet the corresponding preset constraints are identified as intermediate streaming media servers; The intermediate streaming media server with the lowest streaming load is identified as the target streaming media server.

2. A device for determining a streaming media server, characterized in that, include: The acquisition module is used to acquire data stream access requests sent by the business server; The first processing module is used to calculate the streaming load of each streaming media server based on the performance data of each streaming media server. The determination module is used to determine the streaming media server that meets the preset constraints and has the lowest streaming load as the target streaming media server; The second processing module is used to return the identifier of the target streaming media server to the service server; The first processing module is further configured to: Obtain the performance data periodically reported by each streaming media server; The performance data includes: processor information, network bandwidth information, number of currently carried information streams, protocol type of each information stream, and bandwidth of each information stream; The first processing module is further configured to: For each streaming media server, a preset protocol weight is determined based on the protocol type of each information stream; Based on the bandwidth of each information flow, determine the preset traffic weight corresponding to each information flow; Based on the number of information streams, the preset traffic weight of each information stream, and the preset protocol weight, the streaming load of the streaming media server is calculated using the following formula: Where L represents the streaming load of the streaming media server; w represents the preset protocol weight for each information stream; β represents the preset traffic weight for each information stream; P represents the number of information streams corresponding to each protocol type; and n represents the existence of n protocol types. The determining module is further configured to: For each streaming media server, the number of processor cores of the streaming media server is determined based on the processor information; The total available bandwidth of the streaming media server is determined based on the network bandwidth information; Based on the number of processor cores, the total available bandwidth, the number of information streams, and the bandwidth of each information stream, preset constraints are determined for the streaming media server. These preset constraints require that the stream load be less than the upper limit of the streaming media server's supported load, and that the combined bandwidth be lower than the total available bandwidth of the streaming media server. The calculation formula is as follows: Where L represents the streaming load of the streaming media server; C represents the number of processor cores in the streaming media server; 200 represents the preset load limit per processor core; b represents the bandwidth of each information stream; P represents the number of information streams corresponding to each protocol type; n represents the existence of n protocol types; and B represents the total available bandwidth of the streaming media server. Streaming media servers that meet the corresponding preset constraints are identified as intermediate streaming media servers; The intermediate streaming media server with the lowest streaming load is identified as the target streaming media server.

3. A scheduling server, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in claim 1.

4. A cloud computing platform, characterized in that, This includes business servers, scheduling servers, and multiple streaming media servers; The scheduling server is used to execute the method as described in claim 1; The service server is used to send the data stream to be processed to the target streaming media server corresponding to the identifier of the target scheduling server, based on the identifier of the target scheduling server returned by the scheduling server. The target streaming media server is used to perform at least one of the following processes on the data stream to be processed: playback processing, recording processing, and analysis processing.

5. The cloud computing platform according to claim 4, characterized in that, Each streaming media server supports multiple streaming media transmission protocols, and different streaming media servers support the same streaming media transmission protocols.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in claim 1.

7. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of claim 1.

Citation Information

Patent Citations

  • Audio and video stream load balancing method and device

    CN111193788A

  • Load balancing method and apparatus, device, computer storage medium and program

    WO2023050901A1