Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
Currently, in the live broadcast field, the operator of the live broadcast platform often uses a CDN network to provide live broadcast service, so as to improve the quality of live broadcast service. When recording a live video, the anchor terminal may push the live video stream to a CDN edge node (which may be referred to as a stream pushing edge node) closest to the anchor terminal. After receiving the live video stream, the stream pushing edge node pushes the live video stream to a dynamic father node; when the user player accesses the edge node of the closest point, the edge node returns to the static father node to pull the stream, the static father node returns to the dynamic father node to pull the stream, and then the edge node can push the live video stream to the user player. Wherein, the static father node can reduce the concurrent pressure and the bandwidth pressure of the dynamic father node.
In the live streaming process, more than 80% of video streams are cold streams (i.e., video streams with the number of visitors being less than 5), and the cold streams have a high probability that only one edge node returns to a static father node to pull streams and the static father node returns to a dynamic father node to pull streams, which may result in serious bandwidth and resource waste. The method for sending the message to the edge node by the static parent node generally includes the following two methods: firstly, establishing another message center for message transfer; second, a channel is established between the static parent node and the edge node for transmitting messages.
However, the inventors found that at least the following problems exist in the prior art: when the message center is established for message transfer, the message center is excessively depended on, the stability is poor, and the CDN network needs to be changed to a greater extent; if a channel is established between the static father node and the edge node for transmitting the message, one more channel needs to be maintained, communication complexity during multi-stream is increased, and the CDN network needs to be changed to a greater extent. Based on this, the inventor proposes the technical scheme of the application.
A first embodiment of the present invention relates to a flow guiding method, which is applied to a static father node of a CDN network, and referring to fig. 1, the CDN network includes a plug flow edge node 1, a dynamic father node 2, a static father node 3, and an edge node 4; the live broadcast terminal 5 pushes the recorded media stream to the edge node closest to the live broadcast terminal (i.e. the stream pushing edge node 1 in fig. 1) through the stream pusher, and the user terminal 6 can access the closest edge node 4 through the player. It should be noted that the number of each type of node is only schematically described in the figure, and this embodiment does not limit this.
A specific flow of the diversion method of the present embodiment is shown in fig. 2.
Step 101, responding to a pull stream request sent by an edge node, obtaining a media stream corresponding to the pull stream request from a dynamic father node, and sending the media stream to the edge node.
Specifically, when a user watches live broadcasting, the user may use an electronic device such as a mobile phone or a tablet computer as a user side to send a pull request to a nearest edge node, when the edge node receives the pull request sent by the user side, the edge node establishes a connection with a corresponding static parent node and forwards the pull request to the static parent node, the static parent node establishes a connection with a dynamic parent node and forwards the pull request to the dynamic parent node, and then the static parent node can pull a media stream corresponding to the pull request from the dynamic parent node and send the media stream to the edge node through a transmission channel between the static parent node and the edge node, and the edge node can push the media stream to the user side so that the user can watch live broadcasting. The media stream may be a video stream and/or an audio stream.
Step 102, determining whether the number of edge nodes requesting for the media stream within the first preset time reaches a preset number threshold. If not, go to step 103; if yes, the process is finished directly.
Specifically, after establishing connection with an edge node, a static father node determines whether the number of edge nodes requesting a media stream in a first preset time reaches a preset number threshold, that is, determines whether the media stream is cold stream, and when the number of edge nodes initiating a stream pulling request for the media stream in the first preset time does not reach the set number threshold, determines that the media stream is cold stream, and then step 103 is performed; for example, the first preset time is 5 minutes, the number threshold is 2, after the static parent node establishes a connection with the first edge node for the media stream a, if there is no second edge node requesting to pull the media stream a within 5 minutes, it indicates that the media stream a is cold stream, the number of users watching the live stream is small, and the streaming service of the media stream can be completed through the first edge node. On the contrary, it is indicated that the number of edge nodes initiating a stream pulling request for the media stream within the first preset time reaches a set number threshold, the media stream is not cold stream, the number of users watching the live broadcast is large, and at this time, a diversion service is still provided for each edge node through the static father node.
And 103, generating a scheduling control command, and sending the scheduling control command to the edge node through a transmission channel of the media stream, so that the edge node can acquire the media stream from the dynamic father node according to the scheduling control command.
Specifically, after determining that the media stream is cold, the static father node generates a scheduling control command including address information of the dynamic father node, and sends the scheduling control command to the edge node through a transmission channel established between the static father node and the edge node for transmitting the media stream; if the number of the edge nodes initiating the stream pulling request for the media stream is multiple, the scheduling control command may be sent by multiplexing the transmission channels of the media stream corresponding to each edge node. After receiving a scheduling control command sent by a static father node, an edge node judges that stream pulling can be directly carried out from the dynamic father node, and initiates a stream pulling request to the dynamic father node according to the address information of the dynamic father node in the scheduling control command, so that a media stream corresponding to the stream pulling request can be directly obtained from the dynamic father node; then, the edge node disconnects from the static father node, and stops acquiring the media stream from the static father node.
Compared with the prior art, the method has the advantages that the static father node responds to the pull stream request sent by the edge node, obtains the media stream corresponding to the pull stream request from the dynamic father node, and sends the media stream to the edge node; when the static father node judges that the number of the edge nodes requesting the media stream in the first preset time does not reach a preset number threshold, a scheduling control command is generated and sent to the edge nodes through a transmission channel of the media stream, and the scheduling control command at least comprises address information of the dynamic father node, so that the edge nodes can acquire the media stream from the dynamic father node according to the scheduling control command; in this embodiment, the static father node multiplexes a transmission channel of the media stream between the static father node and the edge node to send the scheduling control command, and the edge node can be notified to directly return to the dynamic father node for stream pulling without changing the structure of the CDN network, thereby reducing the waste of bandwidth and resources.
A second embodiment of the present invention relates to a diversion method, and the main differences of the present embodiment from the first embodiment are: a specific implementation of sending scheduling control commands to edge nodes over a transmission channel of a media stream is provided.
The specific flow of the diversion method of this embodiment is shown in fig. 3.
The steps 201 and 202 are substantially the same as the steps 101 and 102, respectively, and are not repeated herein, the main difference is that the step 203 includes the following substeps:
sub-step 2031, packing the scheduling control command into a preset media format according to a preset streaming media protocol.
Specifically, the streaming media protocol is an internal back-to-source protocol defined with an extension protocol, such as an RTMP streaming media protocol or an HTTP-FLV protocol, so that the scheduling control command can be packaged into an FLV format, that is, the preset media format is the FLV format.
Sub-step 2032, setting the data block type of the scheduling control command of the preset media format to a preset type.
Specifically, taking the preset media format as the FLV format as an example, the data block type of the FLV format scheduling control command is defined by TagType in FLVtag, in this embodiment, the TagType may be defined by an extension command 0x15, and the extended FLV tag is as follows:
| 2b(Reserved)
|
1b(Filter)
|
5b(TagType)
|
24b(size)
|
24b(ts)
|
8b(ets)
|
24b(id)
|
data |
wherein b represents the bit number occupied by the field; reserved is fixed to 0; fliter indicates whether the FLV tag data needs some extra preprocessing work during actual processing, such as decryption, 1 indicates that the data is needed, and 0 indicates that the data is not needed; TagType is defined as extended command 0x 15; size indicates the data length of the following data, ts, ets, id are all fixed to 0.
The data at least comprises address information of a dynamic father node, and can also comprise address information of a static father node, and the data structure of the data is as follows:
| 64b(cur_ip)
|
64b(remote_ip) |
wherein, cur-ip represents address information of a static father node; remote _ ip represents address information of a dynamic parent node.
Sub-step 2033, sending the scheduling control command with the data block type being the preset type to the edge node requesting the media stream through the transmission channel of the media stream.
In this embodiment, when the static father node and the edge node transmit the media stream and the scheduling control command, a preset media format may be used, which is equivalent to defining a data block type of media format data, and the scheduling control command is transmitted by using the media format.
This embodiment defines a data block type of media format data, relative to the first embodiment, so that the media format can be used to transmit scheduling control commands and multimedia data simultaneously.
A third embodiment of the present invention relates to a diversion method, and the main differences of the present embodiment from the first embodiment are: a buffering time is set for disconnecting the static parent node from the dynamic parent node.
A specific flow of the diversion method of the present embodiment is shown in fig. 4.
Steps 301 to 303 are substantially the same as steps 101 to 103, and are not described herein again, but the main difference is that step 304 is added, which is as follows:
step 304, if there is no edge node requesting media stream within the second preset time, stopping acquiring the media stream from the dynamic father node.
Specifically, after the static father node sends the scheduling control command in the preset media format to the edge nodes through the transmission channel of the media stream, timing is started, and if the timing reaches a second preset time and no flow pulling request is received by any edge node for the media stream, the connection with the dynamic father node is disconnected, and the dynamic father node stops obtaining the media stream.
Compared with the first embodiment, the second preset time is set as the buffer time for disconnecting the connection between the static father node and the dynamic father node, and it is ensured to a certain extent that no edge node initiates a stream pulling request for the media stream when the connection between the static father node and the dynamic father node is disconnected.
A fourth embodiment of the present invention relates to a flow guiding method, which is applied to an edge node of a CDN network, and referring to fig. 1, the CDN network includes a push flow edge node 1, a dynamic father node 2, a static father node 3, and an edge node 4; the live broadcast terminal 5 pushes the recorded media stream to the edge node closest to the live broadcast terminal (i.e. the stream pushing edge node 1 in fig. 1) through the stream pusher, and the user terminal 6 can access the closest edge node 4 through the player. It should be noted that the number of each type of node is only schematically described in the figure, and this embodiment does not limit this.
The specific flow of the diversion method in this embodiment is shown in fig. 5.
Step 401, in response to the received pull stream request, obtaining a media stream corresponding to the pull stream request from the dynamic parent node through the static parent node.
Specifically, when a user watches live broadcasting, the user may use an electronic device such as a mobile phone or a tablet computer as a user side to send a pull request to a nearest edge node, when the edge node receives the pull request sent by the user side, the edge node establishes a connection with a corresponding static parent node and forwards the pull request to the static parent node, the static parent node establishes a connection with a dynamic parent node and forwards the pull request to the dynamic parent node, and then the static parent node can pull a media stream corresponding to the pull request from the dynamic parent node and send the media stream to the edge node through a transmission channel between the static parent node and the edge node, and the edge node can push the media stream to the user side so that the user can watch live broadcasting. The media stream may be a video stream and/or an audio stream.
Step 402, determining whether a scheduling control command sent by a static parent node through a transmission channel of a media stream is received. If yes, go to step 403; if not, the process is ended directly.
Step 403, acquiring the media stream from the dynamic father node according to the scheduling control command, where the scheduling control command at least includes address information of the dynamic father node.
Specifically, when the static father node determines that the number of the edge nodes requesting the media stream in the first preset time does not reach a preset number threshold, a scheduling control command including address information of the dynamic father node is generated, and the scheduling control command is sent to the edge nodes through a transmission channel for transmitting the media stream, which is established between the static father node and the edge nodes. And for the edge node receiving the scheduling control command, judging that the stream pulling can be directly carried out from the dynamic father node, and initiating a stream pulling request to the dynamic father node according to the address information of the dynamic father node in the scheduling control command, so that the media stream corresponding to the stream pulling request can be directly obtained from the dynamic father node. The edge node can cut off the connection between the edge node and the static father node after pulling the media stream from the dynamic father node, thereby completing the dynamic switching of the link under the condition that the user side does not sense.
Since the first embodiment corresponds to the present embodiment, the present embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and the technical effects that can be achieved in the first embodiment can also be achieved in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
Compared with the prior art, the method has the advantages that the static father node responds to the pull stream request sent by the edge node, obtains the media stream corresponding to the pull stream request from the dynamic father node, and sends the media stream to the edge node; when the static father node judges that the number of the edge nodes requesting the media stream in the first preset time does not reach a preset number threshold, a scheduling control command is generated and sent to the edge nodes through a transmission channel of the media stream, and the scheduling control command at least comprises address information of the dynamic father node, so that the edge nodes can acquire the media stream from the dynamic father node according to the scheduling control command; in this embodiment, the static father node multiplexes a transmission channel of the media stream between the static father node and the edge node to send the scheduling control command, and the edge node can be notified to directly return to the dynamic father node for stream pulling without changing the structure of the CDN network, thereby reducing the waste of bandwidth and resources.
A fifth embodiment of the present invention relates to a diversion method, and the main differences of the present embodiment from the fourth embodiment are: a method for determining whether a scheduling control command transmitted by a static parent node through a transmission channel of a media stream is received is provided.
The specific flow of the diversion method in this embodiment is shown in fig. 6.
Step 501 and step 504 are substantially the same as step 401 and step 403, and are not described herein again, the main difference is that step 502 is added, and the method includes the following substeps:
substep 5021, when receiving the data in the preset media format, determines whether the data block type of the data is the preset type.
Substep 5022, the data is taken as a scheduling control command.
Specifically, a preset type is appointed between the static father node and the edge node as a data block type for transmitting the scheduling control command, the edge node acquires the data block type of the data when receiving the data in the preset media format, if the data block type of the data is the preset type, the data is the scheduling control command, then step 503 is performed to acquire a media stream from the dynamic father node according to the scheduling control command, and the scheduling control command at least includes address information of the dynamic father node. Otherwise, it indicates that the data block type of the data is audio, video, etc., and the data is a media stream, which can push the multimedia stream to the user end.
In one example, the edge node may determine that the data block type of the data is the preset type by determining whether a tag type value of the data block type of the data is a preset value; and if the label type value of the data block type of the data is a preset value, judging that the data block type of the data is a preset type.
Taking the preset media format as the FLV format as an example, the data block type of the FLV format scheduling control command is defined by the TagType in the FLVtag, and the TagType data block types in the existing definitions include three types: audio type-value 8; video type-value 9; scriptdata-value 18; in this embodiment, the value of TagType is determined as a preset value (for example, 0x15) to indicate a preset type, and the developed FLV tag is as follows:
| 2b(Reserved)
|
1b(Filter)
|
5b(TagType)
|
24b(size)
|
24b(ts)
|
8b(ets)
|
24b(id)
|
data |
wherein b represents the bit number occupied by the field; reserved is fixed to 0; fliter indicates whether the FLV tag data needs some extra preprocessing work during actual processing, such as decryption, 1 indicates that the data is needed, and 0 indicates that the data is not needed; TagType is defined as extended command 0x 15; size indicates the data length of the following data, and ts, ets, id are all fixed to 0.
The data at least comprises address information of a dynamic father node, and can also comprise address information of a static father node, and the data structure of the data is as follows:
| 64b(cur_ip)
|
64b(remote_ip) |
wherein, cur-ip represents address information of a static father node; remote _ ip represents address information of a dynamic parent node.
Compared with the fourth embodiment, in the present embodiment, a preset type is agreed between the static parent node and the edge node as a data block type for transmitting the scheduling control command, so as to determine whether the scheduling control command transmitted by the static parent node through the transmission channel of the media stream is received.
A sixth embodiment of the present invention relates to a diversion method, and the present embodiment is mainly different from the fourth embodiment in that: the scheduling control command also comprises; command flag bits and check values.
In this embodiment, taking the extended FLV tag in the fourth embodiment as an example, the data further includes a command flag and a check value; when the command flag bit is a preset value, the static father node indicates that the edge node is required to directly pull the stream to the dynamic father node, and the preset value can be 0 or 1; the check value may be the sum of the command flag bit, the address information of the static parent node, and the address information of the dynamic parent node, and has the following specific structure:
| 8b(cmd)
|
64b(cur_ip)
|
64b(remote_ip)
|
8b(sum) |
wherein cmd represents a command flag; cur-ip represents address information of a static father node; remote _ ip represents address information of a dynamic parent node; sum denotes a check value.
Fig. 7 shows a specific flow of the diversion method according to the present embodiment.
Step 601 and step 602 are substantially the same as step 401 and step 402, and are not described herein again, the main difference is that step 603 includes the following sub-steps:
and a substep 6031 of determining whether the command flag is a preset value. If yes, go to substep 6032; if not, ending the operation.
Specifically, when the static parent node determines that the number of edge nodes requesting the media stream in the first preset time does not reach the preset number threshold, the command flag is set to the preset value, which indicates that the static parent node requests the edge nodes to directly pull the stream to the dynamic parent node, and when the command flag is determined to be the preset value, the edge node proceeds to substep 6032. Otherwise, the media stream is continuously acquired from the dynamic father node through the static father node.
And a substep 6032 of calculating a target verification value of the scheduling control command in a preset manner.
Specifically, when the static father node generates the scheduling control command, the accumulated sum of the command flag bit, the address information of the static father node and the address information of the dynamic father node is calculated to be used as a target check value of the scheduling control command, the check value is put into the scheduling control command and is sent to the edge node, and after the edge node receives the scheduling control command, the accumulated sum of the command flag bit, the address information of the static father node and the address information of the dynamic father node in the scheduling control command is calculated in the same way as the static father node and is recorded as the target check value.
In sub-step 6033, if the target check value matches the check value, the media stream is obtained from the dynamic parent node according to the address information.
Specifically, the edge node compares the target check value with the check value in the scheduling control command to judge whether the scheduling control command is legal or not, when the target check value and the check value are equal, the target check value and the check value are matched, the edge node judges that the scheduling control command is legal, the edge node can directly pull the stream from the dynamic father node, and then, according to the address information of the dynamic father node in the scheduling control command, the edge node initiates a stream pulling request to the dynamic father node, so that the media stream corresponding to the stream pulling request can be directly obtained from the dynamic father node; otherwise, the media stream is continuously acquired from the dynamic father node through the static father node.
Compared with the fourth embodiment, the present embodiment provides a specific implementation manner of acquiring a media stream from a dynamic parent node according to a scheduling control command. The present embodiment may be modified from the fifth embodiment.
A seventh embodiment of the present invention relates to a static father node, which is applied to a CDN network, and please refer to fig. 1, which is a structural diagram of the CDN network.
In this embodiment, a static parent node has at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the flow directing method of any one of the first to third embodiments.
An eighth embodiment of the present invention relates to an edge node, which is applied to a CDN network, and please refer to fig. 1, which is a structural diagram of the CDN network.
In this embodiment, the edge node has at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the flow directing method as in any one of the fourth to sixth embodiments.
A ninth embodiment of the present invention relates to a CDN network, wherein the CDN network includes at least one dynamic father node, at least one static father node, and at least one edge node, and referring to fig. 1, the CDN network includes a push flow edge node 1, a dynamic father node 2, a static father node 3, and an edge node 4; the live broadcast terminal 5 pushes the recorded media stream to the edge node closest to the live broadcast terminal (i.e. the stream pushing edge node 1 in fig. 1) through the stream pusher, and the user terminal 6 can access the closest edge node 4 through the player. It should be noted that the number of each type of node is only schematically described in the figure, and this embodiment does not limit this.
The static father node 3 is configured to, in response to the pull request sent by the edge node 4, obtain a media stream corresponding to the pull request from the dynamic father node 2, and send the media stream to the edge node 4.
The static father node 3 is also used for generating a scheduling control command when judging that the number of the edge nodes 4 requesting the media stream in the first preset time does not reach a preset number threshold value, and sending the scheduling control command to the edge nodes 4 through a transmission channel of the media stream; the scheduling command includes at least address information of the dynamic parent node 2.
The edge node 4 is configured to determine whether a scheduling control command sent by the static parent node 3 through the transmission channel of the media stream is received, and obtain the media stream from the dynamic parent node 2 according to the scheduling control command when determining that the scheduling control command sent by the static parent node 3 through the transmission channel of the media stream is received.
Since the first embodiment, the third embodiment and the present embodiment correspond to each other, the present embodiment can be implemented in cooperation with the first embodiment and the third embodiment. The related technical details mentioned in the first and third embodiments are still valid in this embodiment, and the technical effects achieved in the first and third embodiments can also be achieved in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment and the third embodiment.
Compared with the prior art, the method has the advantages that the static father node responds to the pull stream request sent by the edge node, obtains the media stream corresponding to the pull stream request from the dynamic father node, and sends the media stream to the edge node; when the static father node judges that the number of the edge nodes requesting the media stream in the first preset time does not reach a preset number threshold, a scheduling control command is generated and sent to the edge nodes through a transmission channel of the media stream, and the scheduling control command at least comprises address information of the dynamic father node, so that the edge nodes can acquire the media stream from the dynamic father node according to the scheduling control command; in this embodiment, the static father node multiplexes a transmission channel of the media stream between the static father node and the edge node to send the scheduling control command, and the edge node can be notified to directly return to the dynamic father node for stream pulling without changing the structure of the CDN network, thereby reducing the waste of bandwidth and resources.
A tenth embodiment of the present invention relates to a CDN network, and is different from the ninth embodiment mainly in that: a preset type is agreed between the static parent node and the edge node as a data block type for transmitting the scheduling control command.
The static father node 3 is configured to package the scheduling control command into a preset media format according to a preset streaming media protocol, and send the scheduling control command in the preset media format to the edge node 4 requesting the media stream through a transmission channel of the media stream.
In an example, the static parent node 3 is configured to package the scheduling control command into a preset media format according to a preset streaming media protocol, set a data block type of the scheduling control command in the preset media format as a preset type, and send the scheduling control command with the data block type as the preset type to the edge node 4 requesting the media stream through a transmission channel of the media stream.
The edge node 4 is configured to, when receiving data in a preset media format, determine whether a data block type of the data is a preset type, and when determining that the data block type of the data is the preset type, use the data as a scheduling control command.
In this embodiment, a preset type is agreed between the static father node 3 and the edge node 4 as a data block type for transmitting the scheduling control command, so that a preset media format can be used when the media stream and the scheduling control command are transmitted between the static father node 3 and the edge node 4. The edge node 4 obtains the data block type of the data when receiving the data in the preset media format, if the data block type of the data is the preset type, the data is indicated to be a scheduling control command, and then obtains the media stream from the dynamic father node 2 according to the scheduling control command, wherein the scheduling control command at least comprises the address information of the dynamic father node 2. Otherwise, it indicates that the data block type of the data is audio, video, etc., and the data is a media stream, which can be pushed to the client 6.
This embodiment defines a data block type of media format data, so that the media format can be used to transmit the scheduling control command and the multimedia data simultaneously.
A twelfth embodiment of the present invention relates to a CDN network, and is different from the tenth embodiment mainly in that: the scheduling control command also comprises; command flag bits and check values.
The static father node 3 is further configured to set a command flag bit to a preset value when it is determined that the number of the edge nodes 4 requesting the media stream in the first preset time does not reach a preset number threshold, where when the command flag bit is the preset value, it indicates that the static father node requests the edge nodes to directly pull the stream to the dynamic father node, and the preset value may be 0 or 1.
The static father node 3 is also used for calculating a check value of the scheduling control command according to a preset mode; specifically, when the scheduling control command is generated, the static parent node 3 calculates the sum of the command flag bit, the address information of the static parent node, and the address information of the dynamic parent node as the target check value of the scheduling control command.
In summary, the scheduling control command generated by the static father node 3 includes a command flag bit, address information of the static father node, a dynamic father node, and a check value; the structure of the data in the scheduling control command is specifically as follows:
| 8b(cmd)
|
64b(cur_ip)
|
64b(remote_ip)
|
8b(sum) |
wherein cmd represents a command flag; cur-ip represents address information of a static father node; remote _ ip represents address information of a dynamic parent node; sum denotes a check value.
In one example, the edge node 4 is configured to obtain the media stream from the dynamic parent node 2 according to the address information when the command flag is determined to be the preset value.
In one example, the edge node 4 is configured to calculate a target check value of the scheduling control command according to a preset manner, and obtain the media stream from the dynamic parent node 2 according to the address information when it is determined that the target check value matches the check value.
The following describes a diversion method of the CDN network in this embodiment.
When a user watches live broadcasting, the user can use an electronic device such as a mobile phone and a tablet personal computer as a user end 6 to send a stream pulling request to a nearest edge node 4, when the edge node 4 receives the stream pulling request sent by the user end 6, the edge node 4 establishes connection with a corresponding static father node 3, a media stream corresponding to the stream pulling request is pulled from the static father node 3, the static father node 3 establishes connection with a dynamic father node 2, the media stream corresponding to the stream pulling request is pulled from the dynamic father node 2, then the static father node 3 pushes the media stream to the edge node 4 through a transmission channel established between the static father node 3 and the edge node 4, and the edge node 4 can push the media stream to the user end 6 so that the user can watch live broadcasting.
When pushing a media stream to an edge node 4, a static father node 3 starts timing, counts the number of edge nodes 4 initiating a stream pulling request for the media stream within a first preset time, and generates a scheduling control command if the counted number does not reach a preset number threshold, wherein the scheduling control command comprises: the command flag bit, the address information of the static father node, the address information of the dynamic father node and the check value, and sends a scheduling control command in a preset media format to the edge node 4 through a transmission channel of the media stream.
After receiving the scheduling control command, the edge node 4 firstly judges whether a command flag bit is a preset value, if the command flag bit is the preset value, calculates a target check value of the scheduling control command according to a preset mode, and compares the target check value with a check value in the scheduling control command to judge whether the scheduling control command is legal, and when the target check value and the check value are equal, the edge node 4 judges that the scheduling control command is legal, can directly pull streaming from the dynamic father node 2, and then initiates a streaming pulling request to the dynamic father node 2 according to the address information of the dynamic father node 2 in the scheduling control command, so that a media stream corresponding to the streaming pulling request can be directly obtained from the dynamic father node 2; otherwise, the media stream is continuously acquired from the dynamic father node 2 through the static father node 3.
Since the sixth embodiment corresponds to the present embodiment, the present embodiment can be implemented in cooperation with the sixth embodiment. The related technical details mentioned in the fourth embodiment are still valid in this embodiment, and the technical effects that can be achieved in the sixth embodiment can also be achieved in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the sixth embodiment.
Compared with the tenth embodiment, the present embodiment provides a specific implementation manner of acquiring a media stream from a dynamic parent node according to a scheduling control command.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.