Media data forwarding method, electronic equipment and storage medium
By detecting the capability set and location information of the connection ends of IoT devices, determining the appropriate transmission connection protocol, and establishing a connection, the problem of poor compatibility between new and old devices is solved, and the user experience and network stability are improved.
Patent Information
- Application Number
- CN202411951199.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-16
AI Technical Summary
The existing IoT device forwarding platform is difficult to compatible with new and old versions of connected devices, resulting in a lower experience of the target object.
By receiving the stream pull request sent by the client, the capability sets of at least two connections are detected, the transmission connection protocols of each connection are determined, and the connection is established separately to realize the forwarding of media data.
Improves compatibility of new and old connected devices, improves the user experience of target objects, and improves the system's anti-network jitter capability and data transmission speed.
Smart Images

Figure CN120017641A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a media data forwarding method, an electronic device, and a storage medium. Background Art
[0002] At present, with the widespread application of Internet of Things devices, forwarding platforms are also widely used. However, the existing technical solutions are not well compatible with the existing connection devices of different new and old versions, resulting in a low user experience for the target objects. Summary of the invention
[0003] The present application at least provides a media data forwarding method, an electronic device, and a storage medium, which can improve the user experience of the target object.
[0004] The first aspect of the present application provides a media data forwarding method, which includes: a forwarding platform receives a stream pulling request sent by a client; detects the capability sets of at least two connection ends to determine the transmission connection protocol of each connection end, wherein the at least two connection ends include a client end and a device end; establishes a connection with each connection end according to the transmission connection protocol of each connection end; receives media data from one connection end, and forwards the media data to another connection end.
[0005] Among them, the capability sets of at least two connection ends are detected to determine the transmission connection protocol of each connection end, including: determining the initial connection protocol of the connection end based on the capability set of the connection end; using the location information of the connection end to determine the location connection protocol corresponding to the location information; comparing the initial connection protocol and the location connection protocol to determine the transmission connection protocol with the connection end.
[0006] Among them, comparing the initial connection protocol and the location connection protocol to determine the transmission connection protocol with the connection end includes at least one of the following steps: in response to the inconsistency between the initial connection protocol of the device end and the location connection protocol of the device end, using the location connection protocol of the device end as the transmission connection protocol of the device end; in response to the inconsistency between the initial connection protocol of the client and the location connection protocol of the client, using the location connection protocol of the client as the transmission connection protocol of the client.
[0007] Among them, a connection is established with each connection end according to the transmission connection protocol of each connection end, including: generating a streaming address based on the transmission connection protocol of the device end; sending the streaming address to the connection end, so that the connection end establishes a connection with the forwarding platform through the streaming address and the transmission connection protocol.
[0008] Among them, after establishing a connection with each connection end according to the transmission connection protocol of each connection end, it also includes: sending a check signaling to the client at every preset interval, and disconnecting the connection with the device end in response to not receiving feedback information sent by the client within the preset time; and / or, receiving abnormal situation information sent by the client, disconnecting the connection with the device end.
[0009] Among them, after establishing a connection with each connection end according to the transmission connection protocol of each connection end, it also includes: in response to receiving the download request information sent by the client, querying the number of remaining download channels on the device end; based on the download request information and the remaining number of download channels, determining the number of download channels connected to the device end; using the number of download channels, receiving the media data sent by the device end, and forwarding the received media data to the client.
[0010] Among them, after determining the number of download channels connected to the device end based on the download request information and the remaining number of download channels, it also includes: determining the remaining bandwidth information of the device end except for responding to the download request information based on the capability set of the device end; sending the remaining bandwidth information to the device end, so that the device end uses all the remaining bandwidth to send media data to the forwarding platform.
[0011] Among them, forwarding the received media data to the client includes: in response to the network quality of the client not meeting the preset requirements, caching the received media data into the cache space; sending the media data in the cache space to the client one by one; the method also includes at least one of the following steps: in response to the media data cached in the cache space being greater than or equal to the first cache threshold, sending a reduced outflow information to the device end to notify the device end to reduce the sending speed of the media data; in response to the media data cached in the cache space being less than or equal to the second cache threshold, sending an increased outflow information to the device end to notify the device end to increase the sending speed of the media data.
[0012] A second aspect of the present application provides an electronic device, comprising a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the media data forwarding method in the first aspect.
[0013] A third aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, and when the program instructions are executed by a processor, the media data forwarding method in the first aspect described above is implemented.
[0014] In the above scheme, after receiving the streaming request sent by the client, the forwarding platform detects the capability sets of at least two connection ends to determine the transmission connection protocol of each connection end, and then establishes a connection with each connection end according to the transmission connection protocol of each connection end. After that, when the forwarding platform receives the media data from one connection end, it can forward the media data to the other connection end, so that both the new and old connection ends can establish a connection with the forwarding platform to send and receive media data, thereby improving the compatibility of the forwarding platform and the user experience of the target object.
[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0017] Figure 1 It is a flowchart of an embodiment of the media data forwarding method of the present application;
[0018] Figure 2 This is a schematic diagram of the framework of an embodiment of the Internet of Things system of the present application;
[0019] Figure 3 It is a flowchart of another embodiment of the media data forwarding method of the present application;
[0020] Figure 4 It is a schematic diagram of the framework of an embodiment of the media data forwarding device of the present application;
[0021] Figure 5 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0022] Figure 6 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0023] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0024] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0025] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previously associated objects are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B and C.
[0026] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the media data forwarding method of the present application. Specifically, it may include the following steps:
[0027] Step S110: The forwarding platform receives the stream pulling request sent by the client.
[0028] This application mainly involves the fields of IoT devices, streaming media, etc. Through the policy configuration of the forwarding platform, the compatibility of new and old connection end devices is achieved. Through the configuration of the capability set of the connection end, the most suitable transmission connection protocol is selected, and the anti-jitter capability of the device is improved. In addition, the platform is used to optimize and improve services such as intercom and card video download to improve the user experience of the target object.
[0029] Please refer to Figure 2 , Figure 2 1 is a schematic diagram of a framework of an embodiment of an Internet of Things system 200 of the present application. The Internet of Things system 200 includes a forwarding platform 210 and a connection terminal 220. The forwarding platform 210 is used to receive, send, and cache data, and determine the streaming address according to the capability set of the connection terminal 220. The connection terminal 220 includes a client 221 and a device terminal 222, the client 221 is used to send requests and download media data from the forwarding platform 210, and the device terminal 222 is used to send media data.
[0030] Before the connection between the forwarding platform 210 and the client 221 is established, a connectionless service can be used to send the request data. For example, the IP (Internet Protocol) method can be used, that is, the address of the forwarding platform 210 is carried in the stream pull request, and the client 221 sends the stream pull request containing the address of the forwarding platform 210 to the line of the Internet of Things system 200, and then the Internet of Things system 200 selects a route for transmission, thereby sending the stream pull request to the forwarding platform 210. For another example, the UDP (User Datagram Protocol) method can be used to send the stream pull request to the forwarding platform 210. Among them, the stream pull request at least includes the address of the client 221, the version number of the client 221, the connection address of the device end 222 to be connected, the checksum and other information.
[0031] It is understandable that, when the forwarding platform 210 and the client 221 are not connected, the manner in which the client 221 sends and receives the stream pulling request is not specifically limited herein.
[0032] The client 221 may be a mobile phone, computer, tablet or other device, and the device 222 may be a camera, mobile phone or other device. The forwarding platform 210 may be connected to multiple clients 221 and multiple devices 222 at the same time, and one client 221 is connected to one device 222 through the forwarding platform 210 .
[0033] Step S120: detecting the capability sets of at least two connection ends to determine the transmission connection protocol of each connection end, wherein the at least two connection ends include a client end and a device end.
[0034] Among them, the capability set refers to the set of target services and corresponding service features in the intelligent network. The capability set of the intelligent network (CS-1) includes 25 intelligent services, such as the centralized fee collection service (FS), calling card service (CCS), universal number service (UNS), personal number service (PNS) and virtual private network (VPN) service. In addition, the capability set also includes the system version number, supported transmission protocols, etc.
[0035] In some embodiments, after receiving the stream pull request sent by the client 221, the forwarding platform 210 first verifies the checksum in the stream pull request. If the verification fails, it means that the stream pull request sent by the client 221 has an abnormal situation (such as data loss and other abnormal situations), and sends feedback information to the client 221; if the verification passes, the stream pull request is further parsed to obtain the address of the client 221 and the connection address of the device end 222 to be connected, and the capability set of the client 221 is obtained through the address of the client 221, and the capability set of the device end 222 to be connected is obtained through the connection address of the device end 222 to be connected, so as to determine the transmission connection protocol of the client 221 and the device end 222. Specifically, please refer to steps S121 to S123.
[0036] Step S121: Determine the initial connection protocol of the connection end based on the capability set of the connection end.
[0037] In some embodiments, when the connection end 220 is the client 221, the forwarding platform 210 obtains the corresponding capability set of the client 221 through the address of the client 221 in the stream pull request for parsing, thereby determining the connection protocol supported by the client 221 as the initial connection protocol. Among them, the initial connection protocol can be QUIC (Quick UDP Internet Connections, a transport layer protocol based on the User Datagram Protocol), TCP (Transmission Control Protocol), HTTP (Hypertext Transfer Protocol) and other protocols, which are not specifically limited here.
[0038] In other embodiments, when the connection end 220 is a device end 222, the forwarding platform 210 obtains the capability set of the corresponding device end 222 through the connection address of the device end 222 to be connected in the pull request, and performs parsing, thereby determining the connection protocol supported by the device end 222 as the initial connection protocol. The initial connection protocol may be QUIC, TCP, HTTP, etc., which is not specifically limited here.
[0039] The capability set of the connection end 220 may be pre-configured and stored in the IoT system 200 . Therefore, after the forwarding platform 210 obtains the address of the connection end 220 , it may find the capability set of the corresponding connection end 220 from the IoT system 200 according to the address.
[0040] Step S122: using the location information of the connection end, determine the location connection protocol corresponding to the location information.
[0041] In some embodiments, considering the control of some regions on the transmission connection protocol, the connection end 220 in the region can only use the transmission connection protocol allowed by the region. Therefore, before determining the transmission connection protocol of the connection end 220, the location information of the connection end 220 is also obtained, and the regulations on the transmission connection protocol in the region where the connection end 220 is located are determined through the location information. For example, some mobile phone systems in South Korea and Australia do not support the UDP protocol. If the UDP protocol is used, the sent data will be garbled, unable to be sent and received, etc., but the TCP protocol can be used.
[0042] In one implementation scenario, the above step S121 and step S122 may be performed in a sequential order, for example, step S121 is performed first, and then step S122; or, step S122 is performed first, and then step S121. In another implementation scenario, the above step S121 and step S122 may also be performed simultaneously, which may be specifically set according to actual applications and is not limited here.
[0043] Step S123: Compare the initial connection protocol and the location connection protocol to determine the transmission connection protocol with the connection end.
[0044] In some embodiments, after obtaining the initial connection protocol and the location connection protocol of the connection end 220, the initial connection protocol and the location connection protocol are analyzed to determine the transmission connection protocol of the connection end 220. Specifically, if the initial connection protocol and the location connection protocol of the connection end 220 are inconsistent, the location connection protocol of the connection end 220 is used as the transmission connection protocol of the connection end 220. In this case, the connection protocol specified by the region or country shall prevail. For example, in response to the inconsistency between the initial connection protocol of the device end 222 and the location connection protocol of the device end, the location connection protocol of the device end 222 is used as the transmission connection protocol of the device end 222; in response to the inconsistency between the initial connection protocol of the client end 221 and the location connection protocol of the client end 221, the location connection protocol of the client end 221 is used as the transmission connection protocol of the client end 221.
[0045] In addition, in order to be compatible with the new and old versions of the connection terminal 220 and to improve the overall system's ability to resist network jitter and data transmission speed, a transmission connection protocol with a higher priority is usually set in the IoT system 200 .
[0046] Specifically, in this embodiment, the transmission connection protocol with a higher priority in the Internet of Things system 200 is set to the QUIC protocol, and the transmission connection protocol with a lower priority is set to the TCP protocol. The new version of the connection end 220 supports the QUIC protocol, while the old version of the connection end 220 supports the TCP protocol. Therefore, when analyzing the capability sets of the client 221 and the device end 222, if the analysis result is that the client 221 supports the QUIC protocol and the TCP protocol, the QUIC protocol is preferentially selected as the transmission connection protocol of the client 221, otherwise the TCP protocol is used as the transmission connection protocol of the client 221; if the analysis result is that the device end 222 supports the QUIC protocol and the TCP protocol, the QUIC protocol is used as the transmission connection protocol of the device end 222, otherwise the TCP protocol is used as the transmission connection protocol of the device end 222. Therefore, four transmission links may be formed between the client 221, the forwarding platform 210 and the device end 222, namely, TCP protocol-forwarding platform 210-TCP protocol, QUIC protocol-forwarding platform 210-TCP protocol, QUIC protocol-forwarding platform 210-QUIC protocol, and TCP protocol-forwarding platform 210-QUIC protocol, thereby achieving smooth compatibility between new and old connection end 220 devices, and at the same time improving the data transmission speed in a weak network environment and the ability to resist network jitter.
[0047] To improve the use scope of the connection end 220 , it is usually configured to support multiple transmission connection protocols when it leaves the factory. However, with the advancement of technology, the transmission connection protocols supported by the old version of the connection end 220 may be less than the transmission connection protocols supported by the new version of the connection end 220 .
[0048] Step S130: Establishing connections with each connection end according to the transmission connection protocol of each connection end.
[0049] In some embodiments, a policy allocation service (Route server) is provided in the forwarding platform 210, and the policy allocation service allocates a streaming address to the client 221, so that the client 221 is connected to the forwarding platform 210 through the streaming address. In addition, the policy allocation service will also send the streaming request and the streaming address to the device end 222, so that the device end 222 is connected to the forwarding platform 210 through the streaming address.
[0050] In other embodiments, a stream pull address may be generated based on the transmission connection protocol of the device end 222, and then the stream pull address may be sent to the connection end 220, so that the connection end 220 establishes a connection with the forwarding platform 210 through the stream pull address and the transmission connection protocol. Specifically, the forwarding platform 210 is provided with a plurality of execution machines, each of which is used for receiving, sending and caching media data. The stream pull address represents the address of the execution machine. After the corresponding execution machine is determined through the transmission connection protocol of the device end 222, the address of the execution machine is sent to the device end 222 and the client end 221, so that both the device end 222 and the client end 221 establish a connection with the execution machine, thereby making the device end 222 indirectly connected to the client end 221.
[0051] In the case where the forwarding platform 210 has established connections with the client 221 and the device 222, if the client 221 is subsequently abnormally closed (for example, a sudden network disconnection, abnormal shutdown, exit from the client backend), the device 222 link will be occupied, and intercom will not be possible for a short period of time (the device 222 can only be connected to one client 221 through the forwarding platform 210 at the same time), which will cause a waste of resources. Therefore, a keep-alive check mechanism can be set in the forwarding platform 210 to detect the status of the client 221, promptly discover the abnormal status of the client 221, and promptly disconnect the device 222 to quickly initiate a second intercom. Specifically, a check signaling is sent to the client 221 at a preset interval, and in response to not receiving feedback information sent by the client 221 within the preset time, the connection with the device 222 is disconnected, so that the device 222 can establish the next connection.
[0052] In addition, if abnormal situation information sent by the client 221 is received, the connection with the device end 222 can also be disconnected.
[0053] Step S140: receiving media data from one connection end, and forwarding the media data to another connection end.
[0054] The media data may be video data, audio data, etc., which are not specifically limited here.
[0055] In some embodiments, after the connection end 220 establishes a connection with the forwarding platform 210, the forwarding platform 210 can receive media data from one connection end 220 and forward the media data to another connection end 220. Specifically, the forwarding platform 210 can receive media data sent by the device end 222, and then the client 221 can download the media data from the forwarding platform 210.
[0056] Furthermore, in order to improve the user experience of the target object, when the client 221 downloads the media data, the sending of the media data of the device end 222 can be accelerated. Specifically, please refer to step S141 to step S143.
[0057] Step S141: In response to receiving the download request information sent by the client, query the number of remaining download channels on the device side.
[0058] The download request information and the stream pulling request may be the same data information, that is, the download request information is the stream pulling request; or the download request information and the stream pulling request are not the same data information.
[0059] After the client 221 indirectly establishes a connection with the device 222 through the forwarding platform 210, the download request information sent by the client 221 is parsed to determine the amount of media data that the client 221 needs to download, and the number of remaining download channels of the device 222 is queried to determine the sending rate of the media data of the device 222.
[0060] Step S142: Based on the download request information and the remaining number of download channels, determine the number of download channels connected to the device end.
[0061] In some embodiments, after determining the amount of media data that the client 221 needs to download and the number of remaining download channels of the device 222, the number of download channels corresponding to the download request information can be determined.
[0062] For example, the client 221 needs to download multiple card recordings. In order to improve the download efficiency, multiple long links need to be established between the device end 222 and the forwarding platform 210. Therefore, after obtaining that the number of remaining download channels of the device end 222 is 10, 5 remaining download channels are allocated as the number of download channels connected to the device end 222; if the 10 remaining download channels are used as the number of download channels connected to the device end 222, the upper limit of the link of the device end 222 will be full, making it impossible for the device end 222 to perform operations such as outflow. Therefore, it is necessary to reasonably allocate the remaining number of download channels of the device end 222. In addition, regarding the number of download channels, if the client 221 completes the download or cancels the download, the client 221 will send information to the forwarding platform 210 to disconnect the multiple long links established with the device end 222 to protect the device end 222 and avoid exhaustion of the upper limit of the long link of the device end 222.
[0063] Furthermore, in order to speed up the sending rate of the media data of the device end 222, the remaining bandwidth information of the device end 222 other than the response to the download request information can also be determined based on the capability set of the device end 222. Then the remaining bandwidth information is sent to the device end 222, so that the device end 222 uses all the remaining bandwidth to send the media data to the forwarding platform 210. In this way, the device end 222 can perform full network speed outbound streaming without affecting normal services, and send the media data to the forwarding platform 210. If there is intercom and real-time streaming, the bandwidth of intercom and real-time streaming is preferentially satisfied, and the redundant bandwidth is used to send the media data at full speed.
[0064] In some embodiments, after establishing a connection with the forwarding platform 210, the device end 222 can maintain a long connection link with the forwarding platform 210 through httproxy, so that the device end 222 remains online for a long time.
[0065] Step S143: using the download channel number, receiving the media data sent by the device end, and forwarding the received media data to the client end.
[0066] In some embodiments, after the number of download channels is determined, the media data sent by the device end 222 can be received through the number of download channels, and the received media data can be forwarded to the client 221. In addition, in response to the network quality of the client 221 not meeting the preset requirement, the received media data is cached in the cache space, and then the media data in the cache space is sent one by one to the client 221. The preset requirement is that the network speed of the client 221 is lower than 1MB / s.
[0067] It is understandable that the preset requirements can be set according to actual conditions and are not specifically limited here.
[0068] Furthermore, in order to prevent the media data sent by the device end 222 from occupying too much cache space of the forwarding platform 210, the sending rate of the device end 222 can be adaptively adjusted. Specifically, in response to the media data cached in the cache space being greater than or equal to a first cache threshold (e.g., 80% of the storage capacity of the cache space), a reduced outflow information is sent to the device end 222 to notify the device end 222 to reduce the sending speed of the media data.
[0069] At the same time, in order to avoid a download window period caused by the high download rate of the client 221, which causes the media data in the cache space to be downloaded completely, the media data cached in the cache space can be less than or equal to the second cache threshold (for example, 20% of the storage capacity of the cache space), and the increased outflow information can be sent to the device end to notify the device end to increase the sending speed of the media data. In this way, the forwarding platform 210 can achieve self-protection of the platform through the judgment of the cache space.
[0070] See also Figure 3 , Figure 3 This is a flow chart of another embodiment of the media data forwarding method of the present application. Specifically, it may include the following steps:
[0071] Step S310: The forwarding platform receives a stream pulling request sent by the client.
[0072] This step is the same as the above step S110, so it will not be described again here.
[0073] Step S320: verify the stream pull request and obtain a verification result.
[0074] In some embodiments, the header field in the stream pull request is initially verified to determine whether data tampering, data loss, or other abnormal phenomena occur in the stream pull request. If the initial verification result shows that the stream pull request has an abnormality, the entire process ends; if the initial verification result shows that the stream pull request has no abnormality, the client 221 that sends the stream pull request is further verified to be an authorized client. If not, the entire process ends; if yes, the subsequent steps are executed. The verification method for the client 221 is to obtain the device model of the client 221, and compare the obtained device model with the authorized device model stored in the Internet of Things system 200. If the comparison result shows that the device model of the client 221 is consistent with the authorized device model stored in the Internet of Things system 200, the verification is passed.
[0075] Step S330: In response to the verification result being passed, the capability sets of at least two connection ends are detected to determine the transmission connection protocol of each connection end.
[0076] This step is the same as the above step S120, so it will not be described again here.
[0077] Step S340: Establishing connections with each connection end according to the transmission connection protocol of each connection end.
[0078] This step is the same as the above step S130, so it will not be described again here.
[0079] Step S350: receiving media data from one connection end, and forwarding the media data to another connection end.
[0080] This step is the same as the above step S140, so it will not be described again here.
[0081] The forwarding platform in this application performs adaptive conversion of the transmission connection protocol between the client and the device according to the capability set of the device and the client. For example, if it is an old version of the client and the old device, the TCP protocol is used. If it is a QUIC device and a new version of the client, the QUIC protocol is used for streaming. In addition, the location connection protocol can be determined based on the IP information of the device and the client to comply with the local transmission connection protocol regulations.
[0082] Secondly, services such as streaming intercom are optimized. By detecting the status of the intercom client, abnormal intercom situations are handled in a timely manner to avoid situations where the intercom connection on the device side (camera) is occupied. The link on the device side can be disconnected in time so that the intercom link can be quickly re-initiated.
[0083] This application utilizes the remaining bandwidth of the device end 222 to stream the card video at full network speed without affecting normal business, thereby greatly improving the card video download speed of the device and realizing self-protection of the forwarding platform.
[0084] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0085] See also Figure 4 , Figure 4 It is a framework diagram of an embodiment of a media data forwarding device 400 of the present application. The media data forwarding device 400 includes a receiving module 410, a detection module 420, a connection module 430 and a forwarding module 440. The receiving module 410 executes the forwarding platform to receive the stream pulling request sent by the client. The detection module 420 performs detection of the capability set of at least two connection ends to determine the transmission connection protocol of each connection end, wherein the at least two connection ends include a client end and a device end. The connection module 430 executes to establish a connection with each connection end according to the transmission connection protocol of each connection end. The forwarding module 440 executes to receive the media data from one connection end and forward the media data to another connection end.
[0086] In some embodiments, the detection module 420 performs detection on the capability sets of at least two connection ends to determine the transmission connection protocol of each connection end, including: determining the initial connection protocol of the connection end based on the capability set of the connection end; using the location information of the connection end to determine the location connection protocol corresponding to the location information; comparing the initial connection protocol and the location connection protocol to determine the transmission connection protocol with the connection end.
[0087] In some embodiments, the detection module 420 performs a comparison of the initial connection protocol and the location connection protocol to determine the transmission connection protocol with the connection end, including at least one of the following steps: in response to the inconsistency between the initial connection protocol of the device end and the location connection protocol of the device end, using the location connection protocol of the device end as the transmission connection protocol of the device end; in response to the inconsistency between the initial connection protocol of the client and the location connection protocol of the client, using the location connection protocol of the client as the transmission connection protocol of the client.
[0088] In some embodiments, the connection module 430 executes to establish a connection with each connection end according to the transmission connection protocol of each connection end, including: generating a stream pulling address based on the transmission connection protocol of the device end; sending the stream pulling address to the connection end, so that the connection end establishes a connection with the forwarding platform through the stream pulling address and the transmission connection protocol.
[0089] In some embodiments, after the connection module 430 establishes a connection with each connection end according to the transmission connection protocol of each connection end, it also includes: sending a check signaling to the client at every preset time interval, and disconnecting the connection with the device end in response to not receiving feedback information sent by the client within the preset time; and / or disconnecting the connection with the device end upon receiving abnormal situation information sent by the client.
[0090] In some embodiments, after the connection module 430 establishes a connection with each connection end according to the transmission connection protocol of each connection end, it also includes: in response to receiving the download request information sent by the client, querying the number of remaining download channels on the device end; based on the download request information and the remaining number of download channels, determining the number of download channels connected to the device end; using the number of download channels, receiving the media data sent by the device end, and forwarding the received media data to the client.
[0091] In some embodiments, after the connection module 430 determines the number of download channels connected to the device end based on the download request information and the remaining number of download channels, it also includes: determining the remaining bandwidth information of the device end except for responding to the download request information based on the capability set of the device end; sending the remaining bandwidth information to the device end so that the device end uses all the remaining bandwidth to send media data to the forwarding platform.
[0092] In some embodiments, the connection module 430 executes forwarding the received media data to the client, including: in response to the network quality of the client not meeting the preset requirements, caching the received media data in the cache space; sending the media data in the cache space to the client one by one; the method also includes at least one of the following steps: in response to the media data cached in the cache space being greater than or equal to the first cache threshold, sending a reduced outflow information to the device end to notify the device end to reduce the sending speed of the media data; in response to the media data cached in the cache space being less than or equal to the second cache threshold, sending an increased outflow information to the device end to notify the device end to increase the sending speed of the media data.
[0093] See also Figure 5 , Figure 5 1 is a schematic diagram of a framework of an embodiment of an electronic device 50 of the present application. The electronic device 50 includes a memory 51 and a processor 52 coupled to each other, and the processor 52 is used to execute program instructions stored in the memory 51 to implement the steps in any of the above-mentioned media data forwarding method embodiments. In a specific implementation scenario, the electronic device 50 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 50 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0094] Specifically, the processor 52 is used to control itself and the memory 51 to implement the steps in any of the above-mentioned media data forwarding method embodiments. The processor 52 can also be called a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip with signal processing capabilities. The processor 52 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 52 can be implemented by an integrated circuit chip.
[0095] See also Figure 6 , Figure 6 The schematic diagram is a schematic diagram of a computer-readable storage medium 60 of the present application. The computer-readable storage medium 60 stores program instructions 601 that can be executed by a processor, and the program instructions 601 are used to implement the steps in any of the above-mentioned media data forwarding method embodiments.
[0096] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0097] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0098] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0099] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0100] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A media data forwarding method, characterized in that: include: The forwarding platform receives the streaming request sent by the client; Detecting capability sets of at least two connection ends to determine a transmission connection protocol of each of the connection ends, wherein the at least two connection ends include a client end and a device end; Establishing connections with each of the connection ends according to the transmission connection protocols of each of the connection ends; The media data is received from one of the connection ends, and the media data is forwarded to another of the connection ends.
2. The method according to claim 1, characterized in that The detecting the capability sets of at least two connection ends to determine the transmission connection protocol of each of the connection ends includes: Determining an initial connection protocol of the connection end based on the capability set of the connection end; Using the location information of the connection end, determining a location connection protocol corresponding to the location information; The initial connection protocol and the location connection protocol are compared to determine a transmission connection protocol with the connection end.
3. The method according to claim 2, characterized in that The comparing the initial connection protocol and the location connection protocol to determine the transmission connection protocol with the connection end comprises at least one of the following steps: In response to the initial connection protocol of the device being inconsistent with the location connection protocol of the device, using the location connection protocol of the device as the transmission connection protocol of the device; In response to the initial connection protocol of the client being inconsistent with the location connection protocol of the client, the location connection protocol of the client is used as the transmission connection protocol of the client.
4. The method according to claim 1, characterized in that The establishing a connection with each of the connection ends according to the transmission connection protocol of each of the connection ends respectively includes: Generate a streaming address based on the transmission connection protocol of the device end; The stream pulling address is sent to the connection end, so that the connection end establishes a connection with the forwarding platform through the stream pulling address and the transmission connection protocol.
5. The method according to claim 1, characterized in that After establishing a connection with each of the connection ends according to the transmission connection protocol of each of the connection ends, the method further includes: Sending a check signaling to the client at a preset interval, and disconnecting the connection with the device end in response to not receiving feedback information sent by the client within the preset time; And / or, upon receiving abnormal situation information sent by the client, disconnecting from the device.
6. The method according to claim 1, characterized in that After establishing a connection with each of the connection ends according to the transmission connection protocol of each of the connection ends, the method further includes: In response to receiving the download request information sent by the client, querying the number of remaining download channels of the device end; Determine the number of download channels connected to the device end based on the download request information and the remaining number of download channels; The media data sent by the device end is received by utilizing the download channel number, and the received media data is forwarded to the client end.
7. The method according to claim 6, characterized in that After determining the number of download channels connected to the device end based on the download request information and the remaining number of download channels, the method further includes: Based on the capability set of the device, determine the remaining bandwidth information of the device other than responding to the download request information; The remaining bandwidth information is sent to the device end, so that the device end uses all the remaining bandwidth to send media data to the forwarding platform.
8. The method according to claim 6, characterized in that The forwarding the received media data to the client includes: In response to the network quality of the client not meeting the preset requirement, caching the received media data into a cache space; Sending the media data in the cache space to the client one by one; The method further comprises at least one of the following steps: In response to the media data cached in the cache space being greater than or equal to a first cache threshold, sending outflow reduction information to the device end to notify the device end to reduce a sending speed of the media data; In response to the media data cached in the cache space being less than or equal to a second cache threshold, an increase in outflow information is sent to the device end to notify the device end to increase a sending speed of the media data.
9. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the media data forwarding method according to any one of claims 1 to 8.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the media data forwarding described in any one of claims 1 to 8 is implemented.