Data transmission method, device, equipment and medium based on Miracast
By dynamically adjusting the data transmission parameters in Miracast, the problem of unstable data transmission in Miracast is solved according to the ordering and transmission of data packets, and the transmission effect and stability are improved.
Patent Information
- Application Number
- CN202211652630.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-12-21
AI Technical Summary
The existing Miracast data transmission is likely to cause data retransmission and disorderly order in the case of complex environments and weak signals, resulting in problems such as disconnection and screen disconnection, and the transmission effect is unstable.
The received multi-frame data packets determine whether the data transmission sort is correct. If it is correct, the data transmission parameter value will be increased; if it is incorrect, the retransmission rate and out-of-order rate will be calculated. If it is exceeded, the data transmission parameter value will be lowered. Dynamically adjust the transmission parameters.
It effectively solves the unstable problem of data transmission in Miracast screen projection applications, improves the stability and effect of data transmission, and avoids disconnection and screen loss.
Smart Images

Figure CN115987456B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a data transmission method, device, terminal equipment and storage medium based on Miracast. Background Art
[0002] Nowadays, mobile phones and large-screen monitors on the market all have integrated Miracast (wireless technology) screen projection functions, allowing users to achieve point-to-point direct data transmission between source (projection device) and sink (display device) without using a router wireless / wired network.
[0003] The existing Miracast function is to first negotiate the source and sink, then establish a local area network, after the assembly of the local area network, transmit control commands through TCP (Transmission Control Protocol), and transmit large data at a fixed rate through UDP (User Datagram Protocol) to achieve data transparent communication; however, since UDP is a communication protocol established under connectionless conditions, in Miracast applications, in complex environments and weak signals, it will cause the display device to receive data retransmission, disorder, etc., resulting in Miracast disconnection, screen distortion and other defects.
[0004] In summary, how to solve the problem of unstable data transmission effect in Miracast applications has become a technical problem that needs to be solved urgently in this field. Summary of the invention
[0005] The main purpose of the present invention is to provide a data transmission method, device, terminal equipment and storage medium based on Miracast, aiming to optimize the data transmission effect in Miracast screen projection applications.
[0006] To achieve the above object, the present invention provides a data transmission method based on Miracast, and the data transmission method based on Miracast includes:
[0007] Determine whether the data transmission sequence is correct based on the received multi-frame data packets;
[0008] If the data transmission sequence is correct, transmitting a first data frame to the delivery device to prompt the delivery device to increase the data transmission parameter value and transmit the data packet according to the increased data transmission parameter value;
[0009] If the data transmission sequence is incorrect, then the data retransmission rate and the data disorder rate are calculated;
[0010] When the data retransmission rate is greater than a preset first threshold, and the data disorder rate is greater than a preset second threshold, a second data frame is transmitted to the delivery device to prompt the delivery device to lower the data transmission parameter value and transmit the data packet according to the lowered data transmission parameter value.
[0011] Optionally, before the step of determining whether the data transmission sequence is correct according to the received multi-frame data packets, the method further includes:
[0012] After establishing a Miracast connection with the casting device, the received multi-frame data packets are stored in a preset buffer area in sequence;
[0013] When the number of frames of the multi-frame data packets stored in the buffer area reaches a preset value, the multi-frame data packets stored in the buffer area are determined as a group of data packets;
[0014] The step of judging whether the data transmission sequence is correct according to the received multi-frame data packets comprises:
[0015] Whether the data transmission sequence is correct is determined according to the group of data packets stored in the storage area.
[0016] Optionally, the step of judging whether the data transmission sequence is correct according to the received multi-frame data packets includes:
[0017] Obtain the sequence numbers of the received multi-frame data packets in turn;
[0018] It is determined whether the data transmission sequence is correct according to the sequence number.
[0019] Optionally, the method further comprises:
[0020] When the data transmission sequence is correct, the received multi-frame data packets are analyzed and displayed in sequence;
[0021] When the data retransmission rate is less than a preset first threshold, and / or the data disorder rate is less than a preset second threshold, the order of the multi-frame data packets is corrected, and the corrected multi-frame data packets are analyzed and displayed in sequence.
[0022] Optionally, the step of correcting the order of the multi-frame data packets includes:
[0023] If the data retransmission rate is less than a preset first threshold, the sequence numbers of the data packets of the multiple frames are obtained in sequence, and the repeated target data packets in the data packets of the multiple frames are filtered out according to the sequence numbers.
[0024] Optionally, the step of correcting the order of the multi-frame data packets includes:
[0025] If the data disorder rate is less than a preset second threshold, the sequence numbers of the data packets of the multiple frames are obtained in sequence, and the order of the data packets of the multiple frames is reorganized according to the sequence numbers.
[0026] Optionally, the data transmission method based on Miracast is applied to a delivery device, and the data transmission method based on Miracast further includes:
[0027] receiving a first data frame transmitted by a display device based on Miracast, increasing a data transmission parameter value according to the first data frame, and transmitting a data packet to the display device based on Miracast according to the increased data transmission parameter value;
[0028] or,
[0029] A second data frame transmitted by the display device based on Miracast is received, a data transmission parameter value is lowered according to the second data frame, and a data packet is transmitted to the display device based on Miracast according to the lowered data transmission parameter value.
[0030] In addition, to achieve the above object, the present invention further provides a data transmission device based on Miracast, the data transmission device based on Miracast comprising:
[0031] A judgment module, used for judging whether the data transmission sequence is correct according to the received multi-frame data packets;
[0032] A first prompting module, configured to transmit a first data frame to a delivery device to prompt the delivery device to increase a data transmission parameter value and transmit a data packet according to the increased data transmission parameter value if the data transmission sequence is correct;
[0033] A calculation module, used for calculating a data retransmission rate and a data disorder rate if the data transmission sequence is incorrect;
[0034] A second prompting module is used to transmit a second data frame to the delivery device to prompt the delivery device to lower the data transmission parameter value and transmit the data packet according to the lowered data transmission parameter value when the data retransmission rate is greater than a preset first threshold and the data disorder rate is greater than a preset second threshold;
[0035] Wherein, the data transmission device based on Miracast also includes:
[0036] an upward adjustment module, configured to receive a first data frame transmitted by a display device based on Miracast, upward adjust a data transmission parameter value according to the first data frame, and transmit a data packet to the display device based on Miracast according to the upward adjusted data transmission parameter value;
[0037] The down-adjustment module is used to receive the second data frame transmitted by the display device based on Miracast, down-adjust the data transmission parameter value according to the second data frame, and transmit the data packet to the display device based on Miracast according to the down-adjusted data transmission parameter value.
[0038] Among them, each functional module of the Miracast-based data transmission device of the present invention implements the steps of the Miracast-based data transmission method described above during operation.
[0039] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal device, which includes: a memory, a processor, and a Miracast-based data transmission program stored in the memory and runnable on the processor, and the Miracast-based data transmission program, when executed by the processor, implements the steps of the Miracast-based data transmission method as described above.
[0040] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a Miracast-based data transmission program is stored, and when the Miracast-based data transmission program is executed by a processor, the steps of the Miracast-based data transmission method as described above are implemented.
[0041] The present invention provides a data transmission method, device, terminal device and storage medium based on Miracast. The data transmission method based on Miracast includes: judging whether the data transmission sequence is correct according to the received multi-frame data packets; if the data transmission sequence is correct, transmitting a first data frame to the delivery device to prompt the delivery device to increase the data transmission parameter value and transmit the data packet according to the increased data transmission parameter value; if the data transmission sequence is incorrect, calculating the data retransmission rate and the data disorder rate; when the data retransmission rate is greater than a preset first threshold value, and the data disorder rate is greater than a preset second threshold value, transmitting a second data frame to the delivery device to prompt the delivery device to lower the data transmission parameter value and transmit the data packet according to the lowered data transmission parameter value.
[0042] Compared with the traditional Miracast-based data transmission method, the present invention determines whether the data transmission sequence between the two is correct by receiving a multi-frame data packet sent by a delivery device through a display device. If the current data transmission sequence is correct, the display device transmits a first data frame to the delivery device to remind the delivery device to increase the data transmission parameter value; if the current data transmission sequence is incorrect, the display device calculates the data retransmission rate and the data disorder rate of the data transmission according to the received multi-frame data packet. When the data retransmission rate is greater than a preset first threshold and the data disorder rate is greater than a preset second threshold, the display device transmits a second data frame to the delivery device to remind the delivery device to lower the data transmission parameter value.
[0043] In this way, the present invention checks the data transmission status during the Miracast working process and dynamically adjusts the data transmission parameter value during the working process to solve the problems of display device disconnection, screen distortion, etc., thereby achieving the effect of optimizing data transmission in the Miracast screen projection application. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of the device structure of the hardware operating environment of the terminal device involved in the embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of an implementation flow of an embodiment of a data transmission method based on Miracast of the present invention;
[0046] Figure 3 It is a schematic diagram of the principles involved in an embodiment of a data transmission method based on Miracast of the present invention;
[0047] Figure 4 This is a flow chart of an embodiment of a data transmission method based on Miracast according to the present invention;
[0048] Figure 5 Schematic diagram of functional modules of an embodiment of a data transmission device based on Miracast according to the present invention.
[0049] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0053] In the present invention, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0054] In addition, in the present invention, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0055] An embodiment of the present invention provides a terminal device.
[0056] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment of the terminal device involved in the embodiment of the present invention.
[0057] In the embodiment of the present invention, the terminal device may be a television, a display, a computer or any other device that supports UDP data transparent transmission based on a wireless network.
[0058] like Figure 1As shown, in the hardware operating environment of the terminal device, the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0059] Those skilled in the art will understand that Figure 1 The terminal device structure shown in the figure does not constitute a limitation on the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0060] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a data transmission program based on Miracast.
[0061] exist Figure 1 In the device shown, the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the Miracast-based data transmission program stored in the memory 1005 and perform the following operations:
[0062] Determine whether the data transmission sequence is correct based on the received multi-frame data packets;
[0063] If the data transmission sequence is correct, transmitting a first data frame to the delivery device to prompt the delivery device to increase the data transmission parameter value and transmit the data packet according to the increased data transmission parameter value;
[0064] If the data transmission sequence is incorrect, then the data retransmission rate and the data disorder rate are calculated;
[0065] When the data retransmission rate is greater than a preset first threshold, and the data disorder rate is greater than a preset second threshold, a second data frame is transmitted to the delivery device to prompt the delivery device to lower the data transmission parameter value and transmit the data packet according to the lowered data transmission parameter value.
[0066] Optionally, the processor 1001 may also be used to call a Miracast-based data transmission program stored in the memory 1005, and before executing the step of determining whether the data transmission sequence is correct according to the received multi-frame data packets, further perform the following operations:
[0067] After establishing a Miracast connection with the casting device, the received multi-frame data packets are stored in a preset buffer area in sequence;
[0068] When the number of frames of the multi-frame data packets stored in the buffer area reaches a preset value, the multi-frame data packets stored in the buffer area are determined as a group of data packets;
[0069] Optionally, the processor 1001 may also be configured to call a Miracast-based data transmission program stored in the memory 1005, and perform the following operations:
[0070] Whether the data transmission sequence is correct is determined according to the group of data packets stored in the storage area.
[0071] Optionally, the processor 1001 may also be configured to call a Miracast-based data transmission program stored in the memory 1005, and perform the following operations:
[0072] Obtain the sequence numbers of the received multi-frame data packets in turn;
[0073] It is determined whether the data transmission sequence is correct according to the sequence number.
[0074] Optionally, the processor 1001 may also be configured to call a Miracast-based data transmission program stored in the memory 1005, and perform the following operations:
[0075] When the data transmission sequence is correct, the received multi-frame data packets are analyzed and displayed in sequence;
[0076] When the data retransmission rate is less than a preset first threshold, and / or the data disorder rate is less than a preset second threshold, the order of the multi-frame data packets is corrected, and the corrected multi-frame data packets are analyzed and displayed in sequence.
[0077] The processor 1001 may also be used to call a Miracast-based data transmission program stored in the memory 1005, and perform the following operations:
[0078] If the data retransmission rate is less than a preset first threshold, the sequence numbers of the data packets of the multiple frames are obtained in sequence, and the repeated target data packets in the data packets of the multiple frames are filtered out according to the sequence numbers.
[0079] The processor 1001 may also be used to call a Miracast-based data transmission program stored in the memory 1005, and perform the following operations:
[0080] If the data disorder rate is less than a preset second threshold, the sequence numbers of the data packets of the multiple frames are obtained in sequence, and the order of the data packets of the multiple frames is reorganized according to the sequence numbers.
[0081] Optionally, the processor 1001 may also be configured to call a Miracast-based data transmission program stored in the memory 1005, and perform the following operations:
[0082] receiving a first data frame transmitted by a display device based on Miracast, increasing a data transmission parameter value according to the first data frame, and transmitting a data packet to the display device based on Miracast according to the increased data transmission parameter value;
[0083] or,
[0084] A second data frame transmitted by the display device based on Miracast is received, a data transmission parameter value is lowered according to the second data frame, and a data packet is transmitted to the display device based on Miracast according to the lowered data transmission parameter value.
[0085] Based on the above hardware structure, the overall concept of each embodiment of the data transmission method based on Miracast of the present invention is proposed.
[0086] In an embodiment of the present invention, mobile phones and large-screen displays on the market are all equipped with an integrated Miracast screen projection function, so that users can realize a point-to-point direct data transmission function between the source and the sink without using a router wireless / wired network.
[0087] The existing Miracast function is to first negotiate the source and sink, then set up a local area network, after the component LAN, transmit control commands through TCP, and transmit big data at a fixed rate through UDP to achieve data transparent communication; however, since UDP is a communication protocol established under connectionless conditions, in Miracast applications, in complex environments and weak signals, it will cause the display end to receive data retransmission, disorder, etc., resulting in Miracast disconnection, screen distortion and other defects.
[0088] In summary, how to solve the problem of unstable data transmission effect in Miracast applications has become a technical problem that needs to be solved urgently in this field.
[0089] In view of the above problems, an embodiment of the present invention proposes a data transmission method based on Miracast, which includes: judging whether the data transmission sequence is correct according to the received multi-frame data packets; if the data transmission sequence is correct, transmitting a first data frame to the delivery end to prompt the delivery end to increase the data transmission parameter value; if the data transmission sequence is incorrect, calculating the data retransmission rate and the data disorder rate; when the data retransmission rate is greater than a preset first threshold, and the data disorder rate is greater than a preset second threshold, transmitting a second data frame to the delivery end to prompt the delivery end to lower the data transmission parameter value.
[0090] Compared with the traditional Miracast-based data transmission method, the present invention determines whether the data transmission sequence between the two is correct by the display end according to the multi-frame data packets sent by the delivery end. If the current data transmission sequence is correct, the display end transmits the first data frame to the delivery end to remind the delivery end to increase the data transmission parameter value; if the current data transmission sequence is incorrect, the display end calculates the data retransmission rate and data disorder rate of the data transmission according to the received multi-frame data packets. When the data retransmission rate is greater than a preset first threshold and the data disorder rate is greater than a preset second threshold, the display end transmits the second data frame to the delivery end to remind the delivery end to lower the data transmission parameter value.
[0091] In this way, the present invention checks the data transmission status during the Miracast working process and dynamically adjusts the data transmission parameter values during the working process to solve the problems of display disconnection, screen distortion, disorder, etc., thereby achieving the effect of optimizing data transmission in the Miracast screen projection application.
[0092] Based on the overall concept of the data transmission method based on Miracast of the present invention, various embodiments of the data transmission method based on Miracast of the present invention are proposed.
[0093] Please refer to Figure 2 , Figure 2 It is a flowchart of the first embodiment of the data transmission method based on Miracast of the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that here.
[0094] In this embodiment, the data transmission method based on Miracast of the present invention is applied to the above-mentioned terminal device. It should be understood that, based on different design requirements of actual applications, in different feasible implementations, the data transmission method based on Miracast of the present invention can of course be specifically applied to other terminal devices, such as a mobile terminal connected to the above-mentioned terminal device. For ease of understanding and explanation, in this embodiment, the data transmission method based on Miracast of the present invention is explained with the terminal device as the direct execution subject.
[0095] like Figure 2 As shown, in this embodiment, the data transmission method based on Miracast of the present invention may include:
[0096] Step S10: judging whether the data transmission sequence is correct according to the received multi-frame data packets;
[0097] In this embodiment, the display device determines whether the current data transmission order is correct based on the multi-frame data packets received from the projection device, that is, the display device determines whether the data transmission is stable under the current network state, and whether data disorder or loss occurs based on the received multi-frame data packets.
[0098] Optionally, in a feasible embodiment, before the above step S10, the data transmission method based on Miracast of the present invention may further include:
[0099] Step S50: after establishing a Miracast connection with the delivery device, the received multi-frame data packets are sequentially stored in a preset buffer area;
[0100] In this embodiment, after establishing a Miracast connection with the delivery device, the display device sequentially stores the multi-frame data packets received from the delivery device based on the Miracast connection in a preset buffer area. The display device and the delivery device transmit data packets via UDP.
[0101] It should be noted that, in this embodiment, the display device and the projection device need to first perform P2P (peer-to-peer) negotiation, then establish a local area network, and then establish data transparent transmission through UDP to establish a Miracast connection.
[0102] Step S60: when the number of frames of the multi-frame data packets stored in the buffer reaches a preset value, the multi-frame data packets stored in the buffer are determined as a group of data packets;
[0103] In this embodiment, when the number of frames of the multi-frame data packets stored in the buffer area of the display device reaches a preset value, the display device determines the preset number of multi-frame data packets currently stored in the buffer area as a group of data packets.
[0104] Exemplarily, in this embodiment, the display device presets the number of frames of received data packets in the cache area to be 20. After the display device and the projection device establish a Miracast connection, the data packets received through the Miracast connection are stored in the preset cache area. When the data packets stored in the cache area reach 20 frames, the display device determines the 20 frames of data packets stored in the storage area as a group of data packets.
[0105] Based on this, the above step S10: the step of judging whether the data transmission sequence is correct according to the received multi-frame data packets, may include:
[0106] Step S101: determining whether the data transmission sequence is correct according to the group of data packets stored in the storage area.
[0107] In this embodiment, the display device determines whether the current data transmission order is correct based on a group of data packets received from the delivery device and stored in its own storage area. That is, the display device determines whether the data transmission is stable under the current network state and whether data disorder or loss occurs based on a group of data packets received and temporarily stored in its own storage area.
[0108] Optionally, in a feasible embodiment, the above step S10: judging whether the data transmission sequence is correct according to the received multi-frame data packets, may further include:
[0109] Step S102: sequentially obtaining the sequence numbers of the received multi-frame data packets;
[0110] In this embodiment, the display device sequentially obtains the serial numbers of the multi-frame data packets received from the delivery device, wherein the serial numbers are the serial numbers of the data packets added in the UDP protocol established between the display device and the delivery device.
[0111] Step S103: judging whether the data transmission sequence is correct according to the sequence number.
[0112] In this embodiment, the display device determines whether the data transmission sequence of the data packets received by itself is correct according to the sequence numbers of the received multi-frame data packets.
[0113] It should be noted that, in the present embodiment, the arrangement of the serial numbers is the number added to the data packets by the delivery device according to the temporal sequence of the delivered data packets. The serial numbers can be numbered in the form of Arabic numerals from small to large for the data packets, or can be other numbering methods that can show the temporal sequence of data packet transmission. The data transmission method based on Miracast of the present invention does not make specific limitations on the form of the serial number, as long as it can show the temporal sequence of data packet transmission.
[0114] Exemplarily, in this embodiment, the display device stores multiple frames of data packets in a storage area, and performs a judgment on the data transmission order with 10 frames of data packets as a group of data packets. When the display device detects that the sequence numbers of the 10 frames of data packets are arranged in the storage area in the order of 1, 2, 3, 4, 5, 5, 6, 9, 7, 8 from front to back, the display device can determine that the data transmission order of the data packets it receives under the current network state is incorrect.
[0115] Step S20: If the data transmission sequence is correct, a first data frame is transmitted to the delivery device to prompt the delivery device to increase the data transmission parameter value and transmit the data packet according to the increased data transmission parameter value;
[0116] In this embodiment, the display device determines whether the current data transmission order is correct based on the multi-frame data packets received from the delivery device. If the display device determines that the current data transmission order is correct, it means that there is no error in the data transmission between the delivery device and the display device under the current network state, and the data transmission state is stable. The display device transmits the first data frame to the delivery device to prompt the delivery device to increase the data transmission parameter value and transmit the data packet according to the increased data transmission parameter value.
[0117] It should be noted that, in this embodiment, the first data frame is a data packet prompting the delivery device to increase the data transmission parameter value, and the data transmission parameter value may be the resolution, that is, when the data transmission is sorted correctly, the display device transmits the first data frame to the delivery device prompting the delivery device to increase the resolution and continue to transmit data packets according to the increased resolution.
[0118] In addition, in another feasible embodiment, the data transmission parameter value may also be the bit rate (or also called rate), that is, when the data transmission is sorted correctly, the display device transmits the first data frame to the delivery device to prompt the delivery device to increase the bit rate and continue to transmit data packets according to the increased bit rate.
[0119] For example, Figure 3As shown, the delivery device and the large-screen terminal display device first conduct P2P negotiation, then establish a local area network, and then establish a Miracast connection through UDP data transmission. Then, the large-screen terminal display device executes a dynamic rate control strategy. When the delivery device transmits video stream data packets to the large-screen terminal display device at a resolution of 1080P, the large-screen terminal display device will make a judgment on the data transmission order of the received video stream data packets as a group of 10 frames of data packets, and transmit the rate adjustment data frame to the delivery device according to the judgment result. After receiving the rate adjustment data frame, the delivery device increases the resolution of the video stream data transmission from 1080P to 2K. After the resolution is increased, the delivery device transmits the video data packet to the large-screen terminal display device at a resolution of 2K. Finally, the delivery device and the large-screen terminal display device disconnect after completing all the video stream data transmission.
[0120] Step S30: If the data transmission sequence is incorrect, then the data retransmission rate and the data disorder rate are calculated;
[0121] In this embodiment, the display device determines whether the current data transmission order is correct based on the multi-frame data packets received from the delivery device. If the display device determines that the current data transmission order is incorrect, it means that there is an error in the data transmission between the delivery device and the display device under the current network state, and the data transmission state is unstable. The display device calculates the data retransmission rate and data disorder rate of the data transmission process under the current network state through the multi-frame data packets received from the delivery device.
[0122] It should be noted that, in the present embodiment, the data retransmission rate calculated by the display device is a percentage value obtained by dividing the number of invalid frames in a group of data packets stored in the storage area by the total number of frames received, and the data disorder rate calculated by the display device is a percentage value obtained by dividing the number of frames with incorrect positions in a group of data packets stored in the storage area by the total number of frames received.
[0123] Step S40: When the data retransmission rate is greater than a preset first threshold, and the data disorder rate is greater than a preset second threshold, a second data frame is transmitted to the delivery device to prompt the delivery device to lower the data transmission parameter value and transmit the data packet according to the lowered data transmission parameter value.
[0124] In this embodiment, the display device calculates the data retransmission rate and the data disorder rate of the data transmission process under the current network state by using the multi-frame data packets received from the delivery device. If the display device determines that the data retransmission rate is greater than the preset first threshold, and the data disorder rate is greater than the preset second threshold, it means that there are many data transmission errors between the delivery device and the display device under the current network state, and the data transmission state is very unstable. The display device then transmits a second data frame to the delivery device to prompt the delivery device to lower the data transmission parameter value and transmit the data packet according to the lowered data transmission parameter value.
[0125] It should be noted that, in this embodiment, the second data frame is a data packet prompting the delivery device to lower the data transmission parameter value. The data transmission parameter value may be resolution. The preset first threshold is preferably 40%, and the preset second threshold is preferably 60%.
[0126] In addition, in a feasible embodiment, after executing the above operations, the display device clears the number of data packets stored in its own storage area, and receives new data packets according to the new data transmission parameter value.
[0127] For example, Figure 4 As shown, after the Miracast networking between the projection device and the display device is successful, the packet receiving detection process is started, the display device stores the received data packets in the buffer area, and then determines whether the number of data packets exceeds 20 frames. If the number of received data packets does not exceed 20 frames, the display device continues to store the received data packets in its own buffer area. If the number of received data packets reaches 20 frames, the display device detects whether the order of these 20 frames of data packets is normal. If the order of the data packets is normal, the current data transmission parameter value is +1. If the order of the data packets is abnormal, the display device calculates the retransmission rate and the data packet disorder rate of the current data transmission. If the calculated retransmission rate and the data packet disorder rate of the current data transmission are both greater than their respective default thresholds, the current data transmission parameter value is -1. If the calculated retransmission rate and the data packet disorder rate of the current data transmission do not exceed their respective default thresholds at the same time, the retransmission filtering and data packet reassembly strategy is executed, and then the corrected video stream data packet is reported to parse and display the adjusted video stream, and the number of currently received data packets is cleared.
[0128] The present invention provides a data transmission method based on Miracast, in which a display device determines whether the current data transmission sequence is correct based on a multi-frame data packet received from a delivery device, that is, the display device determines whether the data transmission is stable under the current network state, and whether data disorder or loss occurs based on the received multi-frame data packet. Then, if the display device determines that the current data transmission sequence is correct, it means that there is no error in the data transmission between the delivery device and the display device under the current network state, and the data transmission state is stable, then the display device transmits a first data frame to the delivery device to prompt the delivery device to increase the data transmission parameter value. Then, if the display device determines that the current data transmission sequence is incorrect, it means that there is an error in the data transmission between the delivery device and the display device under the current network state, and the data transmission state is unstable, then the display device calculates the data retransmission rate and data disorder rate of the data transmission process under the current network state through the multi-frame data packet received from the delivery device. Finally, the display device calculates the data retransmission rate and data disorder rate of the data transmission process under the current network state by using the multi-frame data packets received from the delivery device. If the display device determines that the data retransmission rate is greater than the preset first threshold, and the data disorder rate is greater than the preset second threshold, it means that there are many data transmission errors between the delivery device and the display device under the current network state, and the data transmission state is very unstable. The display device then transmits a second data frame to the delivery device to prompt the delivery device to lower the data transmission parameter value.
[0129] In this way, the present invention checks the data transmission status during the Miracast working process and dynamically adjusts the data transmission parameter value during the working process to solve the problems of display device disconnection, screen distortion, etc., thereby achieving the effect of optimizing data transmission in the Miracast screen projection application.
[0130] Furthermore, based on the first embodiment of the data transmission method based on Miracast of the present invention, a second embodiment of the data transmission method based on Miracast of the present invention is proposed.
[0131] In this embodiment, the data transmission method based on Miracast of the present invention may further include:
[0132] Step A10: When the data transmission sequence is correct, the received multi-frame data packets are analyzed and displayed in sequence;
[0133] In this embodiment, the display device determines whether the current data transmission order is correct based on the multi-frame data packets received from the delivery device. If the display device determines that the current data transmission order is correct, it means that there are no errors in the data transmission between the delivery device and the display device under the current network state, and the data transmission state is stable. The display device parses and displays the received multi-frame data packets in sequence according to the chronological order of reception.
[0134] Step A20: When the data retransmission rate is less than a preset first threshold, and / or the data disorder rate is less than a preset second threshold, the order of the multi-frame data packets is corrected, and the corrected multi-frame data packets are analyzed and displayed in sequence.
[0135] In this embodiment, when the display device determines that the current data transmission order is incorrect based on the multi-frame data packets received from the delivery device, it calculates the data retransmission rate and the data disorder rate of the current data transmission. If the display device determines that the current data retransmission rate is less than a preset first threshold, and / or the data disorder rate is less than a preset second threshold, it indicates that there is an error in the data transmission between the delivery device and the display device under the current network state, but the sorting error is not large and can be corrected. The display device then corrects the sorting of the received multi-frame data packets, and parses and displays the corrected multi-frame data packets in sequence.
[0136] In addition, in a feasible embodiment, when the display device determines that the current data transmission sorting is incorrect based on the multi-frame data packets received from the delivery device, it calculates the data retransmission rate and the data disorder rate of the current data transmission. If the display device determines that the current data retransmission rate is greater than a preset first threshold and the data disorder rate is greater than a preset second threshold, it means that there is an error in the data transmission between the delivery device and the display device under the current network state, and the sorting error is large and not suitable for correction, then the display device can discard the multi-frame data packet.
[0137] Optionally, in a feasible embodiment, the step of “correcting the order of the multi-frame data packets” in the above step A20 may include:
[0138] Step A201: If the data retransmission rate is less than a preset first threshold, sequentially obtain the sequence numbers of the data packets of multiple frames, and filter repeated target data packets in the data packets of multiple frames according to the sequence numbers.
[0139] In this embodiment, after the display device determines that the data transmission order of the received multi-frame data packet is incorrect, it calculates the data retransmission rate of the multi-frame data packet. If the display device determines through calculation that the data retransmission rate of the multi-frame data packet is less than a preset first threshold, that is, there are duplicate data packets in the multi-frame data packet but the number of duplicate data packets is small, the display device obtains the serial numbers of each of the multi-frame data packets in turn, and filters the duplicate target data packets according to the serial numbers of each of the multi-frame data packets.
[0140] Exemplarily, in this embodiment, the display device calculates that the data retransmission rate is 20% under the current network state based on the 10 frames of data packets received, that is, there are two invalid data packets among the 10 frames of data packets received, then the display device obtains the serial numbers of each of the 10 frames of data packets in turn, and obtains that the serial numbers of the 10 frames of data packets are 1, 2, 3, 4, 5, 6, 7, 7, 8, 8 respectively, then the display device can determine that the data packet with serial number 7 and the data packet with serial number 8 are duplicate target data packets, then the display device filters any one of the data packets with serial number 7 and any one of the data packets with serial number 8, and no longer stores or displays them.
[0141] In addition, in a feasible embodiment, the display device determines that the data transmission order is incorrect and frame loss occurs under the current network state based on the received multi-frame data packets. Then, the display device copies the previous frame data packet / next frame data packet of the lost data packet and places it in the arrangement position of the lost data packet.
[0142] Optionally, in a feasible embodiment, the above step A20 may include:
[0143] Step A202: If the data disorder rate is less than a preset second threshold, sequentially obtain the sequence numbers of the data packets of multiple frames, and reorganize the order of the data packets of multiple frames according to the sequence numbers.
[0144] In this embodiment, after the display device determines that the data transmission order of the received multi-frame data packets is incorrect, it calculates the data disorder rate of the multi-frame data packets. If the display device determines through calculation that the data disorder rate of the multi-frame data packets is less than a preset second threshold, the display device obtains the respective serial numbers of the multi-frame data packets in turn, and reorganizes the order of the data packets with incorrect arrangement positions according to the respective serial numbers of the multi-frame data packets.
[0145] Exemplarily, in this embodiment, the display device calculates that the data disorder rate is 30% under the current network state based on the 10 frames of data packets received, that is, the arrangement positions of 3 frames of data packets among the 10 frames of data packets received are wrong, then the display device obtains the serial numbers of each of the 10 frames of data packets in turn, and obtains that the serial numbers of these 10 frames of data packets are 1, 2, 4, 5, 3, 6, 7, 8, 9, and 10 respectively, then the display device can determine that the arrangement positions of the data packets with serial number 4, the data packets with serial number 5, and the data packets with serial number 3 are wrong, then the display device adjusts the data packet with serial number 3 to the position of the original data packet with serial number 4, adjusts the data packet with serial number 4 to the position of the original data packet with serial number 5, and adjusts the data packet with serial number 5 to the position of the original data packet with serial number 3, and the display device stores the reorganized multi-frame data packets and then displays them.
[0146] Thus, in this embodiment, the data transmission method based on Miracast of the present invention dynamically corrects the transmitted data through the strategy of retransmission filtering and reorganization of data packets to solve problems such as display device screen distortion, thereby achieving the effect of optimizing data transmission in Miracast screen projection applications.
[0147] Furthermore, based on the first embodiment and / or the second embodiment of the data transmission method based on Miracast of the present invention, a third embodiment of the data transmission method based on Miracast of the present invention is proposed.
[0148] In this embodiment, the data transmission method based on Miracast is applied to the delivery device. The data transmission method based on Miracast of the present invention may also include:
[0149] Step B10: receiving a first data frame transmitted by a display device based on Miracast, increasing a data transmission parameter value according to the first data frame, and transmitting a data packet to the display device based on Miracast according to the increased data transmission parameter value;
[0150] In this embodiment, the casting device receives the first data frame transmitted by the display device based on the Miracast connection, then increases the data transmission parameter value according to the first data frame received from the display device, and transmits a new data packet to the display device based on Miracast according to the increased data transmission parameter value.
[0151] It should be noted that, in this embodiment, the data transmission parameter value may be resolution or bit rate, that is, after receiving the first data frame transmitted by the display device, the delivery device increases the resolution or bit rate of the current data transmission, and the extent of the increase is not specifically limited in the present invention.
[0152] Exemplarily, after the delivery device establishes a Miracast connection with the display device, under the current network state, the resolution of the video stream data transmitted by the delivery device to the display device is 2K. After the delivery device receives the first data frame, the resolution of the video stream data is increased to 4K.
[0153] Optionally, in another feasible embodiment, the data transmission method based on Miracast of the present invention may further include:
[0154] Step B20: receiving a second data frame transmitted by the display device based on Miracast, lowering a data transmission parameter value according to the second data frame, and transmitting a data packet to the display device based on Miracast according to the lowered data transmission parameter value.
[0155] In this embodiment, in this embodiment, the projection device receives the second data frame transmitted by the display device based on the Miracast connection, then lowers the data transmission parameter value according to the second data frame received from the display device, and transmits a new data packet to the display device based on Miracast according to the lowered data transmission parameter value.
[0156] It should be noted that, in this embodiment, after the projection device establishes a Miracast connection with the display device, the initial data of the data transmission parameter value can be selected by the user through a preset virtual button (a graphical virtual button displayed in a specific area on the display screen), or it can be the selection made by the projection device and the display device when the Miracast connection was established last time, or it can be a preset value of the projection device.
[0157] Thus, in this embodiment, the present invention checks the data transmission status during the Miracast working process and dynamically adjusts the data transmission parameter value during the working process to solve the problems of display device disconnection, screen distortion, etc., thereby optimizing the data transmission effect in the Miracast screen projection application.
[0158] In addition, an embodiment of the present invention further provides a data transmission device based on Miracast.
[0159] Please refer to Figure 5 , the data transmission device based on Miracast of the present invention comprises:
[0160] A judging module 10 is used to judge whether the data transmission sequence is correct according to the received multi-frame data packets;
[0161] A first prompting module 20 is configured to transmit a first data frame to a delivery device to prompt the delivery device to increase a data transmission parameter value and transmit a data packet according to the increased data transmission parameter value if the data transmission sequence is correct;
[0162] A calculation module 30, configured to calculate a data retransmission rate and a data disorder rate if the data transmission sequence is incorrect;
[0163] The second prompt module 40 is used to transmit a second data frame to the delivery device to prompt the delivery device to lower the data transmission parameter value and transmit the data packet according to the lowered data transmission parameter value when the data retransmission rate is greater than a preset first threshold and the data disorder rate is greater than a preset second threshold.
[0164] Optionally, the data transmission device based on Miracast of the present invention further includes:
[0165] A storage module, used to store the received multi-frame data packets in a preset buffer area in sequence after establishing a Miracast connection with the casting device;
[0166] A determination module, configured to determine the multiple frames of the data packets stored in the buffer area as a group of data packets when the number of frames of the multiple frames of data packets stored in the buffer area reaches a preset value;
[0167] Optionally, the judgment module 10 of the Miracast-based data transmission device of the present invention is also used to judge whether the data transmission sequence is correct according to the group of data packets stored in the storage area; and, to judge whether the data transmission sequence is correct according to the serial number.
[0168] Optionally, the judging module 10 includes:
[0169] An acquisition unit, used for sequentially acquiring the sequence numbers of the received multi-frame data packets;
[0170] Optionally, the data transmission device based on Miracast of the present invention further includes:
[0171] A correction module, configured to correct the order of the multi-frame data packets when the data retransmission rate is less than a preset first threshold and / or the data disorder rate is less than a preset second threshold;
[0172] A display module is used to parse and display the received multi-frame data packets in sequence when the data transmission sequence is correct; and, is used to parse and display the corrected multi-frame data packets in sequence.
[0173] Optionally, the correction module comprises:
[0174] The filtering unit is used to sequentially obtain the sequence numbers of the data packets of multiple frames if the data retransmission rate is less than a preset first threshold, and filter the repeated target data packets in the data packets of multiple frames according to the sequence numbers.
[0175] The reassembly unit is used to sequentially obtain the sequence numbers of the data packets of multiple frames if the data disorder rate is less than a preset second threshold, and reassemble the order of the data packets of multiple frames according to the sequence numbers.
[0176] Optionally, the data transmission device based on Miracast of the present invention further includes:
[0177] The up-regulation module is used to receive a first data frame transmitted by a display device based on Miracast, up-regulate a data transmission parameter value according to the first data frame, and transmit a data packet to the display device based on Miracast according to the up-regulated data transmission parameter value.
[0178] Optionally, the data transmission device based on Miracast of the present invention further includes:
[0179] The down-adjustment module is used to receive the second data frame transmitted by the display device based on Miracast, down-adjust the data transmission parameter value according to the second data frame, and transmit the data packet to the display device based on Miracast according to the down-adjusted data transmission parameter value.
[0180] Among them, the functional implementation of each module in the above-mentioned Miracast-based data transmission device corresponds to the steps in the above-mentioned Miracast-based data transmission method embodiment, and its functions and implementation processes are no longer repeated here.
[0181] In addition, the present invention also proposes a storage medium on which a Miracast-based data transmission program is stored. When the Miracast-based data transmission program is executed by a processor, the steps of the Miracast-based data transmission method of the present invention as described above are implemented.
[0182] The specific embodiments of the storage medium of the present invention are basically the same as the embodiments of the above-mentioned Miracast-based data transmission method, and are not described in detail here.
[0183] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0184] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0185] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0186] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data transmission method based on Miracast, characterized in that: Applied to a display device, the display device is connected to a projection device via Miracast, and the data transmission method based on Miracast includes: Determine whether the data transmission sequence is correct based on the received multi-frame data packets; If the data transmission sequence is correct, transmitting a first data frame to the delivery device to prompt the delivery device to increase the data transmission parameter value and transmit the data packet according to the increased data transmission parameter value; If the data transmission sequence is incorrect, then the data retransmission rate and the data disorder rate are calculated; When the data retransmission rate is greater than a preset first threshold, and the data disorder rate is greater than a preset second threshold, a second data frame is transmitted to the delivery device to prompt the delivery device to lower the data transmission parameter value and transmit the data packet according to the lowered data transmission parameter value; The method further comprises: When the data retransmission rate is less than a preset first threshold, and / or the data disorder rate is less than a preset second threshold, correcting the order of the multi-frame data packets, and parsing and displaying the corrected multi-frame data packets in sequence; The step of correcting the order of the multi-frame data packets comprises: If the data retransmission rate is less than a preset first threshold, sequentially obtaining the sequence numbers of the data packets of the multiple frames, and filtering the repeated target data packets in the data packets of the multiple frames according to the sequence numbers; If there is a frame loss in the arrangement of the multi-frame data packets, the adjacent data packets of the lost data packet are copied and the adjacent data packets are placed at the arrangement position of the lost data packet; If the data disorder rate is less than a preset second threshold, the sequence numbers of the data packets of the multiple frames are obtained in sequence, and the order of the data packets of the multiple frames is reorganized according to the sequence numbers.
2. The data transmission method based on Miracast according to claim 1, characterized in that: Before the step of determining whether the data transmission sequence is correct according to the received multi-frame data packets, the method further includes: After establishing a Miracast connection with the casting device, the received multi-frame data packets are stored in a preset buffer area in sequence; When the number of frames of the multi-frame data packets stored in the buffer area reaches a preset value, the multi-frame data packets stored in the buffer area are determined as a group of data packets; The step of judging whether the data transmission sequence is correct according to the received multi-frame data packets comprises: Whether the data transmission sequence is correct is determined based on the group of data packets stored in the buffer area.
3. The data transmission method based on Miracast according to claim 1, characterized in that: The step of judging whether the data transmission sequence is correct according to the received multi-frame data packets comprises: Obtain the sequence numbers of the received multi-frame data packets in turn; It is determined whether the data transmission sequence is correct according to the sequence number.
4. The data transmission method based on Miracast according to claim 1, characterized in that: The method further comprises: When the data transmission sequence is correct, the received multi-frame data packets are parsed and displayed in sequence.
5. A data transmission method based on Miracast, characterized in that: The data transmission method based on Miracast is applied to a delivery device, wherein the delivery device is connected to the display device described in claim 1 via Miracast, and the data transmission method based on Miracast comprises: Receiving a first data frame transmitted by a display device based on Miracast, increasing a data transmission parameter value according to the first data frame, and transmitting a data packet to the display device based on Miracast according to the increased data transmission parameter value; or, A second data frame transmitted by the display device based on Miracast is received, a data transmission parameter value is lowered according to the second data frame, and a data packet is transmitted to the display device based on Miracast according to the lowered data transmission parameter value.
6. A data transmission device based on Miracast, characterized in that: The Miracast-based data transmission device comprises: A judgment module, used for judging whether the data transmission sequence is correct according to the received multi-frame data packets; A first prompting module, configured to transmit a first data frame to a delivery device to prompt the delivery device to increase a data transmission parameter value and transmit a data packet according to the increased data transmission parameter value if the data transmission sequence is correct; A calculation module, used for calculating a data retransmission rate and a data disorder rate if the data transmission sequence is incorrect; A second prompting module is used to transmit a second data frame to the delivery device to prompt the delivery device to lower the data transmission parameter value and transmit the data packet according to the lowered data transmission parameter value when the data retransmission rate is greater than a preset first threshold and the data disorder rate is greater than a preset second threshold; The second prompt module is further used for: When the data retransmission rate is less than a preset first threshold, and / or the data disorder rate is less than a preset second threshold, correcting the order of the multi-frame data packets, and parsing and displaying the corrected multi-frame data packets in sequence; If the data retransmission rate is less than a preset first threshold, sequentially obtaining the sequence numbers of the data packets of the multiple frames, and filtering the repeated target data packets in the data packets of the multiple frames according to the sequence numbers; If there is a frame loss in the arrangement of the multi-frame data packets, the adjacent data packets of the lost data packet are copied and the adjacent data packets are placed at the arrangement position of the lost data packet; If the data disorder rate is less than a preset second threshold, sequentially obtaining the sequence numbers of the data packets of the multiple frames, and reorganizing the order of the data packets of the multiple frames according to the sequence numbers; Wherein, the data transmission device based on Miracast also includes: an upward adjustment module, configured to receive a first data frame transmitted by a display device based on Miracast, upward adjust a data transmission parameter value according to the first data frame, and transmit a data packet to the display device based on Miracast according to the upward adjusted data transmission parameter value; The down-adjustment module is used to receive the second data frame transmitted by the display device based on Miracast, down-adjust the data transmission parameter value according to the second data frame, and transmit the data packet to the display device based on Miracast according to the down-adjusted data transmission parameter value.
7. A terminal device, characterized in that: The terminal device includes: a memory, a processor, and a Miracast-based data transmission program stored in the memory and executable on the processor. When the Miracast-based data transmission program is executed by the processor, the steps of the Miracast-based data transmission method as described in any one of claims 1 to 5 are implemented.
8. A storage medium, characterized in that: The storage medium stores a Miracast-based data transmission program, and when the Miracast-based data transmission program is executed by the processor, the steps of the Miracast-based data transmission method according to any one of claims 1 to 5 are implemented.
