Data transmission method and device, cluster, program product and storage medium
By using an intermediate device to resolve the issue of live streaming service interruption when the media server connection is lost, and utilizing cached data and the transmission path of the second media server, the stability and integrity of data transmission are ensured.
Patent Information
- Application Number
- CN202411178256.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2026-03-03
AI Technical Summary
In live streaming scenarios, when the media server undergoes software upgrades or crashes, the connection between the encoder and the media server is lost, causing the live streaming service on the display terminal to be interrupted and reducing the stability of data transmission.
When the intermediate device disconnects from the first media server, it retrieves cached data and sends it to the receiving device through the second media server, avoiding attempts to reconnect and ensuring the stability and integrity of data transmission.
This improved the stability and integrity of data transmission, avoiding data loss and duplicate reception issues caused by media server downtime, and ensuring the continuity of live streaming services.
Smart Images

Figure CN121603573A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a data transmission method, apparatus, cluster, program product, and storage medium. Background Technology
[0002] As is well known, in a live broadcast scenario, when the captured video footage needs to be sent to a display terminal, the satellite equipment needs to send the video data of the video footage to an encoder, which then sends the video data stream to the display terminal through a media server.
[0003] In the event of a software upgrade or a system crash on the media server, the communication link with the encoder will be disconnected, preventing the display terminal from receiving video data and thus interrupting the live streaming service. In this case, the encoder will periodically (e.g., every 10 seconds) attempt to reconnect to the media server until it does.
[0004] However, the above processing method requires the encoder to continuously attempt to reconnect with the media server until the encoder reconnects to the media server; during this reconnection attempt, the live broadcast service of the display terminal will be interrupted, thereby reducing the stability of data transmission. Summary of the Invention
[0005] This application provides a data transmission method, apparatus, cluster, program product, and storage medium that can improve the stability of data transmission.
[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0007] In a first aspect, embodiments of this application provide a data transmission method. This method is applied to an intermediate device belonging to a data transmission system, which further includes a sending device, multiple media servers, and a receiving device. The sending device has a communication connection with the intermediate device, and the intermediate device is connected to the receiving device via media servers. The multiple media servers include a first media server and a second media server. The method includes: acquiring first data sent by the sending device; the first data being data to be sent to the receiving device; acquiring cached data in the intermediate device when the first connection between the intermediate device and the first media server is broken; the cached data including data previously sent by the intermediate device to the receiving device via the first media server; sending the cached data to the receiving device via the second media server; and after sending the cached data to the receiving device, sending the first data to the receiving device via the second media server.
[0008] The data transmission method provided in the above embodiments is applied to an intermediate device, which belongs to a data transmission system. This data transmission system further includes a sending device, a media server, and a receiving device. The sending device and the intermediate device have a communication connection, and the intermediate device is connected to the receiving device through a media server. The media server includes a first media server and a second media server. The method includes: acquiring first data to be sent to the receiving device from the sending device; if the first connection between the intermediate device and the first media server is broken, the intermediate device does not need to attempt to reconnect to the first media server; instead, the intermediate device first acquires cached data on it; the cached data includes data previously sent by the intermediate device to the receiving device through the first media server; then, the cached data is sent to the receiving device through the second media server; and after sending the cached data to the receiving device, the first data is sent to the receiving device through the second media server; thus, the receiving device can continuously receive data sent by the sending device, thereby improving the stability of data transmission.
[0009] Furthermore, in the event of the first connection being disconnected, the intermediate device first sends the cached data in the intermediate device to the receiving device through the second media server. Since the cached data includes the data that the intermediate device last sent to the receiving device through the first media server, it avoids the receiving device being unable to obtain the data that was not sent to the receiving device from the first media server due to the first media server crashing. Therefore, the integrity of data transmission is improved.
[0010] In one possible implementation, before sending the cached data to the receiving device via the second media server, the method further includes: establishing a second connection between the intermediate device and the receiving device via the second media server based on a transport protocol; the transport protocol includes TCP or UDP.
[0011] In one possible implementation, during the process of sending the first data to the receiving device via the second media server, after sending the first data to the second media server, the method further includes: updating the cached data based on the first data; the updated cached data includes the first data.
[0012] In one possible implementation, the data transmission system further includes a stream processing device; one end of the stream processing device is connected to the media server, and the other end of the stream processing device is connected to a receiving device; the above-mentioned sending cached data to the receiving device through the second media server includes: sending cached data to the stream processing device through the second media server, so that the stream processing device determines second data that has not been sent to the receiving device from the cached data, and sends the second data to the receiving device.
[0013] In the above embodiments, when the first connection is disconnected, the intermediate device sends the cached data to the streaming device through the second media server. The streaming device determines the second data that has not been sent to the receiving device from the cached data and sends the second data to the receiving device. Instead of sending all the cached data to the receiving device, the problem of the receiving device receiving the same data repeatedly is avoided, thus improving the accuracy of data transmission.
[0014] Furthermore, in the above embodiment, after the first connection is disconnected, the intermediate device sends the cached data in the intermediate device and the first data sent by the sending device to the receiving device through the second media server and the streaming processing device, thereby avoiding the problem that the receiving device cannot obtain the data sent by the sending device, thus improving the stability of data transmission.
[0015] In one possible implementation, the data transmission system further includes an encoding device. If the transmitting device is a satellite device, the transmitting device is connected to an intermediate device through the encoding device. The acquisition of the first data transmitted by the transmitting device includes: acquiring the first data encoded by the encoding device; the data format of the encoded first data matches the data format supported by the receiving device.
[0016] In the above embodiments, the encoding device is connected to the first media server through an intermediate device. When the first connection between the intermediate device and the first media server is broken, the intermediate device sends the first data obtained from the encoding device to the receiving device through the second media server. Therefore, the problem of the receiving device being unable to obtain the data sent by the sending device is avoided when the connection between the encoding device and the first media server is broken in a direct connection scenario. This is because the encoding device periodically attempts to reconnect with the first media server. Thus, the stability of data transmission is improved.
[0017] Secondly, embodiments of this application provide a data transmission apparatus deployed in an intermediate device, which is part of a data transmission system. The data transmission system further includes a sending device, multiple media servers, and a receiving device. The sending device has a communication connection with the intermediate device, and the intermediate device is connected to the receiving device via media servers. The multiple media servers include a first media server and a second media server. When the first connection between the intermediate device and the first media server is disconnected, the data transmission apparatus includes an acquisition unit and a sending unit. The acquisition unit is used to acquire first data sent by the sending device; the first data is data to be sent to the receiving device. The acquisition unit is also used to acquire cached data in the intermediate device when the first connection between the intermediate device and the first media server is disconnected; the cached data includes data previously sent by the intermediate device to the receiving device via the first media server. The sending unit is used to send the cached data to the receiving device via the second media server. The sending unit is also used to send the first data to the receiving device via the second media server after sending the cached data to the receiving device.
[0018] In one possible implementation, the data transmission apparatus further includes: a creation unit; the creation unit is used to establish a second connection between the intermediate device and the receiving device via the second media server, based on a transmission protocol, before sending the cached data to the receiving device via the second media server; the transmission protocol includes TCP protocol or UDP protocol.
[0019] In one possible implementation, the data transmission device further includes: an update unit; the update unit updates cached data based on the first data; the updated cached data includes the first data.
[0020] In one possible implementation, the sending unit is specifically used to send cached data to the streaming device via a second media server, so that the streaming device can determine the second data that has not been sent to the receiving device from the cached data and send the second data to the receiving device.
[0021] In one possible implementation, the acquisition unit is specifically used to acquire first data encoded by the encoding device; the data format of the encoded first data matches the data format supported by the receiving device.
[0022] Thirdly, this application provides a computing device cluster including at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, such that the computing device cluster performs the method described in the first aspect and any of its possible implementations.
[0023] Fourthly, this application provides a computer-readable storage medium having computer instructions stored thereon, which, when executed on a computing device, cause the computing device to perform the method described in any one of the first aspects and its possible implementations.
[0024] Fifthly, this application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in any one of the first aspects and their possible implementations.
[0025] It should be understood that the beneficial effects of the technical solutions of the second to fifth aspects of this application and the corresponding possible implementations can be referred to the above-described technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description
[0026] Figure 1 This is one of the schematic diagrams of a data transmission system provided in an embodiment of this application;
[0027] Figure 2 This is a second schematic diagram of a data transmission system provided in an embodiment of this application;
[0028] Figure 3 This is the third schematic diagram of a data transmission system provided in the embodiments of this application;
[0029] Figure 4 This application provides a schematic diagram of the hardware structure of a computing device.
[0030] Figure 5 This is one of the schematic flowcharts of a data transmission method provided in an embodiment of this application;
[0031] Figure 6 This is a second schematic diagram of a data transmission method provided in an embodiment of this application;
[0032] Figure 7 This is the third schematic diagram of a data transmission method provided in the embodiments of this application;
[0033] Figure 8 This is the fourth schematic diagram of a data transmission method provided in the embodiments of this application;
[0034] Figure 9 This is the fifth schematic diagram of a data transmission method provided in the embodiments of this application;
[0035] Figure 10 This is a schematic diagram of a data transmission device structure provided in an embodiment of this application;
[0036] Figure 11 A schematic diagram of a computing device cluster provided in an embodiment of this application;
[0037] Figure 12 This is a schematic diagram of a network connection provided in an embodiment of this application. Detailed Implementation
[0038] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0039] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first connection" and "second connection" are used to distinguish different connections, not to describe a specific order of connections.
[0040] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0041] As we all know, data transmission is the process of transmitting data sent by the sender to the receiver; and how to transmit data stably is the key to the data transmission process.
[0042] In live streaming scenarios, common data transmission methods include: a sending device sending first data, which is data to be sent to a display device; an encoder receiving the first data sent by the sending device and sending the first data to the display device through a media server, so that the display device can display the first data.
[0043] In the event of a software upgrade or a system crash on the media server, the communication link with the encoder will be disconnected, preventing the display device from receiving data sent by the transmitting device and thus interrupting the live streaming service. In this case, the encoder will periodically (e.g., every 10 seconds) attempt to reconnect to the media server until it does.
[0044] However, after the connection between the encoder and the media server is lost, the encoder will periodically attempt to reconnect with the media server. During this reconnection attempt, the display device is unable to obtain the data sent by the sending device through the media server, which causes the live broadcast service of the display device to be interrupted, thus reducing the stability of data transmission.
[0045] Based on this, this application provides a data transmission method applied to an intermediate device belonging to a data transmission system. The data transmission system further includes a sending device, a media server, and a receiving device. The sending device and the intermediate device are connected via a communication connection. The intermediate device is connected to the receiving device through a media server, which includes a first media server and a second media server. The method obtains first data to be sent to the receiving device from the sending device. If the first connection between the intermediate device and the first media server is broken, the intermediate device does not need to attempt to reconnect to the first media server. Instead, the intermediate device first obtains cached data from the first media server. This cached data includes data previously sent by the intermediate device to the receiving device through the first media server. Then, the cached data is sent to the receiving device through the second media server. After sending the cached data to the receiving device, the first data is sent to the receiving device through the second media server. This ensures that the receiving device can continuously receive data sent by the sending device, thus improving the stability of data transmission.
[0046] This application provides a data transmission method, applied to... Figure 1 The data transmission system shown includes: a transmitting device 101, an intermediate device 102, a first media server 103, a second media server 104, and a receiving device 105. The transmitting device 101 and the intermediate device 102 are communicatively connected; the intermediate device 102 is connected to the receiving device 105 through the first media server 103.
[0047] The aforementioned transmitting device 101 is used to transmit first data, which is data to be transmitted to the receiving device 105; wherein, the transmitting device 101 can be a computing device with transmitting function, such as a server or satellite device, for example, the transmitting device 101 can be a central server, an edge server, a local server in a local data center, or a computing device such as an equatorial satellite.
[0048] If the first connection between intermediate device 102 and first media server 103 is not broken:
[0049] The aforementioned intermediate device 102 is used to receive the first data sent by the sending device 101 and send the first data to the receiving device 105 through the first media server 103; wherein, the intermediate device 102 may be a computing device with sending and receiving functions and caching functions, such as an elastic load balancer (ELB) device, a desktop computer, a laptop computer, or a smartphone.
[0050] If the first connection between intermediate device 102 and first media server 103 is broken:
[0051] The aforementioned intermediate device 102 is used to send the first data to the receiving device 105 via the second media server 104.
[0052] It should be noted that the intermediate device 102 mentioned above can have a second connection before the first connection is broken (e.g., Figure 1 (As shown by the dashed line in the diagram), the second connection is the connection between the intermediate device 102 and the receiving device 105 through the second media server 104; alternatively, before the first connection is broken, the intermediate device 102 does not have a second connection with the receiving device 105 through the second media server 104. In this case, after the first connection is broken, the intermediate device 102 establishes the second connection based on the transmission protocol, so that the intermediate device 102 can connect with the receiving device 105 through the second media server 104.
[0053] Optionally, before the intermediate device 102 sends the first data to the receiving device 105 via the second media server 104, the intermediate device 102 is further configured to obtain cached data in the intermediate device 102 and send the cached data to the receiving device 105 via the second media server 104; wherein, the cached data includes: the data that the intermediate device 102 last sent to the receiving device 105 via the first media server 103.
[0054] The aforementioned media server is used to send the first data sent by the intermediate device to the receiving device 105.
[0055] Optionally, the aforementioned media servers (i.e., the first media server 103 and the second media server 104) are specifically used to transcode the first data sent by the intermediate device 102 so that the encoding format of the transcoded first data matches the encoding format supported by the receiving device 105; then, the transcoded first data is sent to the receiving device 105; that is, during the process of the intermediate device 102 sending data through the media server, the media server will transcode the received data sent by the intermediate device 102 and then forward the transcoded data.
[0056] The receiving device 105 is used to receive the first data mentioned above, and to display the first data on the display interface when the business requires the first data to be displayed.
[0057] It should be understood that, in addition to the first media server 103 and the second media server 104, the above-mentioned data transmission system may also include other media servers. Specifically, this application embodiment will be described using the above-mentioned data transmission system including the first media server 103 and the second media server 104 as an example.
[0058] exist Figure 1 Based on the data transmission system shown, such as Figure 2 As shown, the data transmission system further includes a stream processing device 201; wherein one end of the stream processing device 201 is connected to the aforementioned media server (i.e., the first media server 103 and the second media server 104), and the other end of the stream processing device 201 is connected to the receiving device 105.
[0059] If the first connection between intermediate device 102 and first media server 103 is not broken, and intermediate device 102 receives the first data sent by sending device 101:
[0060] The intermediate device 102 is used to send the first data to the first media server 103; and update the cached data in the intermediate device 102 with the first data so that the updated cached data includes the first data.
[0061] The first media server 103 is used to receive first data sent by the intermediate device and send the first data to the streaming processing device 201.
[0062] The stream processing device 201 is used to send the first data to the receiving device 105.
[0063] It should be noted that the streaming processing device 201 can be specifically used to segment the first data after it has been transcoded by the first media server 103 to obtain multiple sub-segments of the first data, and then send the multiple sub-segments of the first data to the receiving device 105 one by one.
[0064] If the first connection between intermediate device 102 and first media server 103 is broken, and intermediate device 102 receives the first data sent by sending device 101:
[0065] Intermediate device 102 is used to send locally stored cached data to streaming device 201 via second media server 104; wherein, the cached data includes: data previously sent by intermediate device 102 to receiving device 105 via first media server 103.
[0066] It should be understood that when intermediate device 102 does not exist, and a connection is established between the second media server 104 and the streaming device 201, intermediate device 102 first creates the connection; then, it sends cached data to the streaming device 201.
[0067] The stream processing device 201 is used to determine the second data that has not been sent to the receiving device 105 from the buffered data, and to send the second data to the receiving device 105.
[0068] After sending the cached data to the streaming processing device 201, the intermediate device 102 sends the first data to the second media server 104 and updates the cached data in the intermediate device 102 with the first data.
[0069] The second media server 104 is used to send the first data sent by the intermediate device 102 to the stream processing device 201.
[0070] After sending the second data to the receiving device 105, the streaming device 201 sends the first data to the receiving device 105.
[0071] exist Figure 1 Or such as Figure 2 Based on the data transmission system shown, such as Figure 3 As shown, the data transmission system also includes an encoding device 301; wherein the transmitting device 101 is connected to the intermediate device 102 through the encoding device 301.
[0072] Encoding device 301 is used to receive first data sent by transmitting device 101 and send the first data to intermediate device 102.
[0073] It should be noted that the encoding device 301 described above can be specifically used to receive the first data sent by the transmitting device 101 and encode the first data so that the format or form of the first data is suitable for the current scenario, for example, converting the first data from binary satellite signals into data in the form of a character stream. Then, the encoding device 301 sends the encoded first data to the intermediate device 102.
[0074] For example, Figure 4 It can be Figure 1 The transmission device 101, intermediate device 102, first media server 103, second media server 104, and receiving device 105 are included. Figure 2 The stream processing device 201 and Figure 3 Any of the encoding devices 301 in the diagram represents a hardware structure of a computing device; the computing device may include: a processor 401, a memory 402, and a communication interface 403. The processor 401, memory 402, and communication interface 403 can be connected via a bus 404 or other means.
[0075] Processor 401 includes one or more CPUs. The CPU can be a single-core CPU or a multi-core CPU. Optionally, processor 401 may also include a graphics processing unit (GPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), etc.
[0076] The processor 401 is used to obtain program instructions stored in memory 402, and according to the program instructions, obtain first data sent by the transmitting device from the communication interface 403, and send the first data to the receiving device through the second media server based on the communication interface 403.
[0077] The memory 402 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical memory, magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer. In this embodiment, the memory 402 may store computer instructions and operating system information.
[0078] In one possible implementation, the memory 402 may exist independently of the processor 401. The memory 402 can be connected to the processor 401 via a bus 404 and is used to store data, instructions, or program code. When the processor 401 calls and executes the instructions or program code stored in the memory 402, it can implement the relevant steps in the data transmission method provided in the embodiments of this application.
[0079] In another possible implementation, the memory 402 can also be integrated with the processor 401.
[0080] Communication interface 403 can be a transceiver module used to communicate with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc. Communication interface 403 can receive commands, messages, or data. The transceiver module can be a transceiver or similar device.
[0081] Optionally, the communication interface 403 can also be a transceiver circuit located within the processor 401, used to implement signal input and signal output of the processor 401, such as acquiring the first data sent by the transmitting device. The communication interface 403 can be a wired interface (port), such as a fiber distributed data interface (FDDI) or a gigabit Ethernet (GE) interface, or the communication interface 403 can also be a wireless interface.
[0082] Bus 404 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. This bus can be divided into address bus, data bus, and control bus. Buses can also be classified as serial buses and parallel buses. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0083] It should be understood that, Figure 4 The computing device mentioned is merely one example of a computing device; it can have more than Figure 4 The more or fewer components shown can be combined into two or more components, or they can have different component configurations. For example, a computing device can also include a smart network card, such as a data processing unit (DPU).
[0084] It should be noted that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0085] The data transmission method provided in this application embodiment is applied to Figure 1 Intermediate devices in the data transmission system shown; such as Figure 5 As shown, the method includes: S110-S140.
[0086] S110, The intermediate device obtains the first data sent by the sending device.
[0087] The first data mentioned above is data sent by the sending device and is to be sent to the receiving device.
[0088] It should be understood that the aforementioned first data may be text data or audio data, and the specific embodiments of this application do not limit the type of the first data.
[0089] S120. If the first connection between the intermediate device and the first media server is broken, the intermediate device obtains the cached data in the intermediate device.
[0090] The aforementioned intermediate device is connected to the receiving device through a first media server. That is, the aforementioned intermediate device is connected to the first media server, and the first media server is connected to the receiving device; wherein, the aforementioned first connection is the connection between the aforementioned intermediate device and the first media server.
[0091] It should be understood that the cause of the first connection being disconnected may be a software upgrade in the first media server, a crash of the first media server, or a network failure between the intermediate device and the first media server; the specific embodiments of this application do not limit the cause of the first connection being disconnected.
[0092] The aforementioned cached data includes the data sent by the intermediate device to the receiving device last time through the first media server. That is, while the first connection is not broken, during the process of the intermediate device sending data to the receiving device through the first media server, the intermediate device will update the aforementioned cached data after sending the data to the first media server, so that the cached data includes the data sent to the first media server; the specific update method is described in S210 below, and will not be repeated here.
[0093] It should be noted that the disconnection of the first connection and the above-mentioned S110 are not limited in terms of order. That is to say, the first data can be obtained before the first connection is disconnected or after the first connection is disconnected. The specific embodiments of this application do not limit it.
[0094] S130, the intermediate device sends the cached data to the receiving device through the second media server.
[0095] It should be noted that, in cases such as Figure 1 In the data transmission system shown, an intermediate device may exist, with a second connection between the receiving device and the second media server; or it may not exist, with a second connection between the receiving device and the second media server. The specific embodiments of this application do not limit this.
[0096] In the presence of the aforementioned intermediate device, and in the case of a second connection between the receiving device and the second media server, the implementation of S130 includes: the intermediate device sending the aforementioned cached data to the second media server, so that the second media server sends (forwards) the cached data to the receiving device.
[0097] In the case where the aforementioned intermediate device is absent, and a second connection is established between the receiving device and the second media server, the implementation of S130 is as follows: Figure 6 As shown, it includes: S131-S132.
[0098] S131. The intermediate device establishes a second connection with the receiving device through a second media server based on the transmission protocol.
[0099] The aforementioned transmission protocols include protocols used for transmitting data, such as Transmission Control Protocol (TCP) or User Datagram Protocol (UDP).
[0100] It should be understood that whether the intermediate device chooses to establish the second connection based on TCP or UDP can be determined based on business requirements. For example, when stable data transmission without data loss is required, the intermediate device establishes the second connection based on TCP; when fast data transmission is required but data integrity is not a high priority, the intermediate device establishes the second connection based on UDP.
[0101] It should be noted that the specific implementation of establishing a second connection based on TCP or UDP can be found in relevant technologies, and will not be elaborated here.
[0102] S132, The intermediate device sends the buffer to the receiving device based on the second connection.
[0103] For example, suppose in a live streaming scenario, if the first connection between the intermediate device and the first media server is broken, the intermediate device establishes a second connection with the receiving device via the second media server. To prevent the first media server from having data that was not sent to the receiving device after the first connection is broken, the intermediate device sends the aforementioned cached data to the receiving device via the second connection. This cached data includes the data that the intermediate device previously sent to the receiving device via the first media server. This ensures that the receiving device can still receive the data that was not sent to the receiving device from the first media server even after the first connection is broken.
[0104] In S132 above, the intermediate device sends the cached data to the receiving device based on the second connection, and the receiving device receives the cached data accordingly.
[0105] It should be noted that the intermediate device can execute S110 first and then S120-S130, or it can execute S120-S130 first and then S110. Specifically, this application embodiment does not limit the execution order of S110 and S120-130.
[0106] After the aforementioned cached data is sent to the receiving device, the intermediate device executes the following S140.
[0107] S140, the intermediate device sends the first data to the receiving device through the second media server.
[0108] The implementation of S140 is similar to that of S130. For a detailed description of S140, please refer to the relevant description of S130 above. It will not be repeated here.
[0109] It should be noted that when the first connection is disconnected, the intermediate device will be triggered to execute S120-S130 once; subsequently, after the intermediate device receives the data to be sent to the receiving device from the sending device, it will directly execute S110 and S140 and will not repeat S120-S130.
[0110] The data transmission method provided in the above embodiments is applied to an intermediate device, which belongs to a data transmission system. This data transmission system further includes a sending device, a media server, and a receiving device. The sending device and the intermediate device have a communication connection, and the intermediate device is connected to the receiving device through a media server. The media server includes a first media server and a second media server. The method includes: acquiring first data to be sent to the receiving device from the sending device; if the first connection between the intermediate device and the first media server is broken, the intermediate device does not need to attempt to reconnect to the first media server; instead, the intermediate device first acquires cached data on it; the cached data includes data previously sent by the intermediate device to the receiving device through the first media server; then, the cached data is sent to the receiving device through the second media server; and after sending the cached data to the receiving device, the first data is sent to the receiving device through the second media server; thus, the receiving device can continuously receive data sent by the sending device, thereby improving the stability of data transmission.
[0111] Furthermore, in the event of the first connection being disconnected, the intermediate device first sends the cached data in the intermediate device to the receiving device through the second media server. Since the cached data includes the data that the intermediate device sent to the receiving device last time through the first media server, it avoids the receiving device being unable to obtain the data that was not sent to the receiving device from the first media server due to the first media server crashing. Therefore, the integrity of data transmission is improved.
[0112] In one implementation, such as Figure 7 As shown above, Figure 5 The data transmission method shown includes, after S140, S210.
[0113] S210, the intermediate device updates the cached data based on the first data; the updated cached data includes the first data.
[0114] The implementation of S210 above includes: the intermediate device obtaining the size of the available storage space in the target storage space used to store the cached data in the intermediate device.
[0115] If the available storage space in the target storage space is greater than or equal to the amount of data in the first data, the intermediate device adds the first data to the cached data.
[0116] For example, suppose the size of the first data is 1 megabyte (MB); the available storage space in the target storage space is 2MB; and suppose the cached data includes: the third data, the fourth data, and the fifth data; then, the intermediate device adds the first data to the buffer data so that the cached data includes the first data in addition to the third data, the fourth data, and the fifth data.
[0117] If the available storage space in the target storage space is less than the amount of data in the first data, the intermediate device deletes the data with the earliest update time from the cache data, and then adds the first data to the cache data; wherein, the update time of a data is the time when the data is updated into the cache data.
[0118] For example, suppose the size of the first data is 1MB; the available storage space in the target storage space is 0.5MB; and suppose the cached data includes: the third data, the fourth data, and the fifth data, where the fifth data is the first of the three data to be updated in the cached data; then, the intermediate device deletes the fifth data from the cached data and adds the first data to the cached data, so that the updated cached data includes: the first data, the third data, and the fourth data.
[0119] In the above embodiment, after the first data is sent to the receiving device through the second media server, the cached data in the intermediate device is updated based on the first data so that the updated cached data includes the first data. This ensures that the cached data always includes the data sent by the intermediate device to the media server last time, thus improving the accuracy of the cached data.
[0120] It should be noted that the above Figure 5 or Figure 7 The data transmission method described above triggers an intermediate device to send cached data to the receiving device after the first connection is broken. However, this cached data may contain data that the first media server has already sent to the receiving device, causing the receiving device to repeatedly receive the same data, thus reducing the accuracy of data transmission. For example, in a live streaming scenario, this could result in repeated playback of the same footage.
[0121] Based on this, embodiments of this application provide a data transmission method, which is applied to... Figure 2 The data transmission system shown; such as Figure 8 As shown, the method includes: S310-S390.
[0122] S310. If the first connection between the intermediate device and the first media server is broken, the intermediate device establishes a second connection.
[0123] It should be noted that the aforementioned second connection is a connection between the intermediate device and the receiving device through the aforementioned second media server and streaming device; specifically, since the streaming device and the receiving device have a communication connection, the process of the intermediate device creating the second connection is the process of creating a connection between the intermediate device and the streaming device through the second media server.
[0124] The implementation of S310 is similar to that of S131. For a detailed description of S310, please refer to the relevant description of S131 above. It will not be repeated here.
[0125] S320, the intermediate device retrieves cached data from the intermediate device.
[0126] It should be noted that the implementation method of S320 is the same as that of S120. For a detailed description of S320, please refer to the relevant description of S120 above. It will not be repeated here.
[0127] S330, the intermediate device will cache the data and send it to the streaming device through the second media server.
[0128] The above-mentioned S330 is implemented as follows: the intermediate device sends the cached data to the second media server, and after receiving the cached data, the second media server sends (i.e. forwards) the cached data to the stream processing device; correspondingly, the stream processing device receives the cached data sent by the intermediate device through the second media server.
[0129] S340, The stream processing device determines the second data that has not been sent to the receiving device from the buffered data.
[0130] The above-mentioned S340 is implemented as follows: the stream processing device obtains locally stored data that has been sent to the receiving device (hereinafter referred to as: historical data); then, the cached data that does not exist in the historical data is used as the above-mentioned second data.
[0131] For example, suppose the above historical data includes data 1 to data 100; and suppose the cached data includes data 90 to data 101; since data 101 is not included in the historical data (data 1 to data 100); the stream processing device uses data 101 as the second data.
[0132] It should be noted that after the stream processing device sends data to the receiving device, it will add the sent data to the historical data so that the historical data includes the sent data. Specifically, in order to save storage resources in the stream processing device, the stream processing device can add the identifier of the sent data (such as a hash value) to the historical data.
[0133] S350, the stream processing device sends the second data to the receiving device.
[0134] The above-mentioned S350 is implemented in such a way that the stream processing device sends the second data to the receiving device through a communication connection with the receiving device; correspondingly, the receiving device receives the second data from the stream processing device.
[0135] S360, The transmitting device sends the first data.
[0136] The first piece of data mentioned above is the data to be sent to the receiving device.
[0137] It should be noted that S360 can be executed before or after any of the steps in S310-S350. Specifically, this application embodiment does not limit the execution order of S360 and S310-S350.
[0138] S370: The intermediate device sends the first data to the second media server and updates the cached data based on the first data.
[0139] The updated cached data includes the first data mentioned above.
[0140] It should be noted that the implementation of S370 is consistent with the implementation of S140 and S210. For a detailed description of S370, please refer to the relevant descriptions of S140 and S210 above. It will not be repeated here.
[0141] S380, the second media server sends the first data to the streaming processing device.
[0142] It should be understood that S370-S380 above is the specific implementation of the intermediate device sending the first data to the stream processing device through the second media server.
[0143] S390, the stream processing device sends the first data to the receiving device.
[0144] In the above S390, the stream processing device sends the first data to the receiving device, and correspondingly, the receiving device receives the first data from the stream processing device.
[0145] In the above embodiments, when the first connection is disconnected, the intermediate device sends the cached data to the streaming device through the second media server. The streaming device determines the second data that has not been sent to the receiving device from the cached data and sends the second data to the receiving device. Instead of sending all the cached data to the receiving device, the problem of the receiving device receiving the same data repeatedly is avoided, thus improving the accuracy of data transmission.
[0146] Furthermore, in the above embodiment, after the first connection is disconnected, the intermediate device sends the cached data in the intermediate device and the first data sent by the sending device to the receiving device through the second media server and the streaming processing device, thereby avoiding the problem that the receiving device cannot obtain the data sent by the sending device, thus improving the stability of data transmission.
[0147] based on Figure 8 The data transmission method shown herein, in the case where the transmitting device is a satellite device, is provided in a specific implementation of this application embodiment. This method is applied to... Figure 3 The data transmission system shown is as follows: Figure 9 As shown, the method includes S410-S420 after S360 and before S370.
[0148] S410. The encoding device receives the first data sent by the transmitting device and encodes the first data to obtain the encoded first data.
[0149] One end of the aforementioned encoding device is connected to the transmitting device, and the other end of the encoding device is connected to the intermediate device; that is, the transmitting device is connected to the intermediate device through the encoding device.
[0150] The implementation of S410 includes: the encoding device receiving first data sent by the transmitting device based on a communication connection with the transmitting device; and then, the encoding device encoding the first data so that the format or form of the encoded first data matches the data format supported by the receiving device.
[0151] For example, when the transmitting device is a satellite device, after receiving the first data transmitted by the satellite device, the encoding device converts the first data from binary satellite signals into data in the form of a character stream.
[0152] S420: The intermediate device obtains the first data after it has been encoded by the encoding device.
[0153] The above-mentioned S420 is implemented as follows: the encoding device sends the encoded first data to the intermediate device, and the intermediate device receives the encoded first data from the encoding device accordingly.
[0154] In the above embodiments, the encoding device is connected to the first media server through an intermediate device. When the first connection between the intermediate device and the first media server is broken, the intermediate device sends the first data obtained from the encoding device to the receiving device through the second media server. Therefore, the problem of the receiving device being unable to obtain the data sent by the sending device is avoided when the connection between the encoding device and the first media server is broken in a direct connection scenario. This is because the encoding device periodically attempts to reconnect with the first media server. Thus, the stability of data transmission is improved.
[0155] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, the data transmission device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0156] This application embodiment can, according to the above method, exemplarily divide the data transmission device into functional modules. For example, the data transmission device may include functional modules corresponding to each functional division, or two or more functions may be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.
[0157] When dividing each function into modules according to its corresponding function. Figure 10 This diagram illustrates a possible structural schematic of the data transmission device involved in the above embodiments; the data transmission device is deployed in... Figure 1 The data transmission system shown. (As shown in the image) Figure 10 As shown, the data transmission device includes an acquisition module 1010 and a transmission module 1020.
[0158] The acquisition module 1010 is used by the intermediate device to acquire the first data sent by the sending device; for example, by executing step S110 in the above method embodiment.
[0159] The acquisition module 1010 is also used to acquire cached data in the intermediate device when the first connection between the intermediate device and the first media server is broken; for example, by performing step S120 in the above method embodiment.
[0160] The sending module 1020 is used to send cached data to the receiving device through a second media server; for example, by performing step S130 in the above method embodiment.
[0161] The sending module 1020 is also configured to send the first data to the receiving device via a second media server after sending the cached data to the receiving device; for example, to perform step S140 in the above method embodiment.
[0162] Optionally, the above data transmission device further includes: a creation module 1030; the creation module 1030 is used to establish a second connection between the intermediate device and the receiving device through the second media server based on the transmission protocol before sending the cached data to the receiving device through the second media server; for example, performing steps S131 or S310 in the above method embodiments.
[0163] Optionally, the data transmission device further includes an update module 1040; the update module 1040 is used to update cached data based on the first data; for example, by performing step S210 or S370 in the above method embodiment.
[0164] Optionally, if the above data transmission system further includes a stream processing device, with one end of the stream processing device connected to a media server and the other end of the stream processing device connected to a receiving device, the sending module 1020 is used to send the cached data to the stream processing device through the second media server; for example, performing step S330 in the above method embodiment.
[0165] Optionally, the above data transmission system further includes an encoding device. When the transmitting device is a satellite device and the transmitting device is connected to an intermediate device through the encoding device, the acquisition module 1010 is used to acquire the first data encoded by the encoding device from the encoding device; for example, by performing step S420 in the above method embodiment.
[0166] The acquisition module 1010, sending module 1020, creation module 1030, and update module 1040 can all be implemented in software or in hardware. For example, the implementation of the acquisition module 1010 will be described below. Similarly, the implementation of the sending module 1020, creation module 1030, and update module 1040 can refer to the implementation of the acquisition module 1010.
[0167] As an example of a software functional unit, module 1010 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Furthermore, the aforementioned computing instance may be one or more. For example, module 1010 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0168] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0169] As an example of a hardware functional unit, the acquisition module 1010 may include at least one computing device, such as a server. Alternatively, the acquisition module 1010 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0170] The multiple computing devices included in the acquisition module 1010 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the acquisition module 1010 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the acquisition module 1010 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0171] It should be noted that, in other embodiments, the acquisition module 1010 can be used to execute any step in the above data transmission method, the sending module 1020 can be used to execute any step in the above data transmission method, the creation module 1030 can be used to execute any step in the above data transmission method, and the update module 1040 can be used to execute any step in the above data transmission method. The steps implemented by the acquisition module 1010, the sending module 1020, the creation module 1030, and the update module 1040 can be specified as needed. By implementing different steps in the above data transmission method through the acquisition module 1010, the sending module 1020, the creation module 1030, and the update module 1040, all functions of the management device can be realized.
[0172] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0173] like Figure 11As shown, the computing device cluster includes at least one computing device 100. The memory 106 of one or more computing devices 100 in the computing device cluster may store the same instructions for performing the data transfer method described above.
[0174] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the aforementioned data transfer method. In other words, a combination of one or more computing devices 100 can jointly execute the instructions for executing the aforementioned data transfer method.
[0175] It should be noted that the memory 106 in different computing devices 100 within the computing device cluster can store different instructions, each used to execute a portion of the management device's functions. That is, the instructions stored in the memory 106 of different computing devices 100 can implement the functions of one or more modules among the acquisition module 1010, the sending module 1020, the creation module 1030, and the update module 1040.
[0176] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 12 One possible implementation is shown. For example... Figure 12 As shown, two computing devices 100A and 100B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this possible implementation, the memory 106 in computing device 100A stores instructions for executing the functions of the acquisition module 1010 and the transmission module 1020. Simultaneously, the memory 106 in computing device 100B stores instructions for executing the functions of the creation module 1030 and the update module 1040.
[0177] Figure 12 The connection method between the computing device clusters shown can be such that, considering the data transmission method provided in this application requires frequent data acquisition and transmission, the functions implemented by the acquisition module 1010 and the transmission module 1020 are delegated to the computing device 100A for execution.
[0178] It should be understood that Figure 12 The functions of the computing device 100A shown can also be performed by multiple computing devices 100. Similarly, the functions of the computing device 100B can also be performed by multiple computing devices 100.
[0179] This application also provides another computing device cluster. The connection relationships between the computing devices in this computing device cluster can be similarly referred to... Figure 11 and Figure 12The connection method of the computing device cluster. The difference is that the memory 106 of one or more computing devices 100 in the computing device cluster can store the same instructions for executing data transmission methods.
[0180] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the data transfer method. In other words, a combination of one or more computing devices 100 can jointly execute the instructions for executing the data transfer method.
[0181] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to perform a data transmission method.
[0182] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform a data transmission method.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data transmission method, characterized in that, The method is applied to an intermediate device belonging to a data transmission system, which further includes a sending device, multiple media servers, and a receiving device; wherein the sending device has a communication connection with the intermediate device, the intermediate device is connected to the receiving device through the media servers, and the multiple media servers include a first media server and a second media server; the method includes: Acquire the first data sent by the sending device; the first data is data to be sent to the receiving device. If the first connection between the intermediate device and the first media server is broken, cached data in the intermediate device is retrieved; the cached data includes: the data that the intermediate device last sent to the receiving device through the first media server. The cached data is sent to the receiving device via the second media server; After the cached data is sent to the receiving device, the first data is sent to the receiving device through the second media server.
2. The method according to claim 1, characterized in that, Before sending the cached data to the receiving device via the second media server, the method further includes: Based on the transmission protocol, a second connection is established between the intermediate device and the receiving device through the second media server; the transmission protocol includes TCP or UDP.
3. The method according to claim 1 or 2, characterized in that, In the process of sending the first data to the receiving device via the second media server, after sending the first data to the second media server, the method further includes: Based on the first data, the cached data is updated; the updated cached data includes the first data.
4. The method according to any one of claims 1-3, characterized in that, The data transmission system further includes a stream processing device; one end of the stream processing device is connected to the media server, and the other end of the stream processing device is connected to the receiving device. Sending the cached data to the receiving device via the second media server includes: The cached data is sent to the streaming device via the second media server, so that the streaming device can determine the second data that has not been sent to the receiving device from the cached data, and send the second data to the receiving device.
5. The method according to any one of claims 1-4, characterized in that, The data transmission system further includes an encoding device, and when the transmitting device is a satellite device, the transmitting device is connected to the intermediate device through the encoding device; The step of acquiring the first data sent by the sending device includes: First data obtained from the encoding device after being encoded by the encoding device; The encoded first data is in a format that matches the data format supported by the receiving device.
6. A data transmission device, characterized in that, The data transmission device is deployed on an intermediate device, which belongs to a data transmission system. The data transmission system further includes a sending device, multiple media servers, and a receiving device. The sending device has a communication connection with the intermediate device, and the intermediate device is connected to the receiving device through the media servers. The multiple media servers include a first media server and a second media server. If the first connection between the intermediate device and the first media server is disconnected, the data transmission device includes an acquisition unit and a sending unit. The acquisition unit is used to acquire first data sent by the sending device; the first data is data to be sent to the receiving device; The acquisition unit is further configured to acquire cached data in the intermediate device when the first connection between the intermediate device and the first media server is disconnected; the cached data includes: the data last sent by the intermediate device to the receiving device through the first media server; The sending unit is used to send the cached data to the receiving device through the second media server; The sending unit is further configured to send the first data to the receiving device via the second media server after sending the cached data to the receiving device.
7. The data transmission device according to claim 6, characterized in that, The data transmission device further includes: a creation unit; The creation unit is configured to establish a second connection between the intermediate device and the receiving device via the second media server, based on a transmission protocol, before the cached data is sent to the receiving device via the second media server; the transmission protocol includes TCP or UDP.
8. The data transmission apparatus according to claim 6 or 7, characterized in that, The data transmission device further includes: an update unit; The update unit updates the cached data based on the first data; the updated cached data includes the first data.
9. The data transmission apparatus according to any one of claims 6-8, characterized in that, The sending unit is specifically used to send the cached data to the streaming device through the second media server, so that the streaming device can determine the second data that has not been sent to the receiving device from the cached data, and send the second data to the receiving device.
10. The data transmission apparatus according to any one of claims 6-9, characterized in that, The acquisition unit is specifically used to acquire first data encoded by the encoding device from the encoding device; the data format of the encoded first data matches the data format supported by the receiving device.
11. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that, The device stores computer instructions that, when executed on a computing device, cause the computing device to perform the method as described in any one of claims 1 to 5.
13. A computer program product containing instructions, characterized in that, When the instruction is executed by the computing device cluster, the computing device cluster performs the method as described in any one of claims 1 to 5.