Data output method and data receiving method
By encoding and storing multimedia data, and using the target data transmission protocol to generate and output data packets, the problem of high latency in multimedia data output is solved, achieving more efficient data output.
Patent Information
- Application Number
- CN202411389734.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Existing technologies have high latency in multimedia data output, resulting in low output efficiency.
Multimedia data is encoded into encoded data frames and stored in a storage area. Data packets are generated using the target data transmission protocol, and multiple encoded data frames are read and output simultaneously. A data transmission protocol adapted to the communication quality is used for transmission.
It reduces data transmission latency and improves the output efficiency of multimedia data.
Smart Images

Figure CN119276425B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data output method and a data receiving method. Background Technology
[0002] Multimedia data includes media data in the form of text, graphics, images, sound, animation, moving images, etc., and can also be composite data formed by some or all of the above-mentioned media data, with interrelated content. Multimedia data can be output to a receiving device, which can then store or output the multimedia data, such as playing audio or outputting images. Currently, the high latency in the multimedia data output process results in low output efficiency. Summary of the Invention
[0003] This application provides a data output method, including: obtaining multimedia data to be output; encoding the multimedia data to be output according to a target encoding protocol to obtain an encoded data frame; storing information related to the encoded data frame in a first storage area; reading the encoded data frame based on the information related to the encoded data frame stored in the first storage area, wherein multiple encoded data frames can be read simultaneously; generating a data packet corresponding to the encoded data frame based on a target data transmission protocol; and outputting the data packet based on a communication link corresponding to the target data transmission protocol.
[0004] In some embodiments, the number of encoded data frames read simultaneously is equal to the number of data packets output simultaneously by the communication link corresponding to the target data transmission protocol.
[0005] In some embodiments, storing information related to the encoded data frame in a first storage area includes: storing the encoded data frame in the first storage area; or storing pointer data for pointing to the encoded data frame in the first storage area.
[0006] In some embodiments, after storing the encoded data frame related information in a first storage area, the method further includes: determining the current position of the encoded data frame related information in the first storage area; if the current position is not the end position of the first storage area, setting a write pointer to the next position corresponding to the current position, the write pointer being used to point to the position in the first storage area for writing the next encoded data frame related information; and if the current position is the end position of the first storage area, setting the write pointer to the start position in the first storage area.
[0007] In some embodiments, before obtaining the multimedia data to be output, the method further includes: obtaining communication quality parameters output by the receiving device through the current communication link; if the communication quality parameters meet the target conditions, determining a first data transmission protocol corresponding to the current communication link as the target data transmission protocol, wherein the first data transmission protocol includes a handshake mechanism; if the communication quality parameters do not meet the target conditions, determining a second data transmission protocol as the target data transmission protocol, wherein the second data transmission protocol does not include a handshake mechanism.
[0008] In some embodiments, in response to the second data transmission protocol being the target data transmission protocol, the method further includes: storing the number information of the data packet; and in response to not receiving confirmation information from the receiving device within a preset time period for outputting the current data packet, outputting the current data packet corresponding to the number information based on the communication link corresponding to the second data transmission protocol, according to the number information of the current data packet.
[0009] This application also proposes a data receiving method, including: obtaining a data packet output by an output device based on a communication link corresponding to a target data transmission protocol; storing the data packet in a second storage area; reading the data packet stored in the second storage area, wherein the number of data packets that can be read simultaneously is multiple; and decoding the encoded data frame corresponding to the data packet based on a target decoding protocol to obtain multimedia data corresponding to the data packet.
[0010] In some embodiments, the number of data packets that can be read simultaneously and the number of encoded data frames that can be decoded simultaneously satisfy the same condition.
[0011] In some embodiments, after obtaining the data packet output by the output device based on the communication link corresponding to the target data transmission protocol, the method further includes: if the second data transmission protocol is the target data transmission protocol, outputting confirmation information to the output device based on the communication link corresponding to the target data transmission protocol, wherein the second data transmission protocol does not include a handshake mechanism, and the confirmation information corresponds to the number information of the data packet.
[0012] In some embodiments, the method further includes: obtaining communication quality parameters of the communication link corresponding to the target data transmission protocol; and outputting the communication quality parameters to the output device based on the communication link corresponding to the target data transmission protocol. Attached Figure Description
[0013] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 The flow chart of the data output method in this application embodiment Figure 1 ;
[0015] Figure 2 The flow chart of the data output method in this application embodiment Figure 2 ;
[0016] Figure 3 The flow chart of the data output method in this application embodiment Figure 3 ;
[0017] Figure 4 The flow chart of the data output method in this application embodiment Figure 4 ;
[0018] Figure 5 The flow of the data receiving method in the embodiments of this application Figure 1 ;
[0019] Figure 6 The flow of the data receiving method in the embodiments of this application Figure 2 ;
[0020] Figure 7 The flow of the data receiving method in the embodiments of this application Figure 3 . Detailed Implementation
[0021] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0022] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.
[0023] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0024] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0025] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.
[0026] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0027] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.
[0028] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0029] An embodiment of this application provides a data output method that stores information related to the encoded data frame corresponding to the multimedia data to be output in a first storage area, reads the encoded data frame based on the information related to the encoded data frame, and outputs the data packet corresponding to the encoded data frame based on the communication link corresponding to the target data transmission protocol. Since multiple encoded data frames can be read simultaneously, more efficient reading of encoded data frames is achieved, data transmission latency is reduced, and thus the output efficiency of multimedia data is improved.
[0030] like Figure 1 As shown, this data output method includes the following steps:
[0031] Step S101: Obtain the multimedia data to be output.
[0032] In this embodiment, the executing entity is an output device, which can be, for example, a personal computer, a television, or a laptop. The output device can output the multimedia data to be output to a receiving device, enabling the receiving device to play the multimedia data. The receiving device can be, for example, a monitor, a projector, or a television. The multimedia data to be output can be locally stored multimedia data or multimedia data received from the Internet or other servers.
[0033] Step S102: Encode the multimedia data to be output according to the target encoding protocol to obtain an encoded data frame.
[0034] After obtaining the multimedia data to be output, the multimedia data to be output is encoded according to the target encoding protocol to obtain encoded data frames. This can remove redundant information in the spatial and temporal dimensions of the multimedia data, reduce the amount of multimedia data, and thus improve the data transmission efficiency.
[0035] Optionally, the target encoding protocol includes any one of the following protocols: MPEG1, MPEG2, H.261, H.263, H.264, H.265, AVC, AVS, HEVC, etc.
[0036] Step S103: Store the information related to the encoded data frame in the first storage area.
[0037] In this embodiment, a first storage area is pre-defined. This first storage area can be located in a first memory region and can store information related to multiple encoded data frames. After obtaining an encoded data frame, the information related to the encoded data frame is written into the first storage area.
[0038] Optionally, the first storage area may be a circular buffer, or other types of buffers besides a circular buffer, such as a linked list, a queue, etc.
[0039] In some embodiments, before storing the encoded data frame related information in the first storage area, it is first determined whether the free storage capacity of the first storage area has reached the target capacity. If the free storage capacity of the first storage area has reached the target capacity, the encoded data frame related information is stored in the first storage area. The target capacity can be the amount of data corresponding to at least one encoded data frame related information, thereby ensuring reliable storage of the encoded data frame related information.
[0040] Step S104: Read the encoded data frame based on the information related to the encoded data frame stored in the first storage area, wherein the number of encoded data frames that can be read simultaneously is multiple.
[0041] The information related to the encoded data frame is associated with the encoded data frame. The encoded data frame is read using the information related to the encoded data frame stored in the first storage area. When reading the encoded data frame, multiple encoded data frames are read at the same time, thereby improving the data reading efficiency.
[0042] Step S105: Generate a data packet corresponding to the encoded data frame based on the target data transmission protocol.
[0043] To reliably output encoded data frames, the encoded data frames are encapsulated based on the target data transmission protocol to obtain data packets. These data packets consist of a header and a body. The header may include a version number, header length, service type, total length, fragment offset, source address, and destination address, while the body contains the encoded data frames.
[0044] Step S106: Output the data packet based on the communication link corresponding to the target data transmission protocol.
[0045] A pre-established communication link exists between the receiver and the target data transmission protocol, and data packets are output based on this communication link.
[0046] Optionally, the communication link can adopt wireless communication methods including 5GHz WiFi, millimeter wave, 2.4GHz wireless, etc.
[0047] The data output method of this application embodiment obtains multimedia data to be output; encodes the multimedia data to be output according to a target encoding protocol to obtain encoded data frames; stores relevant information of the encoded data frames in a first storage area; reads the encoded data frames based on the relevant information of the encoded data frames stored in the first storage area, wherein multiple encoded data frames can be read simultaneously; generates data packets corresponding to the encoded data frames based on a target data transmission protocol; and outputs data packets based on the communication link corresponding to the target data transmission protocol. Because multiple encoded data frames can be read simultaneously, more efficient reading of encoded data frames is achieved, reducing data transmission latency and thus improving the output efficiency of multimedia data.
[0048] In some embodiments of this application, the data output method includes: the number of encoded data frames read simultaneously satisfies the same condition as the number of data packets simultaneously output based on the communication link corresponding to the target data transmission protocol.
[0049] In this embodiment, satisfying the same condition indicates that the number of encoded data frames read simultaneously is equal to the number of data packets simultaneously output by the communication link corresponding to the target data transmission protocol. Satisfying the same condition also indicates that the number of data packets simultaneously output by the communication link corresponding to the target data transmission protocol is also multiple, but the number of encoded data frames read simultaneously is not equal to the number of data packets simultaneously output by the communication link corresponding to the target data transmission protocol. For example, if the number of encoded data frames read simultaneously is 5, then the number of data packets simultaneously output by the communication link corresponding to the target data transmission protocol can be 5. In some cases, due to changes in the communication quality of the communication link, the number of data packets simultaneously output by the communication link corresponding to the target data transmission protocol can also be 4.
[0050] Since multiple data packets are output simultaneously based on the communication link corresponding to the target data transmission protocol, the output latency of the data packets is reduced, further improving the output efficiency of multimedia data.
[0051] In some embodiments of this application, storing the encoded data frame-related information in a first storage area includes:
[0052] The encoded data frame is stored in the first storage area; or...
[0053] The pointer data used to point to the encoded data frame is stored in the first storage area.
[0054] In this embodiment, encoded data frames can be stored in a first storage area, and multiple encoded data frames can be read simultaneously from the first storage area. Alternatively, pointer data pointing to encoded data frames can be stored in the first storage area. This pointer data represents the storage location of the encoded data frames, and multiple encoded data frames can be read simultaneously from corresponding storage locations using multiple pointer data. These corresponding storage locations can be storage locations in the first memory that are different from the first storage area, thereby achieving more flexible storage of encoded data frame-related information.
[0055] Since the storage capacity required to store encoded data frames and pointer data is different, the storage capacity of the first storage area can be flexibly set based on whether encoded data frames or pointer data are being stored.
[0056] In some embodiments of this application, after storing the encoded data frame-related information in the first storage area, such as Figure 2 As shown, it also includes the following steps:
[0057] Step S107: Determine the current location of the encoded data frame related information in the first storage area, and then execute step S108 or step S109.
[0058] In this embodiment, the first storage area includes multiple locations for storing information related to encoded data frames. Each location corresponds to one encoded data frame, and each location includes a start position and an end position. The storage capacity of the first storage area can be determined by the start and end positions. After storing the information related to the encoded data frame in the first storage area, the current position of the information related to the encoded data frame in the first storage area is determined, and then it is determined whether the current position is the end position of the first storage area.
[0059] Step S108: If the current position is not the end position of the first storage area, the write pointer is set to point to the next position corresponding to the current position. The write pointer is used to point to the position in the first storage area where the information related to the next encoded data frame is written.
[0060] If the current position is not the end position of the first storage area, the write pointer is made to point to the next position corresponding to the current position, thereby determining the next position corresponding to the current position as the write position of the information related to the next encoded data frame.
[0061] Step S109: If the current position is the end position of the first storage area, make the write pointer point to the start position in the first storage area.
[0062] In this embodiment, if the previous position is the end position of the first storage area, the write pointer is made to point to the start position in the first storage area, thereby determining the start position as the write position of the next encoded data frame information, and realizing the recycling of the first storage space.
[0063] In some embodiments of this application, before obtaining the multimedia data to be output, such as Figure 3 As shown, it also includes the following steps:
[0064] Step S110: Obtain the communication quality parameters output by the receiving device through the current communication link, and then execute step S111 or step S112.
[0065] In this embodiment, a communication link corresponding to the first data transmission protocol is pre-established with the receiving device. The receiving device can detect the communication quality parameters of the current communication link and output them through the current communication link. After obtaining the communication quality parameters from the receiving device, it determines whether the communication quality parameters meet the target conditions.
[0066] Step S111: If the communication quality parameters meet the target conditions, the first data transmission protocol corresponding to the current communication link is determined as the target data transmission protocol, and the first data transmission protocol includes a handshake mechanism.
[0067] If the communication quality parameters meet the target conditions, it indicates that the communication quality is good. Then, the first data transmission protocol corresponding to the current communication link is determined as the target data transmission protocol, and data packets are subsequently generated and output based on the first data transmission protocol.
[0068] Step S112: If the communication quality parameters do not meet the target conditions, the second data transmission protocol is determined as the target data transmission protocol, wherein the second data transmission protocol does not include a handshake mechanism.
[0069] If the communication quality parameters do not meet the target conditions, it indicates that the communication quality is poor. In this case, the second data transmission protocol is determined as the target data transmission protocol, and data packets are subsequently generated and output based on the communication link corresponding to the second data transmission protocol.
[0070] The first data transmission protocol includes a handshake mechanism to ensure the reliability of data packet transmission, while the second data transmission protocol does not include a handshake mechanism, which can improve the transmission efficiency of data packets. Since the corresponding data transmission protocol can be used as the target data transmission protocol according to different communication quality parameters, more flexible output of multimedia data can be achieved.
[0071] Optionally, communication quality parameters include at least one of network latency, packet loss rate, and bandwidth utilization. Whether the communication quality parameters meet the target conditions can be determined by comparing them with corresponding thresholds, or by inputting the communication quality parameters into a trained classification model and determining whether the communication quality parameters meet the target conditions based on the classification results output by the model.
[0072] In the specific application scenario of this application, the first data transmission protocol can be TCP, and the second data transmission protocol can be UDP.
[0073] In some embodiments of this application, as an alternative, the method further includes:
[0074] Obtain the communication quality parameters output by the receiving device through the current communication link;
[0075] If the communication quality parameters meet the target conditions, the second data transmission protocol corresponding to the current communication link is determined as the target data transmission protocol;
[0076] If the communication quality parameters do not meet the target conditions, a handshake operation is performed with the receiving device based on the first data transmission protocol, and the first data transmission protocol is determined as the target data transmission protocol.
[0077] In this embodiment, a communication link corresponding to the second data transmission protocol is pre-established with the receiving device. The receiving device can detect the communication quality parameters of the current communication link and output them through the current communication link. After obtaining the communication quality parameters from the receiving device, it is determined whether the communication quality parameters meet the target conditions. If the communication quality parameters meet the target conditions, it indicates that the communication quality is good. In this case, the second data transmission protocol corresponding to the current communication link is determined as the target data transmission protocol, and data packets are subsequently generated and output based on the second data transmission protocol. If the communication quality parameters do not meet the target conditions, it indicates that the communication quality is poor. In this case, a handshake operation is performed with the receiving device based on the first data transmission protocol, and the first data transmission protocol is determined as the target data transmission protocol. Subsequently, data packets are generated and output based on the communication link corresponding to the first data transmission protocol.
[0078] The first data transmission protocol includes a handshake mechanism to ensure the reliability of data packet transmission, while the second data transmission protocol does not include a handshake mechanism, which can improve the transmission efficiency of data packets. Since the corresponding data transmission protocol can be used as the target data transmission protocol according to different communication quality parameters, more flexible output of multimedia data can be achieved.
[0079] In some embodiments of this application, in response to the second data transmission protocol being the target data transmission protocol, such as... Figure 4As shown, the method further includes the following steps:
[0080] Step S113: Store the number information of the data packet.
[0081] In this embodiment, each data packet corresponds to a number, and different data packets correspond to different numbering information. In response to the second data transmission protocol being the target data transmission protocol, the numbering information of the data packet is stored after the data packet is generated.
[0082] Step S114: In response to not receiving confirmation information from the receiving device within a preset time period for outputting the current data packet, the current data packet corresponding to the number information is output based on the communication link corresponding to the second data transmission protocol according to the number information of the current data packet.
[0083] In this embodiment, if no acknowledgment information is received from the receiving device within a preset time period for outputting the current data packet, it indicates packet loss, meaning the receiving device has not received the current data packet and needs to retransmit it. A correspondence table representing the relationship between different numbering information and different data packets can be pre-established. The current data packet is retrieved from the correspondence table based on its numbering information, and then output based on the communication link corresponding to the second data transmission protocol. This allows the data packet to be retransmitted when the receiving device has not received it, improving the reliability of data transmission.
[0084] It should be noted that storing this number information and using it to output the current data packet are processes outside the second data transmission protocol. The second data transmission protocol does not involve any processing mechanism related to this number information.
[0085] To ensure the receiving device obtains the identification number upon receiving a data packet, this number can be included in the packet header. Optionally, the receiving device can output an acknowledgment message including the identification number after receiving the data packet. Alternatively, the identification number information corresponding to all data packets can be pre-output to the receiving device. Upon receiving a data packet, the receiving device compares the identification number obtained from the data packet with the identification number information corresponding to the next data packet to be received, stored locally. If they match, an acknowledgment message excluding the identification number is output; otherwise, no acknowledgment message is output.
[0086] In some embodiments of this application, after outputting the current data packet corresponding to the number information based on the communication link corresponding to the second data transmission protocol according to the number information of the current data packet, the method further includes recording the number of times the current data packet is output, and stopping the current data packet from being output when the number of outputs reaches a target number, thereby avoiding the unlimited output of the same data packet.
[0087] This application also proposes a data receiving method, which stores data packets output from an output device in a second storage area, reads data packets stored in the second storage area, and decodes the encoded data frames corresponding to the data packets based on a target decoding protocol to obtain multimedia data corresponding to the data packets. Since multiple data packets can be read simultaneously, the method achieves more efficient reading of received data packets, reduces data transmission latency, and thus improves the efficiency of multimedia data reception.
[0088] like Figure 5 As shown, the data receiving method includes the following steps:
[0089] Step S201: Obtain the data packet output by the output device based on the communication link corresponding to the target data transmission protocol.
[0090] In this embodiment, the executing entity is the receiving device, and the output device can output the multimedia data to be output to the receiving device, enabling the receiving device to play the multimedia data. The output device can be, for example, a personal computer, a television, or a laptop, while the receiving device can be, for example, a monitor, a projector, or a television. The data packets output by the output device are received through the communication link corresponding to the target data transmission protocol. These data packets are generated by encapsulating the multimedia data to be output using the target data transmission protocol. The data packets consist of a header and a body. The header may include a version number, header length, service type, total length, fragment offset, source address, and destination address, etc., and the body includes encoded data frames.
[0091] Step S202: Store the data packet in the second storage area.
[0092] In this embodiment, a second storage area is pre-configured. This second storage area can be located in a second memory and can store multiple data packets. After a data packet is obtained, it is written into the second storage area.
[0093] In some embodiments of this application, the second storage area includes a first sub-region and a second sub-region. The first sub-region is used to store index information of data packets, which can be determined based on the packet header. The second sub-region is used to store the data packets themselves. By setting the second storage area as both the first and second sub-regions, efficient storage of data packets is achieved, and multiple data packets can be efficiently read from the second sub-region subsequently using the index information in the first sub-region.
[0094] Optionally, the second storage area may be a circular buffer or a buffer of other types besides a circular buffer.
[0095] Step S203: Read the data packet stored in the second storage area, wherein the number of data packets that can be read simultaneously is multiple.
[0096] Data packets stored in the second storage area are read. During the reading process, multiple data packets are read simultaneously, thereby improving the efficiency of data packet reading.
[0097] Step S204: Decode the encoded data frame corresponding to the data packet based on the target decoding protocol to obtain the multimedia data corresponding to the data packet.
[0098] Since data packets correspond to encoded data frames, these frames need to be decoded to obtain the corresponding multimedia data. The target decoding protocol is used to decode the encoded data frames corresponding to the data packets to obtain the multimedia data. This multimedia data can then be played using playback components (such as a screen or speakers).
[0099] Optionally, the target decoding protocol includes any one of the following protocols: MPEG1, MPEG2, H.261, H.263, H.264, H.265, AVC, AVS, HEVC, etc.
[0100] The data receiving method of this application embodiment obtains data packets output by an output device based on a communication link corresponding to a target data transmission protocol; stores the data packets in a second storage area; reads the data packets stored in the second storage area, wherein multiple data packets can be read simultaneously; and decodes the encoded data frames corresponding to the data packets based on a target decoding protocol to obtain multimedia data corresponding to the data packets. Because multiple data packets can be read simultaneously, more efficient reading of received data packets is achieved, reducing data transmission latency and thus improving the efficiency of multimedia data reception.
[0101] In some embodiments of this application, the data receiving method includes: the number of data packets that can be read simultaneously and the number of encoded data frames that can be decoded simultaneously satisfy the same condition.
[0102] In this embodiment, satisfying the same condition can indicate that the number of data packets that can be read simultaneously and the number of encoded data frames that can be decoded simultaneously are equal. Satisfying the same condition can also indicate that the number of encoded data frames that can be decoded simultaneously is also multiple, but the number of data packets that can be read simultaneously and the number of encoded data frames that can be decoded simultaneously are not equal. For example, if the number of data packets that can be read simultaneously is 5, then the number of encoded data frames that can be decoded simultaneously can be 5. In some cases, because the data packet reading speed may vary, the number of encoded data frames that can be decoded simultaneously may also be 4.
[0103] Since multiple encoded data frames can be decoded simultaneously, decoding efficiency is improved, further enhancing the reception efficiency of multimedia data.
[0104] In some embodiments of this application, after storing the data packet in the second storage area, the method further includes: determining the current position of the data packet in the second storage area; if the current position is not the end position of the second storage area, causing the data packet write pointer to point to the next position corresponding to the current position, the data packet write pointer being used to point to the position in the second storage area for writing the next data packet; if the current position is the end position of the second storage area, causing the data packet write pointer to point to the start position in the second storage area.
[0105] In this embodiment, the second storage area includes multiple locations for storing data packets, each location corresponding to one data packet. Each location includes a start position and an end position, and the storage capacity of the second storage area can be determined by the start and end positions. After storing the data packet in the second storage area, the current position of the data packet in the second storage area is determined, and then it is determined whether the current position is the end position of the second storage area.
[0106] If the current position is not the end position of the second storage area, the data packet write pointer is set to the next position corresponding to the current position, thus determining the next position as the write position for the next data packet. If the current position is the end position of the second storage area, the data packet write pointer is set to the beginning position of the second storage area, thus determining the beginning position as the write position for the next data packet, thereby achieving cyclical use of the second storage space.
[0107] In some embodiments of this application, after obtaining the data packets output by the output device based on the communication link corresponding to the target data transmission protocol, such as Figure 6 As shown, it also includes the following steps:
[0108] Step S205: If the second data transmission protocol is the target data transmission protocol, an acknowledgment message is output to the output device based on the communication link corresponding to the target data transmission protocol. The second data transmission protocol does not include a handshake mechanism, and the acknowledgment message corresponds to the number information of the data packet.
[0109] In this embodiment, each data packet corresponds to a unique identifier, and different data packets have different identifiers. The target data transmission protocol can be a first data transmission protocol including a handshake mechanism, or a second data transmission protocol not including a handshake mechanism. When the second data transmission protocol is the target data transmission protocol, after receiving the data packet output by the output device based on the communication link corresponding to the target data transmission protocol, an acknowledgment message is output to the output device. This allows the output device to determine that the receiving device has received the corresponding data packet based on the acknowledgment message, thereby improving data transmission reliability.
[0110] In the specific application scenario of this application, the first data transmission protocol can be TCP, and the second data transmission protocol can be UDP.
[0111] In some embodiments of this application, such as Figure 7 As shown, it also includes the following steps:
[0112] Step S206: Obtain the communication quality parameters of the communication link corresponding to the target data transmission protocol.
[0113] In this embodiment, test data can be transmitted through the communication link corresponding to the target data transmission protocol, and communication quality parameters can be determined based on the transmission process data of the test data. Optionally, the communication quality parameters include at least one of network latency, packet loss rate, and bandwidth utilization.
[0114] Step S207: Based on the communication link corresponding to the target data transmission protocol, output the communication quality parameters to the output device.
[0115] In this embodiment, communication quality parameters are output to the output device based on the communication link corresponding to the target data transmission protocol, so that the output device can determine the target data transmission protocol according to the communication quality parameters.
[0116] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates 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), etc.
[0117] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.
Claims
1. A data output method, comprising: Obtain the multimedia data to be output; The multimedia data to be output is encoded according to the target encoding protocol to obtain encoded data frames; The information related to the encoded data frame is stored in the first storage area; The encoded data frame is read based on the information related to the encoded data frame stored in the first storage area, wherein the number of encoded data frames that can be read simultaneously is multiple; Generate a data packet corresponding to the encoded data frame based on the target data transmission protocol; The data packet is output based on the communication link corresponding to the target data transmission protocol.
2. The data output method as described in claim 1, comprising: The number of encoded data frames read simultaneously satisfies the same condition as the number of data packets simultaneously output by the communication link corresponding to the target data transmission protocol.
3. The data output method as described in claim 1, wherein storing the encoded data frame related information in a first storage area includes: The encoded data frame is stored in the first storage area; or, The pointer data used to point to the encoded data frame is stored in the first storage area.
4. The data output method as described in claim 1, further comprising, after storing the encoded data frame related information in the first storage area: Determine the current location of the encoded data frame information in the first storage area; If the current position is not the end position of the first storage area, the write pointer is made to point to the next position corresponding to the current position. The write pointer is used to point to the position in the first storage area for writing the information related to the next encoded data frame. If the current position is the end position of the first storage area, the write pointer is made to point to the start position of the first storage area.
5. The data output method as described in claim 1, further comprising, before obtaining the multimedia data to be output: Obtain the communication quality parameters output by the receiving device through the current communication link; If the communication quality parameters meet the target conditions, the first data transmission protocol corresponding to the current communication link is determined as the target data transmission protocol, and the first data transmission protocol includes a handshake mechanism; If the communication quality parameters do not meet the target conditions, the second data transmission protocol will be determined as the target data transmission protocol, wherein the second data transmission protocol does not include a handshake mechanism.
6. The data output method of claim 5, wherein in response to the second data transmission protocol being the target data transmission protocol, the method further comprises: Store the numbering information of the data packets; In response to the failure to receive confirmation information from the receiving device within a preset time period for outputting the current data packet, the current data packet corresponding to the number information is output based on the communication link corresponding to the second data transmission protocol, according to the number information of the current data packet.
7. A data receiving method, comprising: Obtain the data packets output by the output device based on the communication link corresponding to the target data transmission protocol; The data packet is stored in the second storage area; Read the data packets stored in the second storage area, wherein the number of data packets that can be read simultaneously is multiple; The encoded data frame corresponding to the data packet is decoded based on the target decoding protocol to obtain the multimedia data corresponding to the data packet.
8. The data receiving method as described in claim 7, comprising: The number of data packets that can be read simultaneously and the number of encoded data frames that can be decoded simultaneously satisfy the same condition.
9. The data receiving method as described in claim 7, further comprising, after obtaining the data packet output by the output device based on the communication link corresponding to the target data transmission protocol: When the second data transmission protocol is the target data transmission protocol, an acknowledgment message is output to the output device based on the communication link corresponding to the target data transmission protocol. The second data transmission protocol does not include a handshake mechanism, and the acknowledgment message corresponds to the number information of the data packet.
10. The data receiving method as described in claim 7, further comprising: Obtain the communication quality parameters of the communication link corresponding to the target data transmission protocol; Based on the communication link corresponding to the target data transmission protocol, the communication quality parameters are output to the output device.
Citation Information
Patent Citations
Multimedia data transmission method, multimedia collection device and server
CN109151494A
Data transfer scheme, frame synchronization device and data transfer method
US20100066907A1