WO2024074085A1 - Data transmission method, electronic device, screen transmitter and storage medium - Google Patents

Data transmission method, electronic device, screen transmitter and storage medium Download PDF

Info

Publication number
WO2024074085A1
WO2024074085A1 PCT/CN2023/115163 CN2023115163W WO2024074085A1 WO 2024074085 A1 WO2024074085 A1 WO 2024074085A1 CN 2023115163 W CN2023115163 W CN 2023115163W WO 2024074085 A1 WO2024074085 A1 WO 2024074085A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
broadcast
application
sent
wireless communication
Prior art date
Application number
PCT/CN2023/115163
Other languages
French (fr)
Chinese (zh)
Inventor
严薇南
Original Assignee
广州视臻信息科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州视臻信息科技有限公司 filed Critical 广州视臻信息科技有限公司
Publication of WO2024074085A1 publication Critical patent/WO2024074085A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services

Definitions

  • the present application relates to the field of communication technology, for example, to a data transmission method, an electronic device, a screen transmitter and a storage medium.
  • UDP User Datagram Protocol
  • OSI Open System Interconnection
  • the current standard UDP protocol uses a layered design.
  • the underlying link performs actual data transmission through Ethernet or through a connection-based wireless communication network technology (Wireless Fidelity, WiFi) link.
  • the standard UDP protocol cannot customize the underlying transmission link parameters and can only send data according to the parameters specified in the protocol. The transmission efficiency is low and cannot meet the needs of different scenarios.
  • the present application provides a data transmission method, an electronic device, a screen transmitter and a storage medium to solve the problem that data transmission can only be performed according to the standard UDP protocol during the data transmission process.
  • the present application provides a data transmission method, which is applied to a transmitting end, wherein the transmitting end includes a first wireless communication module and a first application program, wherein the first wireless communication module is set to a monitoring mode, including:
  • the first application obtains first data to be sent encapsulated in the user datagram protocol, and processes the first data to be sent according to a first preset link parameter to obtain first target data;
  • the first wireless communication module parses the first target data to determine first data to be broadcast and first preset link parameters, and broadcasts the first data to be broadcast according to the first preset link parameters, so that the first data to be broadcast is received by a target receiving end.
  • the present application provides a data transmission method, which is applied to a data transmission device, wherein the data transmission device includes a processor, a memory, a communication interface, and a second wireless communication module, wherein the memory, the communication interface, and the second wireless communication module are all electrically connected to the processor, the second wireless communication module is set to a listening mode, the memory stores a second application, and the second application stores a second preset link parameter;
  • the data transmission method comprises:
  • the communication interface establishes a connection with a source device
  • the processor acquires the shared data generated by the source device through the communication interface
  • the processor executes the second application based on the shared data, the second application being used to obtain second data to be sent encapsulated in a user datagram protocol based on the shared data, and processes the second data to be sent according to a second preset link parameter to obtain second target data;
  • the processor sends the second target data to the second wireless communication module
  • the second wireless communication module parses the second target data to determine second data to be broadcast and second preset link parameters, and broadcasts the second data to be broadcast according to the second preset link parameters so that the second data to be broadcast is received by the target receiving end.
  • the present application provides a data transmission method, which is applied to a target receiving end, wherein the target receiving end includes a third wireless communication module, a third application program, and an upper layer application program, wherein the third wireless communication module is set to a monitoring mode, including:
  • the third wireless communication module receives the data to be broadcast, and the data to be broadcast is sent according to the data transmission method provided in any embodiment of the present application;
  • the third application obtains the data to be broadcast received by the third wireless communication module, and when it is determined that the processing conditions are met, sends the data to be broadcast to the port corresponding to the upper-layer application so that the upper-layer application obtains the data to be broadcast.
  • the present application provides an electronic device, the electronic device comprising:
  • a memory communicatively coupled to the at least one processor
  • the memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data transmission method described in any embodiment of the present application.
  • the present application provides a screen transmitter, comprising a processor, a memory, a communication interface and a second wireless communication module, wherein the memory, the communication interface and the second wireless communication module are all electrically connected to the processor;
  • the communication interface is configured to connect to a source device
  • the memory is configured to store a second application program, wherein the second application program stores a second preset link parameter
  • the processor is configured to obtain shared data generated by the source device through the communication interface, execute the second application based on the shared data to obtain an adopted second data to be sent encapsulated in a user datagram protocol, processing the second data to be sent according to a second preset link parameter to obtain second target data, and sending the second target data to the second wireless communication module;
  • the second wireless communication module is configured to parse the second target data to determine second data to be broadcast and second preset link parameters, and broadcast the second data to be broadcast according to the second preset link parameters so that the second data to be broadcast is received by the target receiving end.
  • the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data transmission method described in any embodiment of the present application when executed.
  • FIG1 is a flow chart of a data transmission method provided according to Embodiment 1 of the present application.
  • FIG1A is an example diagram of a data message format provided according to Embodiment 1 of the present application.
  • FIG2 is a flow chart of a data transmission method provided according to Embodiment 2 of the present application.
  • FIG3 is a timing diagram of data transmission applied to a transmitting end according to Embodiment 2 of the present application.
  • FIG4 is a flow chart of a data transmission method provided according to Embodiment 3 of the present application.
  • FIG5 is a flow chart of a data transmission method provided according to Embodiment 4 of the present application.
  • FIG. 6 is a timing diagram of data transmission applied to a target receiving end according to a fourth embodiment of the present application.
  • FIG. 7 is a diagram showing an implementation example of data transmission between a target receiving end and a transmitting end according to a fourth embodiment of the present application.
  • FIG8 is a schematic diagram of the structure of a screen transmitter provided according to Embodiment 5 of the present application.
  • FIG9 is a schematic diagram of the structure of an electronic device provided in accordance with the sixth embodiment of the present application.
  • FIG1 is a flowchart of a data transmission method provided in Embodiment 1 of the present application. This embodiment is applicable to the case of data transmission.
  • the method can be executed by a transmitting end, which can be an electronic device such as a smart phone, a tablet, a desktop computer, a notebook, etc.
  • the transmitting end includes a first wireless communication module and a first application.
  • the first wireless communication module is set to a monitoring mode. As shown in FIG1, the method includes:
  • a first application program obtains first data to be sent encapsulated in a user datagram protocol, and processes the first data to be sent according to a first preset link parameter to obtain first target data.
  • the first application can be understood as an application used to process the first data to be sent that needs to be transmitted during the data transmission process; the first data to be sent can be understood as data that needs to be sent to an external device.
  • the first data to be sent is generated by an application in the sending end, such as a video player, an audio player, etc.
  • the same device can be used as both a sending end and a receiving end.
  • the embodiment of the present application takes the device as a sending end and sends data to an external device as an example.
  • the first preset link parameter can be understood as the parameter of the transmission link when transmitting the first data to be sent, such as the transmission speed, encoding method, etc.
  • the first target data can be understood as the data obtained after processing the first data to be sent, which can be used to guide the first wireless communication module on how to send data.
  • the application X in the device When the application X in the device needs to send data to the outside world, it generates shared data, and the shared data is transmitted to the transport layer via the application layer, the presentation layer, and the session layer, and the first data to be sent encapsulated by the user datagram protocol (hereinafter referred to as the UDP protocol) is obtained.
  • the first data to be sent is sent to the UDP port through the UDP protocol, and the first application obtains the first data to be sent by monitoring the UDP port.
  • the first preset link parameters set in advance are stored in the first application, and the first preset link parameters can be customized in advance according to the use scenario, requirements, etc.
  • the first target data is obtained by processing the first data to be sent according to the first preset link parameters, which can be directly added to the first data to be sent to obtain the first target data, or the first data to be sent can be processed and then the first preset link parameters are added to obtain the first target data.
  • the first application sends the first target data to the first wireless communication module, and the first wireless communication module performs data transmission according to the first target data.
  • the first wireless communication module parses the first target data to determine the first data to be broadcast and the first preset link parameter, and broadcasts the first data to be broadcast according to the first preset link parameter, so that the first data to be broadcast is received by the target receiving end.
  • the first wireless communication module can be understood as a wireless transmission link in the transmitting end.
  • a module for data transmission such as a network card;
  • the first data to be broadcast can be understood as data that needs to be broadcast to other devices, and the first data to be broadcast can be data obtained after processing the first data to be sent, or the first data to be sent can be directly used as the first data to be broadcast.
  • the target receiving end can be understood as the final destination of the first data to be broadcast.
  • the first wireless communication module is set to the monitoring mode to monitor the data sent by the first application. By setting the first wireless communication module to the monitoring mode, data interception is avoided.
  • the first wireless communication module parses the first target data, and can parse it according to the field to obtain the first data to be broadcast that can be used for transmission, and the first preset link parameters for guiding the first wireless communication module on how to transmit data.
  • the first data to be broadcast is packaged, encoded, and processed according to the first preset link parameters, and then broadcast and sent outward at a certain transmission speed.
  • the first data to be broadcast can be sent according to the customized first preset link parameters to meet the needs of users.
  • the first wireless communication module broadcasts the first data to be broadcast to the target receiving end.
  • the first wireless communication module When the first wireless communication module broadcasts the first data to be broadcast, it can send the first data to be broadcast to the target sending end through the networking strategy.
  • the communication between devices agrees on a unique address (bssid) as the unique identifier (ID) of the network.
  • the client When the client communicates on the network, it must first obtain the bssid of the network as its third address (determines which network) to send data packets, and at the same time, it also filters the received data packets through the third address to see if they are from this network.
  • the first address i.e., the target address, which determines to whom it is sent
  • the first address i.e., the target address, which determines to whom it is sent
  • the first address When the first address is all FF, it represents broadcast communication, and other devices can receive it.
  • the second address is its own address, which represents who sent it, and generally takes the media access control (MAC) address of its own network card.
  • MAC media access control
  • the above-mentioned device refers to an electronic device including a wireless communication module.
  • Figure 1A is an example diagram of a data message format.
  • the first data to be broadcast can be encapsulated and broadcasted in this format when broadcasting, and the other data in the figure can carry the specific data content sent.
  • An embodiment of the present application provides a data transmission method, which is applied to a transmitting end, wherein the transmitting end includes a first wireless communication module and a first application program, the first wireless communication module is set to a listening mode, and a first preset link parameter is predefined, the first preset link parameter is used to guide data transmission, the first data to be sent is processed according to the first preset link parameter to obtain first target data and send it to the first wireless communication module, the first wireless communication module determines first data to be broadcast and the first preset link parameter by parsing the first target data, and the first data to be broadcast is broadcasted through the first preset link parameter, the first preset link parameter can be flexibly set and adjusted according to demand, can meet the demand for data transmission in different scenarios, improve user experience, and at the same time improve data transmission efficiency.
  • FIG2 is a flow chart of a data transmission method provided in Embodiment 2 of the present application. This embodiment is a refinement of the above embodiment. As shown in FIG2 , the method includes:
  • a first application program obtains first data to be sent encapsulated in a user datagram protocol.
  • the method further includes: the first application determines a first data length of the first data to be sent; and performs length verification on the first data length.
  • the first data length can be understood as the data length of the first data to be sent.
  • the first data length of the first data to be sent can be determined based on the first data to be sent after the first data to be sent is obtained, or it can be obtained from the data sender of the first data to be sent while the first data to be sent is obtained. After determining the data length of the first data to be sent, the first data length is verified.
  • the verification method can be to pre-set a length threshold to determine whether the first data length is greater than the length threshold. If the first data length is greater than the length threshold, the length verification result of the first data to be sent is determined to be a verification failure; if the first data length is less than or equal to the length threshold, the length verification result of the first data to be sent is determined to be a verification success. If the verification fails, the first data to be sent is not processed or sent. If the verification is successful, continue to perform the following operations to process and send the first data to be sent.
  • the first application divides first data to be sent into k first data packets, where k is a grouping parameter.
  • the first data packet can be understood as a data packet formed by dividing the first data to be sent into blocks.
  • the grouping parameter k is predetermined, and the first application divides the first data to be sent into k parts, each of which forms a first data packet, which can be divided into k first data packets evenly or into k first data packets with uneven data amounts.
  • the value of k is calculated by the sending end according to the adjustment information fed back by the target receiving end.
  • the target receiving end determines the adjustment information according to the received data and feeds it back to the sending end, and the sending end determines the k value according to the adjustment information to adjust the k value.
  • the k value can be set to an initial value, and the initial k value is used to process the first data to be sent when the first data to be sent is sent for the first time.
  • S203 The first application program adds redundant data to each first data packet and then encodes the data packet to obtain n first encoded data packets.
  • the first encoded data packet can be understood as the data obtained after the first data packet is encoded.
  • Packet, n is an integer greater than k.
  • the first application adds redundant data to each first data packet, and then encodes it according to a preset encoding rule to generate n first encoded data packets.
  • S204 The first application program adds the first preset link parameter to each first encoded data packet to obtain first target data.
  • the first application program adds the first preset link parameter to each first coded data packet, and can directly add it to the header, tail or other fields of the first coded data packet to obtain the first target data containing the first preset link parameter.
  • the first preset link parameter can be added to a fixed field of the first coded data packet, or can be added to a non-fixed field. Adding to fixed fields such as the header and tail can facilitate subsequent data parsing.
  • the present application can use a forward error correction algorithm (Forward Error Correction, FEC) to perform data redundancy processing on the data to be sent.
  • FEC Forward Error Correction
  • the sender adds some overhead (redundant information) to each data packet; the receiving end can recover the complete valid data based on the valid data and overhead even if a certain number of data packets are lost according to the received valid data and overhead.
  • This application can directly perform data redundancy processing on the underlying link, optimize transmission packet loss, reduce the complexity of application data processing, and thus reduce the burden on the application.
  • the first wireless communication module parses the first target data to determine the first data to be broadcast and the first preset link parameter, and broadcasts the first data to be broadcast according to the first preset link parameter, so that the first data to be broadcast is received by the target receiving end.
  • the first wireless communication module can parse the first target data according to fields.
  • the header data in the first target data is the first preset link parameter.
  • the first target data is parsed by directly parsing the header data to obtain the first preset link parameter, and the remaining data after removing the header data is used as the first data to be broadcast, that is, each first encoded data packet can be directly used as the first data to be broadcast.
  • the first preset link parameter includes at least one of the following: single-packet encoding mode, single-packet sending data size, data packet sending speed and modulation mode.
  • the single-packet encoding method can be understood as the encoding method of each data packet; the single-packet sending data size can be understood as the size of the data included in each data packet; the modulation method can be phase shift keying (PSK), binary phase shift keying (BPSK), frequency shift keying (FSK), amplitude shift keying (ASK), etc.
  • PSK phase shift keying
  • BPSK binary phase shift keying
  • FSK frequency shift keying
  • ASK amplitude shift keying
  • the single packet encoding method, the single packet transmission data size, the data packet transmission speed and the modulation method are determined accordingly, that is, the method used to transmit the first coded data packet is determined.
  • the first wireless communication module sends the first data to be broadcast according to the single-packet encoding mode, the single-packet transmission data size, the data packet transmission speed and the modulation mode.
  • the first wireless communication module broadcasts data through a wireless network communication broadcast link (i.e., a wifibroadcast link), and the processed first data to be broadcasted is broadcasted through the wireless network communication broadcast link and can be broadcasted to nearby devices.
  • a wireless network communication broadcast link i.e., a wifibroadcast link
  • the processed first data to be broadcasted is broadcasted through the wireless network communication broadcast link and can be broadcasted to nearby devices.
  • the first data to be broadcasted is broadcasted through the wireless network communication broadcast link, it is sent at a data packet sending speed.
  • FIG3 is a timing diagram of a data transmission applied to a sending end provided in an embodiment of the present application, wherein the sending end includes a first application 31, a first upper layer application 32, and a first wireless communication module 33.
  • the first upper layer application 32 is an application in the sending end that has the need to transmit UDP data
  • the first application 31 is used to obtain the first data to be sent formed by the first upper layer application 32
  • the first application 31 includes a UDP listening module 311 and a data redundancy processing module 312
  • the first wireless communication module 33 is configured to broadcast the first data to be broadcasted.
  • the first upper layer application 32 is an upper layer application relative to the first application 31.
  • the first wireless communication module 33 is set in monitor mode.
  • the first upper layer application 32 generates the first data to be sent encapsulated by the UDP protocol, and transmits the first data to be sent to the UDP port.
  • the first application 31 monitors the UDP port through the UDP monitoring module 311, verifies the acquired first data to be sent, for example, verifies the length of the first data to be sent, and when the verification is passed, sends the first data to be sent to the data redundancy processing module 312 through a redundancy processing request.
  • the data redundancy processing module 312 performs data redundancy processing on the first data to be sent, and injects the processed first target data into the first wireless communication module 33 through the data interface in the Packet Capture library (libpcap).
  • the first wireless communication module 33 determines the first preset link parameter and the first data to be broadcast by parsing the first target data, and the first wireless communication module 33 sends the first data to be broadcast according to the first preset link parameter.
  • the embodiment of the present application provides a data transmission method, which is applied to the transmitting end.
  • the embodiment includes verifying the first data length of the first data to be sent, performing data redundancy processing on the first data to be sent, and adding the first preset link parameter to obtain the first target data.
  • the first preset link parameter is predefined, and the data is broadcast according to the first preset link parameter, which improves the data transmission efficiency;
  • the present application adopts the wifibroadcast link as the transmission link, and flexibly adjusts the link parameters to meet the needs of data transmission in different scenarios, and improves the user experience while improving the transmission efficiency.
  • the present application performs data redundancy processing on the underlying link, optimizes the situation of transmission packet loss, reduces the probability of transmission packet loss, and improves the accuracy of data transmission.
  • FIG4 is a flow chart of a data transmission method provided in Embodiment 3 of the present application, which is applied to a data transmission device, wherein the data transmission device includes a processor, a memory, a communication interface, and a second wireless communication module, wherein the memory, the communication interface, and the second wireless communication module are all electrically connected to the processor, the second wireless communication module is set to a monitoring mode, the memory stores a second application program, and the second application program stores a second preset link parameter.
  • the method includes:
  • S401 A communication interface establishes a connection with a source device.
  • the communication interface may be a Type-A interface, a Type-C interface, or other types of USB interfaces.
  • the source device may be an electronic device such as a laptop, a desktop computer, a smart phone, a smart tablet, etc.
  • the communication interface of the data transmission device may be connected to the source device via a data cable, and after the connection, the video, audio, and other data sent by the source device may be received.
  • the application scenario of this embodiment may be: the source device projects the screen to the target receiving end through the data transmission device. After the data transmission device is connected to the source device through the communication interface, the data of the source device can be shared to the target receiving end.
  • S402 The processor obtains shared data generated by the source device through the communication interface.
  • shared data can be understood as data shared by the source device to the target receiving end, which can be audio data, video data or other types of data.
  • the application Y in the source device needs to send data to the outside world, it generates shared data. After the source device generates the shared data, it sends it to the communication interface of the data transmission device, and the processor of the data transmission device obtains the shared data through the communication interface.
  • the processor executes a second application based on the shared data, where the second application is used to obtain second data to be sent encapsulated using a user datagram protocol based on the shared data, and processes the second data to be sent according to a second preset link parameter to obtain second target data.
  • the second application can be understood as an application used to process the second data to be transmitted during the data transmission process; the second data to be transmitted can be understood as data to be sent to an external device.
  • the second preset link parameters can be understood as parameters of the transmission link when transmitting the second data to be transmitted, such as transmission speed, encoding method, etc.
  • the second preset link parameters can be used to guide the second wireless communication module on how to send data.
  • the second target data can be understood as data obtained after processing the second data to be transmitted.
  • the processor processes the shared data into second data to be sent encapsulated by the user datagram protocol, and the second data to be sent is sent to the UDP port through the UDP protocol.
  • the second application obtains the second data to be sent by monitoring the UDP port.
  • the second application stores the pre-set second preset link parameters, which can be customized in advance according to the usage scenario, requirements, etc.
  • the second preset link parameters are of the same parameter type as the first preset link parameters.
  • the second data to be sent is processed according to the second preset link parameters to obtain the second target data, which can be directly added to the second preset link parameters.
  • the second target data can be obtained from the transmitted data, or the second data to be transmitted can be processed and then the second preset link parameter can be added to obtain the second target data.
  • S404 The processor sends the second target data to the second wireless communication module.
  • the second wireless communication module can be understood as a module in a data transmission device that performs data transmission via a wireless transmission link, such as a network card.
  • the processor receives the second target data sent by the second application and sends it to the second wireless communication module.
  • the second wireless communication module parses the second target data to determine second data to be broadcast and second preset link parameters, and broadcasts the second data to be broadcast according to the second preset link parameters, so that the second data to be broadcast is received by the target receiving end.
  • the second data to be broadcast can be understood as data that needs to be broadcast to other devices.
  • the second data to be broadcast can be data obtained by processing the second data to be sent, or the second data to be sent can be directly used as the second data to be broadcast.
  • the second wireless communication module is set to monitoring mode to monitor the data sent by the second application. By setting the second wireless communication module to monitoring mode, data interception is avoided.
  • the second wireless communication module parses the second target data, and can parse according to the field to obtain the second data to be broadcast that can be used for transmission, and the second preset link parameters for guiding the second wireless communication module on how to transmit data.
  • the second data to be broadcast is packaged, encoded, and processed according to the second preset link parameters, and then broadcast and sent outward at a certain transmission speed.
  • the second data to be broadcast can be sent according to the customized second preset link parameters to meet the needs of users.
  • the second wireless communication module broadcasts the second data to be broadcast to the target receiving end.
  • the second wireless communication module broadcasts data via a wireless network communication broadcast link (ie, a wifibroadcast link).
  • a wireless network communication broadcast link ie, a wifibroadcast link
  • An embodiment of the present application provides a data transmission method, which is applied to a data transmission device.
  • the data transmission device includes a processor, a memory, a communication interface, and a second wireless communication module.
  • the second wireless communication module is set to a listening mode.
  • the second preset link parameters are predefined.
  • the second preset link parameters are used to guide data transmission.
  • the second wireless communication module broadcasts the second data to be broadcast through the second preset link parameters.
  • the second preset link parameters can be flexibly set and adjusted according to needs, which can meet the needs of data transmission in different scenarios, improve user experience, and improve data transmission efficiency.
  • the data transmission method also includes after the second application obtains the second data to be sent encapsulated by the user datagram protocol based on the shared data, the second application determines the second data length of the second data to be sent and verifies the length of the second data.
  • the second data length can be understood as the data length of the second data to be sent.
  • the data length of the second data to be sent there may also be a data length requirement, so the data length of the second data to be sent needs to be verified.
  • the second data length of the second data to be sent can be determined based on the second data to be sent after the second data to be sent is obtained, or it can be obtained from the data sender of the second data to be sent while the second data to be sent is obtained.
  • the second data length is verified.
  • the verification method can be to pre-set a length threshold to determine whether the second data length is greater than the length threshold. If the second data length is greater than the length threshold, the length verification result of the second data to be sent is determined to be a verification failure; if the second data length is less than or equal to the length threshold, the length verification result of the second data to be sent is determined to be a verification success. If the verification fails, the second data to be sent is not processed or sent. If the verification is successful, continue to perform the following operations to process and send the second data to be sent.
  • the second application processes the second data to be sent according to the second preset link parameters to obtain second target data, including: the second application divides the second data to be sent into m second data packets, where m is the grouping parameter; the second application adds redundant data to each second data packet and encodes it to obtain i second encoded data packets; the second application adds the second preset link parameters to each second encoded data packet to obtain the second target data.
  • the second data packet can be understood as a data packet formed by the second data blocks to be sent.
  • the second encoded data packet can be understood as a data packet obtained after the second data packet is encoded.
  • the grouping parameter m is predetermined, and the second application divides the second data to be sent into m parts, each of which forms a second data packet.
  • the second application can be divided into m second data packets evenly or into m second data packets with uneven data amounts.
  • the second application adds redundant data to each second data packet, and then encodes it according to a preset encoding rule to generate i second encoded data packets.
  • the second application adds the second preset link parameter to the header, tail or other field of each second encoded data packet to obtain the second target data containing the second preset link parameter.
  • the value of m is calculated by the data transmission device according to adjustment information fed back by the target receiving end.
  • the target receiving end determines adjustment information according to the received data and feeds it back to the data transmission device, and the data transmission device determines the m value according to the adjustment information to adjust the m value.
  • the m value can be set to an initial value, and the initial m value is used to process the second data to be sent when the second data to be sent is sent for the first time.
  • the second preset link parameter includes at least one of the following: a single-packet encoding mode, a single-packet transmission data size, a data packet transmission speed, and a modulation mode.
  • the present application embodiment provides a data transmission method, which is applied to a data transmission device.
  • the invention includes verifying the second data length of the second data to be sent, performing data redundancy processing on the second data to be sent, and adding a second preset link parameter to obtain the second target data.
  • the second preset link parameter is predefined, and data is broadcast according to the second preset link parameter, thereby improving data transmission efficiency.
  • the present application adopts a wifi broadcast link as a transmission link, and flexibly adjusts the link parameters to meet the needs of data transmission in different scenarios, thereby improving the transmission efficiency and user experience.
  • the present application performs data redundancy processing on the underlying link, optimizes the situation of transmission packet loss, reduces the probability of transmission packet loss, and improves the accuracy of data transmission.
  • FIG5 is a flow chart of a data transmission method provided in Embodiment 4 of the present application, which is applied to a target receiving end, wherein the target receiving end includes a third wireless communication module, a third application program, and an upper layer application program, and the third wireless communication module is set to a monitoring mode.
  • the method includes:
  • the third wireless communication module receives data to be broadcast, and the data to be broadcast is sent according to the data transmission method in any embodiment.
  • the data to be broadcast can be understood as data received by the target receiving end, and the data to be broadcast can be the first data to be broadcast or the second data to be broadcast.
  • the target receiving end establishes a communication link with an external device that is a transmitting end or a data transmission device, and receives the data sent by the external device through the communication link.
  • the number of external devices can be one or more.
  • the target receiving end can be an electronic device such as an interactive tablet.
  • the target receiving end in this application can receive the first data to be broadcasted sent by the sending end, and can also receive the second data to be broadcasted sent by the data transmission device.
  • screen transmission both the target receiving end and the sending end can directly transmit the screen through the screen transmission software; or, the data transmission device acts as a screen transmitter, and the source device is connected to the target receiving end through the data transmission device to realize screen transmission.
  • the data to be broadcast is received via a wireless network communication broadcast link.
  • the target receiving end establishes a wireless network communication broadcast link (wifibroadcast link) with the sending end, transmits data through the wifibroadcast link, and the target receiving end receives the data to be broadcast through the wifibroadcast link.
  • a wireless network communication broadcast link (wifibroadcast link)
  • the third application obtains the data to be broadcast received by the third wireless communication module, and when it is determined that the processing conditions are met, sends the data to be broadcast to the port corresponding to the upper-layer application so that the upper-layer application obtains the data to be broadcast.
  • the third application can be understood as an application used to process data obtained from other devices during data transmission;
  • the processing condition can be understood as a condition for determining whether the target receiving end processes the received data to be broadcast.
  • the target receiving end processes the received data to be broadcast.
  • the third application program at the end performs operations such as processing and forwarding on the broadcast data.
  • the upper layer application program can be understood as an application at the target receiving end that has a need to obtain the broadcast data.
  • the third application calls the pcap (libpcap) library to capture the data to be broadcast received by the third wireless communication module.
  • the processing conditions are set in advance, and the target receiving end is judged whether the processing conditions are met according to the information and parameters of the target receiving end.
  • the upper-layer application that receives the data to be broadcast is determined.
  • the upper-layer application can be set in advance, for example, one or more applications in the target receiving end are used as the upper-layer application; it can also be determined according to the data to be broadcast.
  • it can be determined according to the data type of the data to be broadcast, or the information of the upper-layer application corresponding to the indication data can be carried in the data to be broadcast.
  • the data to be broadcast is sent to the UDP port monitored by the upper-layer application, and the upper-layer application obtains the data to be broadcast through the UDP port.
  • Data from the sender to the target receiving end is a one-way transmission of data. For the same device, it can act as a sender to send data outward, and it can also act as a target receiving end to receive data.
  • the processing condition is that the target address corresponding to the data to be broadcast matches the address of the target receiving end, and the networking address corresponding to the data to be broadcast matches the networking address of the target receiving end.
  • the target address can be understood as the destination where the broadcast data is transmitted, such as the first address in Figure 1A;
  • the networking address can be understood as the address agreed upon by the devices when networking, and the networking address corresponding to the broadcast data is such as the third address in Figure 1A.
  • the embodiment of the present application provides a data transmission method, which is applied to a target receiving end, and receives the data to be broadcast.
  • the data to be broadcast is sent to the port corresponding to the third application so that the third application can obtain the data to be broadcast.
  • the data to be broadcast is sent by the sending end or the data transmission device according to the first preset link parameter or the second preset link parameter.
  • the first preset link parameter and the second preset link parameter can be flexibly adjusted, which improves the data transmission efficiency, can meet the needs of data transmission in different scenarios, and improves the user experience.
  • the method also includes, before the third application sends the data to be broadcast to the port corresponding to the upper-layer application, the third application performs redundancy recovery based on the data to be broadcast, and calculates the current packet loss rate of the data to be broadcast based on the redundantly recovered data; the third application determines the grouping parameter k or m based on the current packet loss rate, and feeds back the grouping parameter as adjustment information to the sending end or data transmission device.
  • the current packet loss rate may be understood as the packet loss rate of the currently received data to be broadcasted.
  • the target receiving end Since the sender performs redundant processing on the data when sending the data, the target receiving end performs redundant recovery on the data to be broadcast before sending the data to be broadcast to the port corresponding to the upper-layer application, and restores the data according to the data to be broadcast and the decoding rules to obtain the original data, that is, the first data to be sent or the second data to be sent. Redundant recovery and data redundancy processing use the same algorithm.
  • the data obtained by redundantly recovering the data to be broadcast is sent to the port corresponding to the upper-layer application.
  • the current packet loss rate of the data to be broadcast is calculated based on the redundantly recovered data, and the grouping parameter k or m is calculated based on the current packet loss rate.
  • the calculated grouping parameter k is fed back to the sender as adjustment information; when the received data to be broadcast is the second data to be broadcast, the calculated grouping parameter m is fed back to the data transmission device as adjustment information.
  • This application performs data redundancy processing on the underlying link to optimize the situation of transmission packet loss. After data redundancy processing is performed on the sending end, corresponding redundancy recovery is performed on the receiving end, effectively reducing the probability of transmission packet loss and improving data transmission accuracy.
  • FIG6 is a timing diagram of data transmission applied to a target receiving end provided by an embodiment of the present application, wherein the target receiving end includes a third wireless communication module 51, a third application 52, a UDP port 53, and a second upper layer application 54.
  • the third wireless communication module 51 is configured to receive data to be broadcasted sent by an external device
  • the third application 52 is used to execute the data transmission method of the present application
  • the second upper layer application 54 is an upper layer application of the target receiving end.
  • the third application 52 includes a redundancy recovery module 521.
  • the second upper layer application 54 is an upper layer application relative to the third application 52.
  • the third wireless communication module 51 is set in the monitor mode, and the third wireless communication module 51 receives the data to be broadcast sent by the transmitter or the data transmission device.
  • the redundancy recovery module 521 in the third application 52 obtains the data to be broadcast from the third wireless communication module 51, for example, by calling the pcap library to capture the data to be broadcast received by the third wireless communication module 51, and when the data to be broadcast is subjected to data redundancy processing, the data to be broadcast is redundancy recovered, and the data obtained after redundancy recovery is forwarded to the UDP port 53.
  • the second upper layer application 54 obtains the data to be broadcast by monitoring the UDP port 53.
  • FIG5 takes the data to be broadcast subjected to data redundancy processing as an example.
  • FIG7 is an implementation example diagram of data transmission between a target receiving end and a sending end provided in an embodiment of the present application.
  • the upper layer application corresponding to the sending end is used as the first upper layer application 61
  • the upper layer application corresponding to the target receiving end is used as the second upper layer application 66.
  • the sending end includes the first upper layer application 61, the first application 62 and the first wireless communication module 63
  • the target receiving end includes the third wireless communication module 64, the third application 65 and the second upper layer application 66.
  • the first upper layer application 61 generates shared data, and encapsulates it using the UDP protocol to obtain the first data to be sent, and sends the first data to be sent to the first application 62 through the UDP protocol.
  • the first application 62 processes the first data to be sent to obtain the first target data, and injects the first target data into the first wireless communication module 63.
  • the first wireless communication module 63 determines the first preset link parameter and the first data to be broadcast according to the first target data, and processes and sends the first data to be broadcast according to the first preset link parameter.
  • the first wireless communication module 63 sends the first data to be broadcast to the third wireless communication module 64 of the target receiving end through the wifibroadcast link.
  • the third application 65 captures the data to be broadcast received by the third wireless communication module 64, processes the data to be broadcast, and sends the data to be broadcast to the second upper layer application 66 through the UDP protocol.
  • the implementation principle of data transmission between the data transmission device and the target receiving end is the same as the implementation principle of data transmission between the transmitting end and the target receiving end, which will not be repeated here and can be known by those skilled in the art.
  • FIG8 is a schematic diagram of the structure of a screen transmitter provided in Embodiment 5 of the present application.
  • the screen transmitter includes a communication interface 71, a processor 72, a second wireless communication module 73 and a memory 74.
  • the processor 72 is electrically connected to the communication interface 71, the second wireless communication module 73 and the memory 74 respectively.
  • the communication interface 71 may be a Type-A interface, a Type-C interface or other types of Universal Serial Bus (USB) interfaces, and the communication interface 71 is configured to connect to a source device to receive shared data sent by the source device and send the shared data to the processor 72.
  • USB Universal Serial Bus
  • the source device has a first processor, a memory and a first display, and the first processor is installed with a first operating system, which is pre-installed with a general driver protocol for audio and video communication between the communication interface 71 and the peripheral device, and the media content corresponding to the audio and video data is the same as the media content displayed on the first display.
  • the communication interface 71 is connected to the processor 72 to send the received shared data to the processor 72.
  • the memory 74 is configured to store a second application program, wherein the second application program stores a second preset link parameter.
  • the processor 72 is the control center of the screen transmitter, and uses multiple interfaces and lines to connect multiple parts of the entire screen transmitter. By running or executing software programs and/or modules, it performs multiple functions of the screen transmitter and processes data, thereby monitoring the screen transmitter as a whole.
  • the processor 72 obtains the shared data generated by the source device through the communication interface 71, executes the second application based on the shared data to obtain the second data to be sent encapsulated by the user datagram protocol based on the shared data, processes the second data to be sent according to the second preset link parameters to obtain the second target data, and sends the second target data to the second wireless communication module 73.
  • the second wireless communication module 73 is a modular product realized by wireless communication technology, which can send the received signal to the wireless communication network in a wireless form, so that the signal can be received by the network in the wireless communication network. Node capture. For example, WiFi modules, Bluetooth modules or ZigBee modules that are widely used in short-range local area network communications.
  • the second wireless communication module 73 is connected to the processor 72.
  • the second wireless communication module 73 provided in this embodiment can parse the second target data obtained from the processor 72, determine the second data to be broadcast and the second preset link parameters, and broadcast the second data to be broadcast according to the second preset link parameters, so as to send the second data to be broadcast to other network nodes in the wireless communication network, and then send the second data to be broadcast to the screen receiving end through the network node to display the video picture.
  • the screen transmitter provided in the embodiment of the present application can execute the data transmission method provided in the third embodiment of the present application, and has the corresponding functional modules and effects of the execution method.
  • FIG9 shows a block diagram of an electronic device 80 that can be used to implement an embodiment of the present application.
  • the electronic device can represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • the electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and/or required herein.
  • the electronic device 80 includes at least one processor 81, and a memory connected to the at least one processor 81, such as a read-only memory (ROM) 82, a random access memory (RAM) 83, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 81 can perform a variety of appropriate actions and processes according to the computer program stored in the ROM 82 or the computer program loaded from the storage unit 88 to the RAM 83. In the RAM 83, a variety of programs and data required for the operation of the electronic device 80 can also be stored.
  • the processor 81, the ROM 82, and the RAM 83 are connected to each other through a bus 84.
  • the input/output (I/O) interface 85 is also connected to the bus 84.
  • a number of components in the electronic device 80 are connected to the I/O interface 85, including: an input unit 86, such as a keyboard, a mouse, etc.; an output unit 87, such as various types of displays, speakers, etc.; a storage unit 88, such as a disk, an optical disk, etc.; and a communication unit 89, such as a network card, a modem, a wireless communication transceiver, etc.
  • the communication unit 89 allows the electronic device 80 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.
  • the processor 81 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the processor 81 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), a variety of special artificial intelligence (AI), and a variety of other processors.
  • the processor 81 may include a processor for performing artificial intelligence (AI) computing, a plurality of processors for running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc.
  • the processor 81 performs the methods and processes described above, such as the data transmission method.
  • the data transmission method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 88.
  • part or all of the computer program may be loaded and/or installed on the electronic device 80 via the ROM 82 and/or the communication unit 88.
  • the processor 81 may be configured to perform the data transmission method in any other suitable manner (e.g., by means of firmware).
  • Implementations of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOCs system on chips
  • CPLDs complex programmable logic devices
  • the computer programs for implementing the methods of the present application may be written in one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions/operations specified in the flow charts and/or block diagrams are implemented.
  • the computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
  • a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • Computer-readable storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be a machine-readable signal medium.
  • a machine-readable storage medium may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EPROM), or a flash memory. device, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) configured to display information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device.
  • a display device e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor
  • a keyboard and pointing device e.g., a mouse or trackball
  • Other types of devices may also be configured to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
  • the systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components.
  • the components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN), blockchain network, and the Internet.
  • a computing system may include a client and a server.
  • the client and the server are generally remote from each other and usually interact through a communication network.
  • the client-server relationship is generated by running computer programs on the computers that have a client-server relationship with each other.
  • the server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.
  • VPN virtual private servers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A data transmission method, an electronic device, a screen transmitter and a storage medium. The method is applied to a sending end, the sending end comprises a first wireless communication module and a first application program, and the first wireless communication module is set to be in a monitoring mode. The method comprises: a first application program acquiring first data to be sent, which is packaged with a user datagram protocol, and processing, according to a first preset link parameter, the first data to be sent to obtain first target data (S101); and a first wireless communication module parsing the first target data to determine first data to be broadcast and the first preset link parameter, and broadcasting, according to the first preset link parameter, the first data to be broadcast so that the first data to be broadcast is received by a target receiving end (S102).

Description

数据传输方法、电子设备、传屏器及存储介质Data transmission method, electronic device, screen transmitter and storage medium
本申请要求在2022年10月08日提交中国专利局、申请号为202211222789.6的中国专利申请的优先权,以上申请的全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the China Patent Office on October 8, 2022, with application number 202211222789.6. The entire contents of the above application are incorporated by reference into this application.
技术领域Technical Field
本申请涉及通信技术领域,例如涉及一种数据传输方法、电子设备、传屏器及存储介质。The present application relates to the field of communication technology, for example, to a data transmission method, an electronic device, a screen transmitter and a storage medium.
背景技术Background technique
用户数据报协议(User Datagram Protocol,UDP)是开放式系统互联(Open System Interconnection,OSI)参考模型中一种无连接的传输层协议,UDP提供面向事物的简单不可靠信息传送服务。User Datagram Protocol (UDP) is a connectionless transport layer protocol in the Open System Interconnection (OSI) reference model. UDP provides a simple, unreliable, transaction-oriented information transmission service.
当前标准UDP协议是使用分层设计的,底层链路通过以太网或者通过基于连接的无线通信网络技术(Wireless Fidelity,WiFi)链路进行实际数据传输,标准UDP协议无法自定义底层传输链路参数,只能按照协议规定的参数进行数据发送,发送效率较低,无法满足不同场景的需求。The current standard UDP protocol uses a layered design. The underlying link performs actual data transmission through Ethernet or through a connection-based wireless communication network technology (Wireless Fidelity, WiFi) link. The standard UDP protocol cannot customize the underlying transmission link parameters and can only send data according to the parameters specified in the protocol. The transmission efficiency is low and cannot meet the needs of different scenarios.
发明内容Summary of the invention
本申请提供了一种数据传输方法、电子设备、传屏器及存储介质,以解决数据传输过程中只能按照标准UDP协议进行传输的问题。The present application provides a data transmission method, an electronic device, a screen transmitter and a storage medium to solve the problem that data transmission can only be performed according to the standard UDP protocol during the data transmission process.
本申请提供了一种数据传输方法,应用于发送端,发送端包括第一无线通信模组和第一应用程序,所述第一无线通信模组设置为监听模式,包括:The present application provides a data transmission method, which is applied to a transmitting end, wherein the transmitting end includes a first wireless communication module and a first application program, wherein the first wireless communication module is set to a monitoring mode, including:
所述第一应用程序获取采用用户数据报协议封装的第一待发送数据,并根据第一预设链路参数对所述第一待发送数据进行处理以得到第一目标数据;The first application obtains first data to be sent encapsulated in the user datagram protocol, and processes the first data to be sent according to a first preset link parameter to obtain first target data;
所述第一无线通信模组对所述第一目标数据进行解析确定第一待广播数据以及第一预设链路参数,根据所述第一预设链路参数广播所述第一待广播数据,以使所述第一待广播数据被目标接收端接收。The first wireless communication module parses the first target data to determine first data to be broadcast and first preset link parameters, and broadcasts the first data to be broadcast according to the first preset link parameters, so that the first data to be broadcast is received by a target receiving end.
本申请提供了一种数据传输方法,应用于数据传输设备,所述数据传输设备包括处理器、存储器、通信接口和第二无线通信模组,所述存储器、通信接口、第二无线通信模组均与所述处理器形成电连接,所述第二无线通信模组设置为监听模式,所述存储器存储有第二应用程序,所述第二应用程序存储有第二预设链路参数;The present application provides a data transmission method, which is applied to a data transmission device, wherein the data transmission device includes a processor, a memory, a communication interface, and a second wireless communication module, wherein the memory, the communication interface, and the second wireless communication module are all electrically connected to the processor, the second wireless communication module is set to a listening mode, the memory stores a second application, and the second application stores a second preset link parameter;
所述数据传输方法包括: The data transmission method comprises:
所述通信接口与源设备建立连接;The communication interface establishes a connection with a source device;
所述处理器通过所述通信接口获取所述源设备生成的共享数据;The processor acquires the shared data generated by the source device through the communication interface;
所述处理器基于所述共享数据执行所述第二应用程序,所述第二应用程序用于获取基于所述共享数据形成的采用用户数据报协议封装的第二待发送数据,并根据第二预设链路参数对所述第二待发送数据进行处理以得到第二目标数据;The processor executes the second application based on the shared data, the second application being used to obtain second data to be sent encapsulated in a user datagram protocol based on the shared data, and processes the second data to be sent according to a second preset link parameter to obtain second target data;
所述处理器将所述第二目标数据发给所述第二无线通信模组;The processor sends the second target data to the second wireless communication module;
所述第二无线通信模组对所述第二目标数据进行解析确定第二待广播数据以及第二预设链路参数,根据所述第二预设链路参数广播所述第二待广播数据,以使所述第二待广播数据被目标接收端接收。The second wireless communication module parses the second target data to determine second data to be broadcast and second preset link parameters, and broadcasts the second data to be broadcast according to the second preset link parameters so that the second data to be broadcast is received by the target receiving end.
本申请提供了一种数据传输方法,应用于目标接收端,目标接收端包括第三无线通信模组、第三应用程序和上层应用程序,所述第三无线通信模组设置为监听模式,包括:The present application provides a data transmission method, which is applied to a target receiving end, wherein the target receiving end includes a third wireless communication module, a third application program, and an upper layer application program, wherein the third wireless communication module is set to a monitoring mode, including:
所述第三无线通信模组接收待广播数据,所述待广播数据根据本申请任一实施例所提供的数据传输方法发送;The third wireless communication module receives the data to be broadcast, and the data to be broadcast is sent according to the data transmission method provided in any embodiment of the present application;
所述第三应用程序获取所述第三无线通信模组所接收的待广播数据,并在确定满足处理条件的情况下,将所述待广播数据发送至上层应用程序所对应的端口,以便所述上层应用程序获取所述待广播数据。The third application obtains the data to be broadcast received by the third wireless communication module, and when it is determined that the processing conditions are met, sends the data to be broadcast to the port corresponding to the upper-layer application so that the upper-layer application obtains the data to be broadcast.
本申请提供了一种电子设备,所述电子设备包括:The present application provides an electronic device, the electronic device comprising:
至少一个处理器;以及at least one processor; and
与所述至少一个处理器通信连接的存储器;a memory communicatively coupled to the at least one processor;
其中,所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行本申请任一实施例所述的数据传输方法。The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data transmission method described in any embodiment of the present application.
本申请提供了一种传屏器,包括处理器、存储器、通信接口和第二无线通信模组,所述存储器、通信接口、第二无线通信模组均与所述处理器形成电连接;The present application provides a screen transmitter, comprising a processor, a memory, a communication interface and a second wireless communication module, wherein the memory, the communication interface and the second wireless communication module are all electrically connected to the processor;
所述通信接口,设置为与源设备连接;The communication interface is configured to connect to a source device;
所述存储器,设置为存储第二应用程序,所述第二应用程序存储有第二预设链路参数;The memory is configured to store a second application program, wherein the second application program stores a second preset link parameter;
所述处理器,设置为通过所述通信接口获取所述源设备生成的共享数据,基于所述共享数据执行所述第二应用程序以获取基于所述共享数据形成的采用 用户数据报协议封装的第二待发送数据,根据第二预设链路参数对所述第二待发送数据进行处理以得到第二目标数据,将所述第二目标数据发给所述第二无线通信模组;The processor is configured to obtain shared data generated by the source device through the communication interface, execute the second application based on the shared data to obtain an adopted second data to be sent encapsulated in a user datagram protocol, processing the second data to be sent according to a second preset link parameter to obtain second target data, and sending the second target data to the second wireless communication module;
第二无线通信模组,设置为对所述第二目标数据进行解析确定第二待广播数据以及第二预设链路参数,根据所述第二预设链路参数广播所述第二待广播数据,以使所述第二待广播数据被目标接收端接收。The second wireless communication module is configured to parse the second target data to determine second data to be broadcast and second preset link parameters, and broadcast the second data to be broadcast according to the second preset link parameters so that the second data to be broadcast is received by the target receiving end.
本申请提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使处理器执行时实现本申请任一实施例所述的数据传输方法。The present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data transmission method described in any embodiment of the present application when executed.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是根据本申请实施例一提供的一种数据传输方法的流程图;FIG1 is a flow chart of a data transmission method provided according to Embodiment 1 of the present application;
图1A是根据本申请实施例一提供的一种数据报文格式的示例图;FIG1A is an example diagram of a data message format provided according to Embodiment 1 of the present application;
图2是根据本申请实施例二提供的一种数据传输方法的流程图;FIG2 is a flow chart of a data transmission method provided according to Embodiment 2 of the present application;
图3是根据本申请实施例二提供的一种应用于发送端的数据传输的时序图;FIG3 is a timing diagram of data transmission applied to a transmitting end according to Embodiment 2 of the present application;
图4是根据本申请实施例三提供的一种数据传输方法的流程图;FIG4 is a flow chart of a data transmission method provided according to Embodiment 3 of the present application;
图5是根据本申请实施例四提供的一种数据传输方法的流程图;FIG5 is a flow chart of a data transmission method provided according to Embodiment 4 of the present application;
图6是根据本申请实施例四提供的一种应用于目标接收端的数据传输的时序图;6 is a timing diagram of data transmission applied to a target receiving end according to a fourth embodiment of the present application;
图7是根据本申请实施例四提供的一种目标接收端和发送端之间的数据传输的实现示例图;7 is a diagram showing an implementation example of data transmission between a target receiving end and a transmitting end according to a fourth embodiment of the present application;
图8是根据本申请实施例五提供的一种传屏器的结构示意图;FIG8 is a schematic diagram of the structure of a screen transmitter provided according to Embodiment 5 of the present application;
图9是实现本申请实施例六提供的一种电子设备的结构示意图。FIG9 is a schematic diagram of the structure of an electronic device provided in accordance with the sixth embodiment of the present application.
具体实施方式Detailed ways
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的 其它步骤或单元。The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, but not necessarily to describe a specific order or sequence. It should be understood that the numbers used in this way are interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in orders other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include steps or units that are not clearly listed or inherent to these processes, methods, products or apparatuses. Other steps or units.
实施例一Embodiment 1
图1为本申请实施例一提供了一种数据传输方法的流程图,本实施例可适用于对数据进行传输的情况,该方法可以由发送端来执行,该发送端可以是智能手机、平板、台式计算机、笔记本等电子设备。发送端包括第一无线通信模组和第一应用程序,第一无线通信模组设置为监听模式,如图1所示,该方法包括:FIG1 is a flowchart of a data transmission method provided in Embodiment 1 of the present application. This embodiment is applicable to the case of data transmission. The method can be executed by a transmitting end, which can be an electronic device such as a smart phone, a tablet, a desktop computer, a notebook, etc. The transmitting end includes a first wireless communication module and a first application. The first wireless communication module is set to a monitoring mode. As shown in FIG1, the method includes:
S101、第一应用程序获取采用用户数据报协议封装的第一待发送数据,并根据第一预设链路参数对第一待发送数据进行处理以得到第一目标数据。S101. A first application program obtains first data to be sent encapsulated in a user datagram protocol, and processes the first data to be sent according to a first preset link parameter to obtain first target data.
在本实施例中,第一应用程序可以理解为数据传输过程中用于对需要传输的第一待发送数据进行处理的应用程序;第一待发送数据可以理解为需要向外部设备发送的数据。第一待发送数据由发送端中的一应用程序产生,例如,视频播放程序、音频播放程序等。同一个设备既可以作为发送端,也可以作为接收端,本申请实施例以设备作为发送端,向外部设备发送数据为例。第一预设链路参数可以理解为传输第一待发送数据时的传输链路的参数,例如,传输速度、编码方式等。第一目标数据可以理解为对第一待发送数据进行处理后得到的数据,可用于指导第一无线通信模组如何发送数据。In this embodiment, the first application can be understood as an application used to process the first data to be sent that needs to be transmitted during the data transmission process; the first data to be sent can be understood as data that needs to be sent to an external device. The first data to be sent is generated by an application in the sending end, such as a video player, an audio player, etc. The same device can be used as both a sending end and a receiving end. The embodiment of the present application takes the device as a sending end and sends data to an external device as an example. The first preset link parameter can be understood as the parameter of the transmission link when transmitting the first data to be sent, such as the transmission speed, encoding method, etc. The first target data can be understood as the data obtained after processing the first data to be sent, which can be used to guide the first wireless communication module on how to send data.
设备中的应用程序X在需要向外界发送数据时,生成共享数据,共享数据经由应用层、表示层、会话层传输到传输层,得到采用用户数据报协议(以下简称UDP协议)进行封装的第一待发送数据,第一待发送数据通过UDP协议发送至UDP端口,第一应用程序通过监听UDP端口获取第一待发送数据。第一应用程序中存储预先设置的第一预设链路参数,可以预先根据使用场景、需求等自定义第一预设链路参数,例如,在对传输速度要求较高时,在设置第一预设链路参数时,设置较高的传输速度,用户可以根据不同场景下的需求对第一预设链路参数进行灵活调整。根据第一预设链路参数对第一待发送数据进行处理得到第一目标数据,可以是直接将第一预设链路参数加入至第一待发送数据中得到第一目标数据,也可以对第一待发送数据进行处理,然后加入第一预设链路参数得到第一目标数据。第一应用程序将第一目标数据发送给第一无线通信模组,第一无线通信模组根据第一目标数据进行数据传输。When the application X in the device needs to send data to the outside world, it generates shared data, and the shared data is transmitted to the transport layer via the application layer, the presentation layer, and the session layer, and the first data to be sent encapsulated by the user datagram protocol (hereinafter referred to as the UDP protocol) is obtained. The first data to be sent is sent to the UDP port through the UDP protocol, and the first application obtains the first data to be sent by monitoring the UDP port. The first preset link parameters set in advance are stored in the first application, and the first preset link parameters can be customized in advance according to the use scenario, requirements, etc. For example, when the transmission speed is required to be high, a higher transmission speed is set when setting the first preset link parameters, and the user can flexibly adjust the first preset link parameters according to the requirements in different scenarios. The first target data is obtained by processing the first data to be sent according to the first preset link parameters, which can be directly added to the first data to be sent to obtain the first target data, or the first data to be sent can be processed and then the first preset link parameters are added to obtain the first target data. The first application sends the first target data to the first wireless communication module, and the first wireless communication module performs data transmission according to the first target data.
S102、第一无线通信模组对第一目标数据进行解析确定第一待广播数据以及第一预设链路参数,根据第一预设链路参数广播第一待广播数据,以使第一待广播数据被目标接收端接收。S102: The first wireless communication module parses the first target data to determine the first data to be broadcast and the first preset link parameter, and broadcasts the first data to be broadcast according to the first preset link parameter, so that the first data to be broadcast is received by the target receiving end.
在本实施例中,第一无线通信模组可以理解为发送端中通过无线传输链路 进行数据传输的模块,例如,网卡;第一待广播数据可以理解为具有广播到其他设备需求的数据,第一待广播数据可以是对第一待发送数据进行处理后得到的数据,也可以直接将第一待发送数据作为第一待广播数据。目标接收端可以理解为第一待广播数据传输的最终目的地。In this embodiment, the first wireless communication module can be understood as a wireless transmission link in the transmitting end. A module for data transmission, such as a network card; the first data to be broadcast can be understood as data that needs to be broadcast to other devices, and the first data to be broadcast can be data obtained after processing the first data to be sent, or the first data to be sent can be directly used as the first data to be broadcast. The target receiving end can be understood as the final destination of the first data to be broadcast.
第一无线通信模组设置为监听模式,监听第一应用程序所发送的数据。通过将第一无线通信模组设置为监听模式,避免数据被拦截。第一无线通信模组接收到第一目标数据后,对第一目标数据进行解析,可以按照字段进行解析,得到可用于传输的第一待广播数据,以及用于指导第一无线通信模组如何传输数据的第一预设链路参数。根据第一预设链路参数对第一待广播数据进行数据打包、编码等处理,然后按照一定的传输速度向外广播发送。第一待广播数据可以按照自定义的第一预设链路参数进行发送,满足用户的需求。第一无线通信模组将第一待广播数据广播到目标接收端。The first wireless communication module is set to the monitoring mode to monitor the data sent by the first application. By setting the first wireless communication module to the monitoring mode, data interception is avoided. After receiving the first target data, the first wireless communication module parses the first target data, and can parse it according to the field to obtain the first data to be broadcast that can be used for transmission, and the first preset link parameters for guiding the first wireless communication module on how to transmit data. The first data to be broadcast is packaged, encoded, and processed according to the first preset link parameters, and then broadcast and sent outward at a certain transmission speed. The first data to be broadcast can be sent according to the customized first preset link parameters to meet the needs of users. The first wireless communication module broadcasts the first data to be broadcast to the target receiving end.
第一无线通信模组在广播第一待广播数据时,可以将第一待广播数据通过组网策略发送至目标发送端。在同一个网络中,设备之间的通信约定好一个唯一地址(bssid)作为该网络的唯一标识(Identifier,ID)。客户端在该网络通信时必须先获取到该网络的bssid作为自己的第三地址(决定在那个网络)发送数据包,同时自己也通过第三地址过滤接收的数据包是否是本网络的。设备通信时,通过指定第一地址(即目标地址,决定发送给谁)来确定发送给哪个具体的设备,当第一地址取值为全FF时代表广播通信,其它设备均可以收到。第二地址是自己的地址,代表是谁发送的,一般取自己网卡的媒体存取控制(Media Access Control,MAC)地址。其中,上述设备是指包含无线通信模组的电子设备。示例性的,图1A为一种数据报文格式的示例图,第一待广播数据在广播时可采用此种格式进行封装以及广播,图中的其他数据中可携带所发送的具体数据内容。When the first wireless communication module broadcasts the first data to be broadcast, it can send the first data to be broadcast to the target sending end through the networking strategy. In the same network, the communication between devices agrees on a unique address (bssid) as the unique identifier (ID) of the network. When the client communicates on the network, it must first obtain the bssid of the network as its third address (determines which network) to send data packets, and at the same time, it also filters the received data packets through the third address to see if they are from this network. When the devices communicate, the first address (i.e., the target address, which determines to whom it is sent) is specified to determine which specific device to send to. When the first address is all FF, it represents broadcast communication, and other devices can receive it. The second address is its own address, which represents who sent it, and generally takes the media access control (MAC) address of its own network card. Among them, the above-mentioned device refers to an electronic device including a wireless communication module. Exemplarily, Figure 1A is an example diagram of a data message format. The first data to be broadcast can be encapsulated and broadcasted in this format when broadcasting, and the other data in the figure can carry the specific data content sent.
本申请实施例提供了一种数据传输方法,应用于发送端,发送端包括第一无线通信模组和第一应用程序,第一无线通信模组设置为监听模式,通过预先定义第一预设链路参数,第一预设链路参数用于指导数据传输,根据第一预设链路参数对第一待发送数据进行处理得到第一目标数据并发送给第一无线通信模组,第一无线通信模组通过对第一目标数据进行解析确定第一待广播数据和第一预设链路参数,通过第一预设链路参数对第一待广播数据进行广播,第一预设链路参数可以根据需求灵活设置及调整,可以满足不同场景下对数据传输的需求,提高用户体验,同时提高了数据发送效率。An embodiment of the present application provides a data transmission method, which is applied to a transmitting end, wherein the transmitting end includes a first wireless communication module and a first application program, the first wireless communication module is set to a listening mode, and a first preset link parameter is predefined, the first preset link parameter is used to guide data transmission, the first data to be sent is processed according to the first preset link parameter to obtain first target data and send it to the first wireless communication module, the first wireless communication module determines first data to be broadcast and the first preset link parameter by parsing the first target data, and the first data to be broadcast is broadcasted through the first preset link parameter, the first preset link parameter can be flexibly set and adjusted according to demand, can meet the demand for data transmission in different scenarios, improve user experience, and at the same time improve data transmission efficiency.
实施例二 Embodiment 2
图2为本申请实施例二提供的一种数据传输方法的流程图,本实施例在上述实施例的基础上细化。如图2所示,该方法包括:FIG2 is a flow chart of a data transmission method provided in Embodiment 2 of the present application. This embodiment is a refinement of the above embodiment. As shown in FIG2 , the method includes:
S201、第一应用程序获取采用用户数据报协议封装的第一待发送数据。S201. A first application program obtains first data to be sent encapsulated in a user datagram protocol.
可选的,在第一应用程序获取采用用户数据报协议封装的第一待发送数据之后,还包括:第一应用程序确定第一待发送数据的第一数据长度;对第一数据长度进行长度验证。Optionally, after the first application obtains the first data to be sent encapsulated using the User Datagram Protocol, the method further includes: the first application determines a first data length of the first data to be sent; and performs length verification on the first data length.
在本实施例中,第一数据长度可以理解为第一待发送数据的数据长度。在发送第一待发送数据时,可能存在数据长度要求,例如,由于传输速率、传输质量等要求,导致无法处理过大的数据。因此在获取到第一待发送数据后,还需要对第一待发送数据的数据长度进行验证,判断第一待发送数据是否符合要求。In this embodiment, the first data length can be understood as the data length of the first data to be sent. When sending the first data to be sent, there may be a data length requirement. For example, due to requirements such as transmission rate and transmission quality, it is impossible to process too large data. Therefore, after obtaining the first data to be sent, it is also necessary to verify the data length of the first data to be sent to determine whether the first data to be sent meets the requirements.
第一待发送数据的第一数据长度可以在获取到第一待发送数据后根据第一待发送数据进行确定,也可以在获取第一待发送数据时,同时从第一待发送数据的数据发送方获取。在确定第一待发送数据的数据长度后,对第一数据长度进行验证,验证方式可以是预先设置长度阈值,判断第一数据长度是否大于长度阈值,若第一数据长度大于长度阈值,确定第一待发送数据的长度验证结果为验证失败;若第一数据长度小于或等于长度阈值,确定第一待发送数据的长度验证结果为验证成功。如果验证失败,则不对第一待发送数据进行处理以及发送。如果验证成功,则继续执行下面的操作,对第一待发送数据进行处理以及发送。The first data length of the first data to be sent can be determined based on the first data to be sent after the first data to be sent is obtained, or it can be obtained from the data sender of the first data to be sent while the first data to be sent is obtained. After determining the data length of the first data to be sent, the first data length is verified. The verification method can be to pre-set a length threshold to determine whether the first data length is greater than the length threshold. If the first data length is greater than the length threshold, the length verification result of the first data to be sent is determined to be a verification failure; if the first data length is less than or equal to the length threshold, the length verification result of the first data to be sent is determined to be a verification success. If the verification fails, the first data to be sent is not processed or sent. If the verification is successful, continue to perform the following operations to process and send the first data to be sent.
S202、第一应用程序将第一待发送数据分成k个第一数据包,其中,k为分组参数。S202. The first application divides first data to be sent into k first data packets, where k is a grouping parameter.
在本实施例中,第一数据包可以理解为第一待发送数据分块形成的数据包。预先确定分组参数k,第一应用程序将第一待发送数据分成k份,每份数据形成一个第一数据包,可以是平均分成k个第一数据包,也可以分成k个数据量不平均的第一数据包。In this embodiment, the first data packet can be understood as a data packet formed by dividing the first data to be sent into blocks. The grouping parameter k is predetermined, and the first application divides the first data to be sent into k parts, each of which forms a first data packet, which can be divided into k first data packets evenly or into k first data packets with uneven data amounts.
可选的,k的数值由发送端根据目标接收端反馈的调整信息计算得到。Optionally, the value of k is calculated by the sending end according to the adjustment information fed back by the target receiving end.
目标接收端根据接收到的数据确定调整信息并反馈给发送端,发送端根据调整信息确定k值,实现对k值的调整。k值可以设置初始值,在第一次对第一待发送数据进行发送时采用初始的k值对第一待发送数据进行处理。The target receiving end determines the adjustment information according to the received data and feeds it back to the sending end, and the sending end determines the k value according to the adjustment information to adjust the k value. The k value can be set to an initial value, and the initial k value is used to process the first data to be sent when the first data to be sent is sent for the first time.
S203、第一应用程序对每一第一数据包增加冗余数据后进行编码,以得到n个第一编码数据包。S203: The first application program adds redundant data to each first data packet and then encodes the data packet to obtain n first encoded data packets.
在本实施例中,第一编码数据包可以理解为第一数据包编码后得到的数据 包,n为大于k的整数。第一应用程序对每个第一数据包增加冗余数据,然后根据预先设置的编码规则进行编码,生成n个第一编码数据包。In this embodiment, the first encoded data packet can be understood as the data obtained after the first data packet is encoded. Packet, n is an integer greater than k. The first application adds redundant data to each first data packet, and then encodes it according to a preset encoding rule to generate n first encoded data packets.
S204、第一应用程序将第一预设链路参数加入到每个第一编码数据包中,以得到第一目标数据。S204: The first application program adds the first preset link parameter to each first encoded data packet to obtain first target data.
第一应用程序将第一预设链路参数加入到每个第一编码数据包中,可以直接加入到第一编码数据包的头部、尾部或者其他字段,得到包含第一预设链路参数的第一目标数据。在向第一编码数据包中加入第一预设链路参数时可以是将第一预设链路参数加入至第一编码数据包的固定字段,也可加入至非固定字段。添加至头部、尾部等固定字段可以方便后续的数据解析。The first application program adds the first preset link parameter to each first coded data packet, and can directly add it to the header, tail or other fields of the first coded data packet to obtain the first target data containing the first preset link parameter. When adding the first preset link parameter to the first coded data packet, the first preset link parameter can be added to a fixed field of the first coded data packet, or can be added to a non-fixed field. Adding to fixed fields such as the header and tail can facilitate subsequent data parsing.
第一待发送数据直接发送时,存在丢包的情况。通过对第一待发送数据进行数据冗余处理,增加冗余数据,以便接收端可以正确解析所接收到的数据。本申请可采用前向纠错算法(Forward Error Correction,FEC)对待发送数据进行数据冗余处理,发送方在发送数据时,在每个数据包中加一些开销(冗余信息);接收端根据接收到的有效数据和开销,即使有一定数据包丢失,仍可根据有效数据和开销,恢复出完整的有效数据。When the first data to be sent is sent directly, there is a packet loss situation. By performing data redundancy processing on the first data to be sent, redundant data is added so that the receiving end can correctly parse the received data. The present application can use a forward error correction algorithm (Forward Error Correction, FEC) to perform data redundancy processing on the data to be sent. When sending data, the sender adds some overhead (redundant information) to each data packet; the receiving end can recover the complete valid data based on the valid data and overhead even if a certain number of data packets are lost according to the received valid data and overhead.
本申请可直接在底层链路上进行数据冗余处理,优化传输丢包,降低应用处理数据的复杂度,进而降低应用的负担。This application can directly perform data redundancy processing on the underlying link, optimize transmission packet loss, reduce the complexity of application data processing, and thus reduce the burden on the application.
S205、第一无线通信模组对第一目标数据进行解析确定第一待广播数据以及第一预设链路参数,根据第一预设链路参数广播第一待广播数据,以使第一待广播数据被目标接收端接收。S205. The first wireless communication module parses the first target data to determine the first data to be broadcast and the first preset link parameter, and broadcasts the first data to be broadcast according to the first preset link parameter, so that the first data to be broadcast is received by the target receiving end.
第一无线通信模组对第一目标数据进行解析可以按照字段进行解析,例如,第一目标数据中的头部数据为第一预设链路参数,对第一目标数据进行解析,直接解析头部数据获取第一预设链路参数,将去掉头部数据的剩余数据作为第一待广播数据,即每个第一编码数据包可直接作为第一待广播数据。The first wireless communication module can parse the first target data according to fields. For example, the header data in the first target data is the first preset link parameter. The first target data is parsed by directly parsing the header data to obtain the first preset link parameter, and the remaining data after removing the header data is used as the first data to be broadcast, that is, each first encoded data packet can be directly used as the first data to be broadcast.
可选的,第一预设链路参数至少包括以下一项:单包编码方式、单包发送数据大小、数据包发送速度和调制方式。Optionally, the first preset link parameter includes at least one of the following: single-packet encoding mode, single-packet sending data size, data packet sending speed and modulation mode.
在本实施例中,单包编码方式可以理解为每个数据包的编码方式;单包发送数据大小可以理解为每个数据包中包括的数据的大小;调制方式可以是相移键控(Phase Shift Keying,PSK)、二进制相移键控(Binary Phase Shift Keying,BPSK)、频移键控(Frequency Shift Keying,FSK)、振幅键控(Amplitude Shift Keying,ASK)等。In this embodiment, the single-packet encoding method can be understood as the encoding method of each data packet; the single-packet sending data size can be understood as the size of the data included in each data packet; the modulation method can be phase shift keying (PSK), binary phase shift keying (BPSK), frequency shift keying (FSK), amplitude shift keying (ASK), etc.
当第一预设链路参数确定后,单包编码方式、单包发送数据大小、数据包发送速度和调制方式相应确定,即确定第一编码数据包采用何种方式进行发送 确定。第一无线通信模组根据单包编码方式、单包发送数据大小、数据包发送速度和调制方式发送第一待广播数据。When the first preset link parameters are determined, the single packet encoding method, the single packet transmission data size, the data packet transmission speed and the modulation method are determined accordingly, that is, the method used to transmit the first coded data packet is determined. The first wireless communication module sends the first data to be broadcast according to the single-packet encoding mode, the single-packet transmission data size, the data packet transmission speed and the modulation mode.
第一无线通信模组通过无线网络通信广播链路(即wifibroadcast链路)广播数据,处理后的第一待广播数据通过无线网络通信广播链路进行广播发送,可以广播到附近的设备。在通过无线网络通信广播链路对第一待广播数据进行广播发送时,按照数据包发送速度进行发送。The first wireless communication module broadcasts data through a wireless network communication broadcast link (i.e., a wifibroadcast link), and the processed first data to be broadcasted is broadcasted through the wireless network communication broadcast link and can be broadcasted to nearby devices. When the first data to be broadcasted is broadcasted through the wireless network communication broadcast link, it is sent at a data packet sending speed.
示例性的,图3为本申请实施例提供的一种应用于发送端的数据传输的时序图,发送端包括第一应用程序31、第一上层应用程序32,第一无线通信模组33。其中,第一上层应用程序32为发送端中具有传输UDP数据的需求的应用,第一应用程序31用于获取第一上层应用程序32所形成的第一待发送数据,第一应用程序31包括UDP监听模块311和数据冗余处理模块312,第一无线通信模组33设置为向外广播第一待广播数据。第一上层应用程序32相对第一应用程序31为上层应用。Exemplarily, FIG3 is a timing diagram of a data transmission applied to a sending end provided in an embodiment of the present application, wherein the sending end includes a first application 31, a first upper layer application 32, and a first wireless communication module 33. Among them, the first upper layer application 32 is an application in the sending end that has the need to transmit UDP data, the first application 31 is used to obtain the first data to be sent formed by the first upper layer application 32, the first application 31 includes a UDP listening module 311 and a data redundancy processing module 312, and the first wireless communication module 33 is configured to broadcast the first data to be broadcasted. The first upper layer application 32 is an upper layer application relative to the first application 31.
设置第一无线通信模组33处于监听(monitor)模式。第一上层应用程序32生成采用UDP协议进行封装的第一待发送数据,并将第一待发送数据传输至UDP端口。第一应用程序31通过UDP监听模块311监听UDP端口,对获取的第一待发送数据进行验证,例如,对第一待发送数据进行长度验证,在验证通过时,将第一待发送数据通过冗余处理请求发送至数据冗余处理模块312,数据冗余处理模块312对第一待发送数据进行数据冗余处理,并通过数据包捕获函数库(Packet Capture library,libpcap)中的数据接口将处理后的第一目标数据注入至第一无线通信模组33,第一无线通信模组33通过解析第一目标数据确定第一预设链路参数和第一待广播数据,第一无线通信模组33按照第一预设链路参数对第一待广播数据进行数据发送。The first wireless communication module 33 is set in monitor mode. The first upper layer application 32 generates the first data to be sent encapsulated by the UDP protocol, and transmits the first data to be sent to the UDP port. The first application 31 monitors the UDP port through the UDP monitoring module 311, verifies the acquired first data to be sent, for example, verifies the length of the first data to be sent, and when the verification is passed, sends the first data to be sent to the data redundancy processing module 312 through a redundancy processing request. The data redundancy processing module 312 performs data redundancy processing on the first data to be sent, and injects the processed first target data into the first wireless communication module 33 through the data interface in the Packet Capture library (libpcap). The first wireless communication module 33 determines the first preset link parameter and the first data to be broadcast by parsing the first target data, and the first wireless communication module 33 sends the first data to be broadcast according to the first preset link parameter.
本申请实施例提供了一种数据传输方法,应用于发送端,本实施例包括对第一待发送数据的第一数据长度进行验证,以及对第一待发送数据进行数据冗余处理以及增加第一预设链路参数,得到第一目标数据。预先定义第一预设链路参数,根据第一预设链路参数广播数据,提高了数据发送效率;本申请采用wifibroadcast链路作为传输链路,灵活调整链路参数,可以满足不同场景下对数据传输的需求,在提高发送效率的同时提高用户体验。并且,本申请在底层链路上进行数据冗余处理,优化了传输丢包的情况,降低传输丢包概率,提高数据传输准确性。The embodiment of the present application provides a data transmission method, which is applied to the transmitting end. The embodiment includes verifying the first data length of the first data to be sent, performing data redundancy processing on the first data to be sent, and adding the first preset link parameter to obtain the first target data. The first preset link parameter is predefined, and the data is broadcast according to the first preset link parameter, which improves the data transmission efficiency; the present application adopts the wifibroadcast link as the transmission link, and flexibly adjusts the link parameters to meet the needs of data transmission in different scenarios, and improves the user experience while improving the transmission efficiency. In addition, the present application performs data redundancy processing on the underlying link, optimizes the situation of transmission packet loss, reduces the probability of transmission packet loss, and improves the accuracy of data transmission.
实施例三 Embodiment 3
图4为本申请实施例三提供的一种数据传输方法的流程图,应用于数据传输设备,数据传输设备包括处理器、存储器、通信接口和第二无线通信模组,存储器、通信接口、第二无线通信模组均与处理器形成电连接,第二无线通信模组设置为监听模式,存储器存储有第二应用程序,第二应用程序存储有第二预设链路参数。如图4所示,该方法包括:FIG4 is a flow chart of a data transmission method provided in Embodiment 3 of the present application, which is applied to a data transmission device, wherein the data transmission device includes a processor, a memory, a communication interface, and a second wireless communication module, wherein the memory, the communication interface, and the second wireless communication module are all electrically connected to the processor, the second wireless communication module is set to a monitoring mode, the memory stores a second application program, and the second application program stores a second preset link parameter. As shown in FIG4 , the method includes:
S401、通信接口与源设备建立连接。S401: A communication interface establishes a connection with a source device.
在本实施例中,通信接口可以为Type-A接口、Type-C接口或其他类型的USB接口。源设备可以是笔记本电脑,台式计算机、智能手机、智能平板等电子设备。数据传输设备的通信接口与源设备可以通过数据线进行连接,在连接后可以接收源设备所发送的视频、音频等数据。In this embodiment, the communication interface may be a Type-A interface, a Type-C interface, or other types of USB interfaces. The source device may be an electronic device such as a laptop, a desktop computer, a smart phone, a smart tablet, etc. The communication interface of the data transmission device may be connected to the source device via a data cable, and after the connection, the video, audio, and other data sent by the source device may be received.
示例性的,本实施例的应用场景可以是:源设备通过数据传输设备向目标接收端进行投屏。数据传输设备通过通信接口与源设备连接后,可以将源设备的数据共享至目标接收端。Exemplarily, the application scenario of this embodiment may be: the source device projects the screen to the target receiving end through the data transmission device. After the data transmission device is connected to the source device through the communication interface, the data of the source device can be shared to the target receiving end.
S402、处理器通过通信接口获取源设备生成的共享数据。S402: The processor obtains shared data generated by the source device through the communication interface.
在本实施例中,共享数据可以理解为源设备共享至目标接收端的数据,可以是音频数据、视频数据或其他类型的数据。源设备中的应用程序Y在需要向外界发送数据时,生成共享数据。源设备生成共享数据后,发送至数据传输设备的通信接口,数据传输设备的处理器通过通信接口获取到共享数据。In this embodiment, shared data can be understood as data shared by the source device to the target receiving end, which can be audio data, video data or other types of data. When the application Y in the source device needs to send data to the outside world, it generates shared data. After the source device generates the shared data, it sends it to the communication interface of the data transmission device, and the processor of the data transmission device obtains the shared data through the communication interface.
S403、处理器基于共享数据执行第二应用程序,第二应用程序用于获取基于共享数据形成的采用用户数据报协议封装的第二待发送数据,并根据第二预设链路参数对第二待发送数据进行处理以得到第二目标数据。S403. The processor executes a second application based on the shared data, where the second application is used to obtain second data to be sent encapsulated using a user datagram protocol based on the shared data, and processes the second data to be sent according to a second preset link parameter to obtain second target data.
在本实施例中,第二应用程序可以理解为数据传输过程中用于对需要传输的第二待发送数据进行处理的应用程序;第二待发送数据可以理解为需要向外部设备发送的数据。第二预设链路参数可以理解为传输第二待发送数据时的传输链路的参数,例如,传输速度、编码方式等,第二预设链路参数可用于指导第二无线通信模组如何发送数据。第二目标数据可以理解为对第二待发送数据进行处理后得到的数据。In this embodiment, the second application can be understood as an application used to process the second data to be transmitted during the data transmission process; the second data to be transmitted can be understood as data to be sent to an external device. The second preset link parameters can be understood as parameters of the transmission link when transmitting the second data to be transmitted, such as transmission speed, encoding method, etc. The second preset link parameters can be used to guide the second wireless communication module on how to send data. The second target data can be understood as data obtained after processing the second data to be transmitted.
处理器将共享数据处理成采用用户数据报协议封装的第二待发送数据,第二待发送数据通过UDP协议发送至UDP端口。第二应用程序通过监听UDP端口获取第二待发送数据。第二应用程序中存储预先设置的第二预设链路参数,可以预先根据使用场景、需求等自定义第二预设链路参数,第二预设链路参数与第一预设链路参数的参数类型相同。根据第二预设链路参数对第二待发送数据进行处理得到第二目标数据,可以是直接将第二预设链路参数加入至第二待 发送数据中得到第二目标数据,也可以对第二待发送数据进行处理,然后加入第二预设链路参数得到第二目标数据。The processor processes the shared data into second data to be sent encapsulated by the user datagram protocol, and the second data to be sent is sent to the UDP port through the UDP protocol. The second application obtains the second data to be sent by monitoring the UDP port. The second application stores the pre-set second preset link parameters, which can be customized in advance according to the usage scenario, requirements, etc. The second preset link parameters are of the same parameter type as the first preset link parameters. The second data to be sent is processed according to the second preset link parameters to obtain the second target data, which can be directly added to the second preset link parameters. The second target data can be obtained from the transmitted data, or the second data to be transmitted can be processed and then the second preset link parameter can be added to obtain the second target data.
S404、处理器将第二目标数据发给第二无线通信模组。S404: The processor sends the second target data to the second wireless communication module.
在本实施例中,第二无线通信模组可以理解为数据传输设备中通过无线传输链路进行数据传输的模块,例如,网卡。处理器接收第二应用程序所发送的第二目标数据并发送给第二无线通信模组。In this embodiment, the second wireless communication module can be understood as a module in a data transmission device that performs data transmission via a wireless transmission link, such as a network card. The processor receives the second target data sent by the second application and sends it to the second wireless communication module.
S405、第二无线通信模组对第二目标数据进行解析确定第二待广播数据以及第二预设链路参数,根据第二预设链路参数广播第二待广播数据,以使第二待广播数据被目标接收端接收。S405. The second wireless communication module parses the second target data to determine second data to be broadcast and second preset link parameters, and broadcasts the second data to be broadcast according to the second preset link parameters, so that the second data to be broadcast is received by the target receiving end.
在本实施例中,第二待广播数据可以理解为具有广播到其他设备需求的数据,第二待广播数据可以是对第二待发送数据进行处理后得到的数据,也可以直接将第二待发送数据作为第二待广播数据。In this embodiment, the second data to be broadcast can be understood as data that needs to be broadcast to other devices. The second data to be broadcast can be data obtained by processing the second data to be sent, or the second data to be sent can be directly used as the second data to be broadcast.
第二无线通信模组设置为监听模式,监听第二应用程序所发送的数据。通过将第二无线通信模组设置为监听模式,避免数据被拦截。第二无线通信模组接收到第二目标数据后,对第二目标数据进行解析,可以按照字段进行解析,得到可用于传输的第二待广播数据,以及用于指导第二无线通信模组如何传输数据的第二预设链路参数。根据第二预设链路参数对第二待广播数据进行数据打包、编码等处理,然后按照一定的传输速度向外广播发送。第二待广播数据可以按照自定义的第二预设链路参数进行发送,满足用户的需求。第二无线通信模组将第二待广播数据广播到目标接收端。The second wireless communication module is set to monitoring mode to monitor the data sent by the second application. By setting the second wireless communication module to monitoring mode, data interception is avoided. After receiving the second target data, the second wireless communication module parses the second target data, and can parse according to the field to obtain the second data to be broadcast that can be used for transmission, and the second preset link parameters for guiding the second wireless communication module on how to transmit data. The second data to be broadcast is packaged, encoded, and processed according to the second preset link parameters, and then broadcast and sent outward at a certain transmission speed. The second data to be broadcast can be sent according to the customized second preset link parameters to meet the needs of users. The second wireless communication module broadcasts the second data to be broadcast to the target receiving end.
第二无线通信模组通过无线网络通信广播链路(即wifibroadcast链路)广播数据。The second wireless communication module broadcasts data via a wireless network communication broadcast link (ie, a wifibroadcast link).
本申请实施例提供了一种数据传输方法,应用于数据传输设备,数据传输设备包括处理器、存储器、通信接口和第二无线通信模组,第二无线通信模组设置为监听模式,通过预先定义第二预设链路参数,第二预设链路参数用于指导数据传输,第二无线通信模组通过第二预设链路参数对第二待广播数据进行广播,第二预设链路参数可以根据需求灵活设置及调整,可以满足不同场景下对数据传输的需求,提高用户体验,同时提高了数据发送效率。An embodiment of the present application provides a data transmission method, which is applied to a data transmission device. The data transmission device includes a processor, a memory, a communication interface, and a second wireless communication module. The second wireless communication module is set to a listening mode. The second preset link parameters are predefined. The second preset link parameters are used to guide data transmission. The second wireless communication module broadcasts the second data to be broadcast through the second preset link parameters. The second preset link parameters can be flexibly set and adjusted according to needs, which can meet the needs of data transmission in different scenarios, improve user experience, and improve data transmission efficiency.
作为本实施例的一个可选实施例,所述数据传输方法还包括了在所述第二应用程序获取基于共享数据形成的采用用户数据报协议封装的第二待发送数据之后,第二应用程序确定第二待发送数据的第二数据长度,并对第二数据长度进行长度验证。As an optional embodiment of this embodiment, the data transmission method also includes after the second application obtains the second data to be sent encapsulated by the user datagram protocol based on the shared data, the second application determines the second data length of the second data to be sent and verifies the length of the second data.
在本实施例中,第二数据长度可以理解为第二待发送数据的数据长度。在 发送第二待发送数据时,同样可能存在数据长度要求,因此需要对第二待发送数据的数据长度进行验证。In this embodiment, the second data length can be understood as the data length of the second data to be sent. When sending the second data to be sent, there may also be a data length requirement, so the data length of the second data to be sent needs to be verified.
第二待发送数据的第二数据长度可以在获取到第二待发送数据后根据第二待发送数据进行确定,也可以在获取第二待发送数据时,同时从第二待发送数据的数据发送方获取。在确定第二待发送数据的数据长度后,对第二数据长度进行验证,验证方式可以是预先设置长度阈值,判断第二数据长度是否大于长度阈值,若第二数据长度大于长度阈值,确定第二待发送数据的长度验证结果为验证失败;若第二数据长度小于或等于长度阈值,确定第二待发送数据的长度验证结果为验证成功。如果验证失败,则不对第二待发送数据进行处理以及发送。如果验证成功,则继续执行下面的操作,对第二待发送数据进行处理以及发送。The second data length of the second data to be sent can be determined based on the second data to be sent after the second data to be sent is obtained, or it can be obtained from the data sender of the second data to be sent while the second data to be sent is obtained. After determining the data length of the second data to be sent, the second data length is verified. The verification method can be to pre-set a length threshold to determine whether the second data length is greater than the length threshold. If the second data length is greater than the length threshold, the length verification result of the second data to be sent is determined to be a verification failure; if the second data length is less than or equal to the length threshold, the length verification result of the second data to be sent is determined to be a verification success. If the verification fails, the second data to be sent is not processed or sent. If the verification is successful, continue to perform the following operations to process and send the second data to be sent.
作为本实施例的一个可选实施例,第二应用程序根据第二预设链路参数对第二待发送数据进行处理以得到第二目标数据,包括:第二应用程序将第二待发送数据分成m个第二数据包,其中,m为分组参数;第二应用程序对每一第二数据包增加冗余数据后进行编码,以得到i个第二编码数据包;第二应用程序将第二预设链路参数加入到每个第二编码数据包中,以得到第二目标数据。As an optional embodiment of the present embodiment, the second application processes the second data to be sent according to the second preset link parameters to obtain second target data, including: the second application divides the second data to be sent into m second data packets, where m is the grouping parameter; the second application adds redundant data to each second data packet and encodes it to obtain i second encoded data packets; the second application adds the second preset link parameters to each second encoded data packet to obtain the second target data.
在本实施例中,第二数据包可以理解为第二待发送数据分块形成的数据包。第二编码数据包可以理解为第二数据包编码后得到的数据包。In this embodiment, the second data packet can be understood as a data packet formed by the second data blocks to be sent. The second encoded data packet can be understood as a data packet obtained after the second data packet is encoded.
预先确定分组参数m,第二应用程序将第二待发送数据分成m份,每份数据形成一个第二数据包,可以是平均分成m个第二数据包,也可以分成m个数据量不平均的第二数据包。第二应用程序对每个第二数据包增加冗余数据,然后根据预先设置的编码规则进行编码,生成i个第二编码数据包。第二应用程序将第二预设链路参数加入到每个第二编码数据包中的头部、尾部或其他字段,得到包含第二预设链路参数的第二目标数据。The grouping parameter m is predetermined, and the second application divides the second data to be sent into m parts, each of which forms a second data packet. The second application can be divided into m second data packets evenly or into m second data packets with uneven data amounts. The second application adds redundant data to each second data packet, and then encodes it according to a preset encoding rule to generate i second encoded data packets. The second application adds the second preset link parameter to the header, tail or other field of each second encoded data packet to obtain the second target data containing the second preset link parameter.
可选的,m的数值由数据传输设备根据目标接收端反馈的调整信息计算得到。Optionally, the value of m is calculated by the data transmission device according to adjustment information fed back by the target receiving end.
目标接收端根据接收到的数据确定调整信息并反馈给数据传输设备,数据传输设备根据调整信息确定m值,实现对m值的调整。m值可以设置初始值,在第一次对第二待发送数据进行发送时采用初始的m值对第二待发送数据进行处理。The target receiving end determines adjustment information according to the received data and feeds it back to the data transmission device, and the data transmission device determines the m value according to the adjustment information to adjust the m value. The m value can be set to an initial value, and the initial m value is used to process the second data to be sent when the second data to be sent is sent for the first time.
第二预设链路参数至少包括以下一项:单包编码方式、单包发送数据大小、数据包发送速度和调制方式。The second preset link parameter includes at least one of the following: a single-packet encoding mode, a single-packet transmission data size, a data packet transmission speed, and a modulation mode.
本申请实施例提供了一种数据传输方法,应用于数据传输设备,本实施例 包括对第二待发送数据的第二数据长度进行验证,以及对第二待发送数据进行数据冗余处理以及增加第二预设链路参数,得到第二目标数据。预先定义第二预设链路参数,根据第二预设链路参数广播数据,提高了数据发送效率;本申请采用wifibroadcast链路作为传输链路,灵活调整链路参数,可以满足不同场景下对数据传输的需求,在提高发送效率的同时提高用户体验。并且,本申请在底层链路上进行数据冗余处理,优化了传输丢包的情况,降低传输丢包概率,提高数据传输准确性。The present application embodiment provides a data transmission method, which is applied to a data transmission device. The invention includes verifying the second data length of the second data to be sent, performing data redundancy processing on the second data to be sent, and adding a second preset link parameter to obtain the second target data. The second preset link parameter is predefined, and data is broadcast according to the second preset link parameter, thereby improving data transmission efficiency. The present application adopts a wifi broadcast link as a transmission link, and flexibly adjusts the link parameters to meet the needs of data transmission in different scenarios, thereby improving the transmission efficiency and user experience. In addition, the present application performs data redundancy processing on the underlying link, optimizes the situation of transmission packet loss, reduces the probability of transmission packet loss, and improves the accuracy of data transmission.
实施例四Embodiment 4
图5为本申请实施例四提供的一种数据传输方法的流程图,应用于目标接收端,目标接收端包括第三无线通信模组、第三应用程序和上层应用程序,第三无线通信模组设置为监听模式。如图5所示,该方法包括:FIG5 is a flow chart of a data transmission method provided in Embodiment 4 of the present application, which is applied to a target receiving end, wherein the target receiving end includes a third wireless communication module, a third application program, and an upper layer application program, and the third wireless communication module is set to a monitoring mode. As shown in FIG5 , the method includes:
S501、第三无线通信模组接收待广播数据,待广播数据根据任意实施例中的数据传输方法发送。S501. The third wireless communication module receives data to be broadcast, and the data to be broadcast is sent according to the data transmission method in any embodiment.
在本实施例中,待广播数据可以理解为目标接收端所接收到的数据,待广播数据可以是第一待广播数据,也可以是第二待广播数据。目标接收端与作为发送端或数据传输设备的外部设备建立通信链路,并通过通信链路接收外部设备所发送的数据,外部设备的数量可以是一个,也可以是多个。In this embodiment, the data to be broadcast can be understood as data received by the target receiving end, and the data to be broadcast can be the first data to be broadcast or the second data to be broadcast. The target receiving end establishes a communication link with an external device that is a transmitting end or a data transmission device, and receives the data sent by the external device through the communication link. The number of external devices can be one or more.
目标接收端可以是交互平板等电子设备,本申请中的目标接收端可以接收发送端发送的第一待广播数据,也可以接收数据传输设备发送的第二待广播数据。以传屏为例,目标接收端与发送端均可以通过传屏软件直接进行传屏;或者,数据传输设备作为传屏器,源设备通过数据传输设备与目标接收端连接,实现传屏。The target receiving end can be an electronic device such as an interactive tablet. The target receiving end in this application can receive the first data to be broadcasted sent by the sending end, and can also receive the second data to be broadcasted sent by the data transmission device. Taking screen transmission as an example, both the target receiving end and the sending end can directly transmit the screen through the screen transmission software; or, the data transmission device acts as a screen transmitter, and the source device is connected to the target receiving end through the data transmission device to realize screen transmission.
可选的,待广播数据通过无线网络通信广播链路接收。Optionally, the data to be broadcast is received via a wireless network communication broadcast link.
目标接收端与发送端建立无线网络通信广播链路(wifibroadcast链路),通过wifibroadcast链路进行数据的传输,目标接收端通过wifibroadcast链路接收待广播数据。The target receiving end establishes a wireless network communication broadcast link (wifibroadcast link) with the sending end, transmits data through the wifibroadcast link, and the target receiving end receives the data to be broadcast through the wifibroadcast link.
S502、第三应用程序获取第三无线通信模组所接收的待广播数据,并在确定满足处理条件的情况下,将待广播数据发送至上层应用程序所对应的端口,以便上层应用程序获取待广播数据。S502: The third application obtains the data to be broadcast received by the third wireless communication module, and when it is determined that the processing conditions are met, sends the data to be broadcast to the port corresponding to the upper-layer application so that the upper-layer application obtains the data to be broadcast.
在本实施例中,第三应用程序可以理解为数据传输过程中用于对从其他设备所获取的数据进行处理的应用程序;处理条件可以理解为用于判断目标接收端是否对所接收的待广播数据进行处理的条件,在满足处理条件时,目标接收 端的第三应用程序对待广播数据执行处理、转发等操作。上层应用程序可以理解为目标接收端中具有待广播数据获取需求的应用。In this embodiment, the third application can be understood as an application used to process data obtained from other devices during data transmission; the processing condition can be understood as a condition for determining whether the target receiving end processes the received data to be broadcast. When the processing condition is met, the target receiving end processes the received data to be broadcast. The third application program at the end performs operations such as processing and forwarding on the broadcast data. The upper layer application program can be understood as an application at the target receiving end that has a need to obtain the broadcast data.
第三应用程序调用pcap(libpcap)库捕获第三无线通信模组所接收的待广播数据。预先设置处理条件,根据目标接收端的信息、参数等判断目标接收端是否满足处理条件。当目标接收端满足处理条件时,确定接收待广播数据的上层应用程序。上层应用程序可以预先设置,例如,将目标接收端中的一个或者多个应用作为上层应用程序;也可以根据待广播数据确定,根据待广播数据确定上层应用程序时,可以根据待广播数据的数据类型确定,也可以在待广播数据中携带指示数据所对应上层应用程序的信息。在确定上层应用程序后,将待广播数据发送至上层应用程序所监听的UDP端口,上层应用程序通过UDP端口获取待广播数据。数据从发送端到目标接收端为一次数据的单向传输。对于同一设备,既可以作为发送端,向外发送数据,也可以作为目标接收端接收数据。The third application calls the pcap (libpcap) library to capture the data to be broadcast received by the third wireless communication module. The processing conditions are set in advance, and the target receiving end is judged whether the processing conditions are met according to the information and parameters of the target receiving end. When the target receiving end meets the processing conditions, the upper-layer application that receives the data to be broadcast is determined. The upper-layer application can be set in advance, for example, one or more applications in the target receiving end are used as the upper-layer application; it can also be determined according to the data to be broadcast. When determining the upper-layer application according to the data to be broadcast, it can be determined according to the data type of the data to be broadcast, or the information of the upper-layer application corresponding to the indication data can be carried in the data to be broadcast. After determining the upper-layer application, the data to be broadcast is sent to the UDP port monitored by the upper-layer application, and the upper-layer application obtains the data to be broadcast through the UDP port. Data from the sender to the target receiving end is a one-way transmission of data. For the same device, it can act as a sender to send data outward, and it can also act as a target receiving end to receive data.
可选的,处理条件为待广播数据对应的目标地址与目标接收端的地址匹配,且待广播数据对应的组网地址与目标接收端的组网地址匹配。Optionally, the processing condition is that the target address corresponding to the data to be broadcast matches the address of the target receiving end, and the networking address corresponding to the data to be broadcast matches the networking address of the target receiving end.
在本实施例中,目标地址可以理解为待广播数据所传输的目的地,如图1A中的第一地址;组网地址可以理解为设备在组网时约定好的地址,待广播数据对应的组网地址如图1A中的第三地址。In this embodiment, the target address can be understood as the destination where the broadcast data is transmitted, such as the first address in Figure 1A; the networking address can be understood as the address agreed upon by the devices when networking, and the networking address corresponding to the broadcast data is such as the third address in Figure 1A.
解析待广播数据,确定待广播数据的目标地址和组网地址。比较待广播数据的目标地址和目标接收端的地址,判断是否匹配,同时比较待广播数据对应的组网地址与目标接收端的组网地址,判断是否匹配,若目标地址与组网地址均匹配,则确定满足处理条件。Parse the data to be broadcasted and determine the target address and networking address of the data to be broadcasted. Compare the target address of the data to be broadcasted with the address of the target receiving end to determine whether they match. At the same time, compare the networking address corresponding to the data to be broadcasted with the networking address of the target receiving end to determine whether they match. If both the target address and the networking address match, it is determined that the processing conditions are met.
本申请实施例提供了一种数据传输方法,应用于目标接收端,通过接收待广播数据,当确定满足处理条件时,将待广播数据发送至第三应用程序所对应的端口,以便第三应用程序获取待广播数据。待广播数据由发送端或数据传输设备根据第一预设链路参数或者第二预设链路参数发送,第一预设链路参数和第二预设链路参数可以进行灵活调整,提高了数据传输效率,可以满足不同场景下对数据传输的需求,提高了用户体验。The embodiment of the present application provides a data transmission method, which is applied to a target receiving end, and receives the data to be broadcast. When it is determined that the processing conditions are met, the data to be broadcast is sent to the port corresponding to the third application so that the third application can obtain the data to be broadcast. The data to be broadcast is sent by the sending end or the data transmission device according to the first preset link parameter or the second preset link parameter. The first preset link parameter and the second preset link parameter can be flexibly adjusted, which improves the data transmission efficiency, can meet the needs of data transmission in different scenarios, and improves the user experience.
作为本实施例的一个可选实施例,所述方法还包括在第三应用程序将待广播数据发送至上层应用程序所对应的端口之前,第三应用程序根据待广播数据进行冗余恢复,根据冗余恢复后的数据计算所述待广播数据的当前丢包率;第三应用程序根据当前丢包率确定分组参数k或m,并将分组参数作为调整信息反馈至发送端或数据传输设备。 As an optional embodiment of the present embodiment, the method also includes, before the third application sends the data to be broadcast to the port corresponding to the upper-layer application, the third application performs redundancy recovery based on the data to be broadcast, and calculates the current packet loss rate of the data to be broadcast based on the redundantly recovered data; the third application determines the grouping parameter k or m based on the current packet loss rate, and feeds back the grouping parameter as adjustment information to the sending end or data transmission device.
在本实施例中,当前丢包率可以理解为当前接收到的待广播数据的丢包率。In this embodiment, the current packet loss rate may be understood as the packet loss rate of the currently received data to be broadcasted.
由于发送端在发送数据时对数据进行了冗余处理,因此目标接收端在将待广播数据发送至上层应用程序所对应的端口之前,对待广播数据进行冗余恢复,根据待广播数据和译码规则对数据进行还原,得到原始的数据,即第一待发送数据或第二待发送数据。冗余恢复与数据冗余处理采用同一种算法。将待广播数据进行冗余恢复得到的数据发送至上层应用程序所对应的端口。同时,根据冗余恢复后的数据计算待广播数据的当前丢包率,根据当前丢包率计算分组参数k或者m,当接收到的待广播数据为第一待广播数据时,计算得到的为分组参数k,将其作为调整信息反馈至发送端;当接收到的待广播数据为第二待广播数据时,计算得到的为分组参数m,将其作为调整信息反馈至数据传输设备。Since the sender performs redundant processing on the data when sending the data, the target receiving end performs redundant recovery on the data to be broadcast before sending the data to be broadcast to the port corresponding to the upper-layer application, and restores the data according to the data to be broadcast and the decoding rules to obtain the original data, that is, the first data to be sent or the second data to be sent. Redundant recovery and data redundancy processing use the same algorithm. The data obtained by redundantly recovering the data to be broadcast is sent to the port corresponding to the upper-layer application. At the same time, the current packet loss rate of the data to be broadcast is calculated based on the redundantly recovered data, and the grouping parameter k or m is calculated based on the current packet loss rate. When the received data to be broadcast is the first data to be broadcast, the calculated grouping parameter k is fed back to the sender as adjustment information; when the received data to be broadcast is the second data to be broadcast, the calculated grouping parameter m is fed back to the data transmission device as adjustment information.
本申请在底层链路上进行数据冗余处理,优化了传输丢包的情况。在发送端进行数据冗余处理后,在接收端进行相应的冗余恢复,有效降低传输丢包概率,提高数据传输准确性。This application performs data redundancy processing on the underlying link to optimize the situation of transmission packet loss. After data redundancy processing is performed on the sending end, corresponding redundancy recovery is performed on the receiving end, effectively reducing the probability of transmission packet loss and improving data transmission accuracy.
示例性的,图6为本申请实施例提供的一种应用于目标接收端的数据传输的时序图,目标接收端包括第三无线通信模组51、第三应用程序52、UDP端口53和第二上层应用程序54。其中,第三无线通信模组51设置为接收外部设备发送的待广播数据,第三应用程序52为用于执行本申请的数据传输方法,第二上层应用程序54为目标接收端的上层应用程序。第三应用程序52包括冗余恢复模块521。第二上层应用程序54相对第三应用程序52为上层应用。Exemplarily, FIG6 is a timing diagram of data transmission applied to a target receiving end provided by an embodiment of the present application, wherein the target receiving end includes a third wireless communication module 51, a third application 52, a UDP port 53, and a second upper layer application 54. Among them, the third wireless communication module 51 is configured to receive data to be broadcasted sent by an external device, the third application 52 is used to execute the data transmission method of the present application, and the second upper layer application 54 is an upper layer application of the target receiving end. The third application 52 includes a redundancy recovery module 521. The second upper layer application 54 is an upper layer application relative to the third application 52.
设置第三无线通信模组51处于监听(monitor)模式,第三无线通信模组51接收发送端或数据传输设备所发送的待广播数据,第三应用程序52中的冗余恢复模块521从第三无线通信模组51处获取待广播数据,例如通过调用pcap库捕获第三无线通信模组51所接收的待广播数据,并在待广播数据进行了数据冗余处理时,对待广播数据进行冗余恢复,将冗余恢复后所得到的数据转发至UDP端口53,第二上层应用程序54通过监听UDP端口53获取待广播数据。若待广播数据未进行数据冗余处理,无需进行冗余恢复,直接将待广播数据转发至UDP端口53。图5以待广播数据进行了数据冗余处理为例。The third wireless communication module 51 is set in the monitor mode, and the third wireless communication module 51 receives the data to be broadcast sent by the transmitter or the data transmission device. The redundancy recovery module 521 in the third application 52 obtains the data to be broadcast from the third wireless communication module 51, for example, by calling the pcap library to capture the data to be broadcast received by the third wireless communication module 51, and when the data to be broadcast is subjected to data redundancy processing, the data to be broadcast is redundancy recovered, and the data obtained after redundancy recovery is forwarded to the UDP port 53. The second upper layer application 54 obtains the data to be broadcast by monitoring the UDP port 53. If the data to be broadcast is not subjected to data redundancy processing, there is no need to perform redundancy recovery, and the data to be broadcast is directly forwarded to the UDP port 53. FIG5 takes the data to be broadcast subjected to data redundancy processing as an example.
示例性的,图7为本申请实施例提供的一种目标接收端和发送端之间的数据传输的实现示例图。其中,将发送端对应的上层应用程序作为第一上层应用程序61,将目标接收端对应的上层应用程序作为第二上层应用程序66。发送端包括第一上层应用程序61、第一应用程序62和第一无线通信模组63,目标接收端包括第三无线通信模组64、第三应用程序65和第二上层应用程序66。第一上层应用程序61生成共享数据,并采用UDP协议进行封装得到第一待发送数据,通过UDP协议将第一待发送数据发送至第一应用程序62。第一应用程序 62对第一待发送数据进行处理得到第一目标数据,并将第一目标数据注入到第一无线通信模组63,第一无线通信模组63根据第一目标数据确定第一预设链路参数以及第一待广播数据,根据第一预设链路参数对第一待广播数据进行处理和发送。第一无线通信模组63通过wifibroadcast链路将第一待广播数据发送至目标接收端的第三无线通信模组64。第三应用程序65捕获第三无线通信模组64所接收的待广播数据,对待广播数据进行处理,并通过UDP协议将待广播数据发送至第二上层应用66。Exemplarily, FIG7 is an implementation example diagram of data transmission between a target receiving end and a sending end provided in an embodiment of the present application. Among them, the upper layer application corresponding to the sending end is used as the first upper layer application 61, and the upper layer application corresponding to the target receiving end is used as the second upper layer application 66. The sending end includes the first upper layer application 61, the first application 62 and the first wireless communication module 63, and the target receiving end includes the third wireless communication module 64, the third application 65 and the second upper layer application 66. The first upper layer application 61 generates shared data, and encapsulates it using the UDP protocol to obtain the first data to be sent, and sends the first data to be sent to the first application 62 through the UDP protocol. The first application 62 processes the first data to be sent to obtain the first target data, and injects the first target data into the first wireless communication module 63. The first wireless communication module 63 determines the first preset link parameter and the first data to be broadcast according to the first target data, and processes and sends the first data to be broadcast according to the first preset link parameter. The first wireless communication module 63 sends the first data to be broadcast to the third wireless communication module 64 of the target receiving end through the wifibroadcast link. The third application 65 captures the data to be broadcast received by the third wireless communication module 64, processes the data to be broadcast, and sends the data to be broadcast to the second upper layer application 66 through the UDP protocol.
数据传输设备与目标接收端之间的数据传输的实现原理与发送端与目标接收端之间的数据传输的实现原理相同,在此不再赘述,本领域技术人员可以知晓。The implementation principle of data transmission between the data transmission device and the target receiving end is the same as the implementation principle of data transmission between the transmitting end and the target receiving end, which will not be repeated here and can be known by those skilled in the art.
实施例五Embodiment 5
图8为本申请实施例五提供的一种传屏器的结构示意图。传屏器包括通信接口71、处理器72、第二无线通信模组73和存储器74。处理器72分别与通信接口71、第二无线通信模组73和存储器74电连接。通信接口71可以为Type-A接口、Type-C接口或其他类型的通用串行总线(Universal Serial Bus,USB)接口,通信接口71设置为与源设备连接以接收源设备所发送的共享数据,并将共享数据发送至处理器72。其中,源设备具有第一处理器、存储器以及第一显示器,第一处理器安装有第一操作系统,该第一操作系统预装有通信接口71与外围装置之间进行音视频通讯的通用驱动协议,所述音视频数据对应的媒体内容与第一显示器上显示的媒体内容相同。通信接口71与处理器72连接,将所接收到的共享数据发送至处理器72。FIG8 is a schematic diagram of the structure of a screen transmitter provided in Embodiment 5 of the present application. The screen transmitter includes a communication interface 71, a processor 72, a second wireless communication module 73 and a memory 74. The processor 72 is electrically connected to the communication interface 71, the second wireless communication module 73 and the memory 74 respectively. The communication interface 71 may be a Type-A interface, a Type-C interface or other types of Universal Serial Bus (USB) interfaces, and the communication interface 71 is configured to connect to a source device to receive shared data sent by the source device and send the shared data to the processor 72. The source device has a first processor, a memory and a first display, and the first processor is installed with a first operating system, which is pre-installed with a general driver protocol for audio and video communication between the communication interface 71 and the peripheral device, and the media content corresponding to the audio and video data is the same as the media content displayed on the first display. The communication interface 71 is connected to the processor 72 to send the received shared data to the processor 72.
存储器74,设置为存储第二应用程序,第二应用程序存储有第二预设链路参数。The memory 74 is configured to store a second application program, wherein the second application program stores a second preset link parameter.
处理器72是该传屏器的控制中心,利用多种接口和线路连接整个传屏器的多个部分,通过运行或执行软件程序和/或模块,执行传屏器的多种功能和处理数据,从而对传屏器进行整体监控。处理器72通过通信接口71获取源设备生成的共享数据,基于共享数据执行第二应用程序以获取基于共享数据形成的采用用户数据报协议封装的第二待发送数据,根据第二预设链路参数对第二待发送数据进行处理以得到第二目标数据,将第二目标数据发给第二无线通信模组73。The processor 72 is the control center of the screen transmitter, and uses multiple interfaces and lines to connect multiple parts of the entire screen transmitter. By running or executing software programs and/or modules, it performs multiple functions of the screen transmitter and processes data, thereby monitoring the screen transmitter as a whole. The processor 72 obtains the shared data generated by the source device through the communication interface 71, executes the second application based on the shared data to obtain the second data to be sent encapsulated by the user datagram protocol based on the shared data, processes the second data to be sent according to the second preset link parameters to obtain the second target data, and sends the second target data to the second wireless communication module 73.
第二无线通信模组73是借助无线通信技术实现的模块化产品,可以将接收到的信号以无线形式发送到无线通信网络中,使信号被无线通信网络中的网络 节点捕获。例如被广泛应用于短距离局域网通信的WiFi模块、蓝牙模块或ZigBee模块等。第二无线通信模组73与处理器72连接,本实施例提供的第二无线通信模组73可以将从处理器72获取到的第二目标数据进行解析,确定第二待广播数据以及第二预设链路参数,根据第二预设链路参数广播第二待广播数据,以实现将第二待广播数据发送到无线通信网络中的其他网络节点,再通过网络节点将第二待广播数据发送至传屏接收端进行视频画面的显示。The second wireless communication module 73 is a modular product realized by wireless communication technology, which can send the received signal to the wireless communication network in a wireless form, so that the signal can be received by the network in the wireless communication network. Node capture. For example, WiFi modules, Bluetooth modules or ZigBee modules that are widely used in short-range local area network communications. The second wireless communication module 73 is connected to the processor 72. The second wireless communication module 73 provided in this embodiment can parse the second target data obtained from the processor 72, determine the second data to be broadcast and the second preset link parameters, and broadcast the second data to be broadcast according to the second preset link parameters, so as to send the second data to be broadcast to other network nodes in the wireless communication network, and then send the second data to be broadcast to the screen receiving end through the network node to display the video picture.
本申请实施例所提供的传屏器可执行本申请实施例三所提供的数据传输方法,具备执行方法相应的功能模块和效果。The screen transmitter provided in the embodiment of the present application can execute the data transmission method provided in the third embodiment of the present application, and has the corresponding functional modules and effects of the execution method.
实施例Example
图9示出了可以用来实施本申请的实施例的电子设备80的结构示意图。电子设备可以表示多种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示多种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备(如头盔、眼镜、手表等)和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或要求的本申请的实现。FIG9 shows a block diagram of an electronic device 80 that can be used to implement an embodiment of the present application. The electronic device can represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and/or required herein.
如图9所示,电子设备80包括至少一个处理器81,以及与至少一个处理器81通信连接的存储器,如只读存储器(Read-Only Memory,ROM)82、随机访问存储器(Random Access Memory,RAM)83等,其中,存储器存储有可被至少一个处理器执行的计算机程序,处理器81可以根据存储在只读存储器(ROM)82中的计算机程序或者从存储单元88加载到随机访问存储器(RAM)83中的计算机程序,来执行多种适当的动作和处理。在RAM 83中,还可存储电子设备80操作所需的多种程序和数据。处理器81、ROM 82以及RAM 83通过总线84彼此相连。输入/输出(Input/Output,I/O)接口85也连接至总线84。As shown in FIG9 , the electronic device 80 includes at least one processor 81, and a memory connected to the at least one processor 81, such as a read-only memory (ROM) 82, a random access memory (RAM) 83, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 81 can perform a variety of appropriate actions and processes according to the computer program stored in the ROM 82 or the computer program loaded from the storage unit 88 to the RAM 83. In the RAM 83, a variety of programs and data required for the operation of the electronic device 80 can also be stored. The processor 81, the ROM 82, and the RAM 83 are connected to each other through a bus 84. The input/output (I/O) interface 85 is also connected to the bus 84.
电子设备80中的多个部件连接至I/O接口85,包括:输入单元86,例如键盘、鼠标等;输出单元87,例如多种类型的显示器、扬声器等;存储单元88,例如磁盘、光盘等;以及通信单元89,例如网卡、调制解调器、无线通信收发机等。通信单元89允许电子设备80通过诸如因特网的计算机网络和/或多种电信网络与其他设备交换信息/数据。A number of components in the electronic device 80 are connected to the I/O interface 85, including: an input unit 86, such as a keyboard, a mouse, etc.; an output unit 87, such as various types of displays, speakers, etc.; a storage unit 88, such as a disk, an optical disk, etc.; and a communication unit 89, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 89 allows the electronic device 80 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.
处理器81可以是多种具有处理和计算能力的通用和/或专用处理组件。处理器81的一些示例包括但不限于中央处理单元(Central Processing Unit,CPU)、图形处理单元(Graphic Processing Unit,GPU)、多种专用的人工智能(Artificial  Intelligence,AI)计算芯片、多种运行机器学习模型算法的处理器、数字信号处理器(Digital Signal Processing,DSP)、以及任何适当的处理器、控制器、微控制器等。处理器81执行上文所描述的方法和处理,例如数据传输方法。The processor 81 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the processor 81 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), a variety of special artificial intelligence (AI), and a variety of other processors. The processor 81 may include a processor for performing artificial intelligence (AI) computing, a plurality of processors for running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 81 performs the methods and processes described above, such as the data transmission method.
在一些实施例中,数据传输方法可被实现为计算机程序,其被有形地包含于计算机可读存储介质,例如存储单元88。在一些实施例中,计算机程序的部分或者全部可以经由ROM 82和/或通信单元88而被载入和/或安装到电子设备80上。当计算机程序加载到RAM 83并由处理器81执行时,可以执行上文描述的数据传输方法的一个或多个步骤。备选地,在其他实施例中,处理器81可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行数据传输方法。In some embodiments, the data transmission method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 88. In some embodiments, part or all of the computer program may be loaded and/or installed on the electronic device 80 via the ROM 82 and/or the communication unit 88. When the computer program is loaded into the RAM 83 and executed by the processor 81, one or more steps of the data transmission method described above may be performed. Alternatively, in other embodiments, the processor 81 may be configured to perform the data transmission method in any other suitable manner (e.g., by means of firmware).
本文中以上描述的系统和技术的实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(Field Programmable Gate Array,FPGA)、专用集成电路(Application Specific Integrated Circuit,ASIC)、专用标准产品(Application Specific Standard Product,ASSP)、系统级芯片(System on Chip,SOC)、复杂可编程逻辑设备(Complex Programmable Logic Device,CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Implementations of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These implementations may include: being implemented in one or more computer programs that are executable and/or interpreted on a programmable system that includes at least one programmable processor that may be a special purpose or general purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
用于实施本申请的方法的计算机程序可以采用一个或多个编程语言来编写。这些计算机程序可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器,使得计算机程序当由处理器执行时使流程图和/或框图中所规定的功能/操作被实施。计算机程序可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。The computer programs for implementing the methods of the present application may be written in one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions/operations specified in the flow charts and/or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
在本申请的上下文中,计算机可读存储介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的计算机程序。计算机可读存储介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的半导体系统、装置或设备,或者上述内容的任何合适组合。备选地,计算机可读存储介质可以是机器可读信号介质。机器可读存储介质可以包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EPROM)或快闪存储 器、光纤、便捷式紧凑盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present application, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. Computer-readable storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A machine-readable storage medium may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EPROM), or a flash memory. device, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
为了提供与用户的交互,可以在电子设备上实施此处描述的系统和技术,该电子设备具有:设置为向用户显示信息的显示装置(例如,阴极射线管(Cathode Ray Tube,CRT)或者液晶显示器(Liquid Crystal Display,LCD)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给电子设备。其它种类的装置还可以设置为提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) configured to display information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be configured to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(Local Area Network,LAN)、广域网(Wide Area Network,WAN)、区块链网络和互联网。The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN), blockchain network, and the Internet.
计算系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在计算机上运行彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决传统物理主机与虚拟专用服务器(Virtual Private Server,VPS)服务中,存在的管理难度大,业务扩展性弱的缺陷。 A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client-server relationship is generated by running computer programs on the computers that have a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

Claims (17)

  1. 一种数据传输方法,应用于发送端,所述发送端包括第一无线通信模组和第一应用程序,所述第一无线通信模组设置为监听模式,包括:A data transmission method is applied to a transmitting end, wherein the transmitting end includes a first wireless communication module and a first application program, and the first wireless communication module is set to a monitoring mode, comprising:
    所述第一应用程序获取采用用户数据报协议封装的第一待发送数据,并根据第一预设链路参数对所述第一待发送数据进行处理以得到第一目标数据;The first application obtains first data to be sent encapsulated in the user datagram protocol, and processes the first data to be sent according to a first preset link parameter to obtain first target data;
    所述第一无线通信模组对所述第一目标数据进行解析确定第一待广播数据以及第一预设链路参数,根据所述第一预设链路参数广播所述第一待广播数据,以使所述第一待广播数据被目标接收端接收。The first wireless communication module parses the first target data to determine first data to be broadcast and first preset link parameters, and broadcasts the first data to be broadcast according to the first preset link parameters, so that the first data to be broadcast is received by a target receiving end.
  2. 根据权利要求1所述的方法,在所述第一应用程序获取采用用户数据报协议封装的第一待发送数据之后,还包括:The method according to claim 1, after the first application obtains the first data to be sent encapsulated in the user datagram protocol, further comprises:
    所述第一应用程序确定所述第一待发送数据的第一数据长度,并对所述第一数据长度进行长度验证。The first application determines a first data length of the first data to be sent, and performs length verification on the first data length.
  3. 根据权利要求1所述的方法,其中,所述第一应用程序根据第一预设链路参数对所述第一待发送数据进行处理以得到第一目标数据,包括:The method according to claim 1, wherein the first application processes the first data to be sent according to the first preset link parameter to obtain the first target data, comprising:
    所述第一应用程序将所述第一待发送数据分成k个第一数据包,其中,k为分组参数;The first application divides the first data to be sent into k first data packets, where k is a grouping parameter;
    所述第一应用程序对每一第一数据包增加冗余数据后进行编码,以得到n个第一编码数据包;The first application program adds redundant data to each first data packet and then encodes the data packet to obtain n first encoded data packets;
    所述第一应用程序将所述第一预设链路参数加入到每个第一编码数据包中,以得到第一目标数据。The first application program adds the first preset link parameter to each first encoded data packet to obtain first target data.
  4. 根据权利要求3所述的方法,其中,所述k的数值由所述发送端根据所述目标接收端反馈的调整信息计算得到。The method according to claim 3, wherein the value of k is calculated by the transmitting end based on the adjustment information fed back by the target receiving end.
  5. 根据权利要求1-4任一项所述的方法,其中,所述第一预设链路参数至少包括以下一项:单包编码方式、单包发送数据大小、数据包发送速度和调制方式。The method according to any one of claims 1 to 4, wherein the first preset link parameter includes at least one of the following: a single packet encoding mode, a single packet sending data size, a data packet sending speed, and a modulation mode.
  6. 一种数据传输方法,应用于数据传输设备,所述数据传输设备包括处理器、存储器、通信接口和第二无线通信模组,所述存储器、所述通信接口、所述第二无线通信模组均与所述处理器形成电连接,所述第二无线通信模组设置为监听模式,所述存储器存储有第二应用程序,所述第二应用程序存储有第二预设链路参数;A data transmission method is applied to a data transmission device, wherein the data transmission device comprises a processor, a memory, a communication interface and a second wireless communication module, wherein the memory, the communication interface and the second wireless communication module are all electrically connected to the processor, the second wireless communication module is set to a monitoring mode, the memory stores a second application program, and the second application program stores a second preset link parameter;
    所述数据传输方法包括:The data transmission method comprises:
    所述通信接口与源设备建立连接; The communication interface establishes a connection with a source device;
    所述处理器通过所述通信接口获取所述源设备生成的共享数据;The processor acquires the shared data generated by the source device through the communication interface;
    所述处理器基于所述共享数据执行所述第二应用程序,所述第二应用程序用于获取基于所述共享数据形成的采用用户数据报协议封装的第二待发送数据,并根据第二预设链路参数对所述第二待发送数据进行处理以得到第二目标数据;The processor executes the second application based on the shared data, the second application being used to obtain second data to be sent encapsulated in a user datagram protocol based on the shared data, and processes the second data to be sent according to a second preset link parameter to obtain second target data;
    所述处理器将所述第二目标数据发给所述第二无线通信模组;The processor sends the second target data to the second wireless communication module;
    所述第二无线通信模组对所述第二目标数据进行解析确定第二待广播数据以及第二预设链路参数,根据所述第二预设链路参数广播所述第二待广播数据,以使所述第二待广播数据被目标接收端接收。The second wireless communication module parses the second target data to determine second data to be broadcast and second preset link parameters, and broadcasts the second data to be broadcast according to the second preset link parameters so that the second data to be broadcast is received by the target receiving end.
  7. 根据权利要求6所述的方法,在所述第二应用程序获取基于所述共享数据形成的采用用户数据报协议封装的第二待发送数据之后,还包括:The method according to claim 6, after the second application obtains the second data to be sent encapsulated in the user datagram protocol based on the shared data, further comprising:
    所述第二应用程序确定所述第二待发送数据的第二数据长度,并对所述第二数据长度进行长度验证。The second application determines a second data length of the second data to be sent, and performs length verification on the second data length.
  8. 根据权利要求6所述的方法,其中,所述第二应用程序根据第二预设链路参数对所述第二待发送数据进行处理以得到第二目标数据,包括:The method according to claim 6, wherein the second application processes the second data to be sent according to the second preset link parameter to obtain the second target data, comprising:
    所述第二应用程序将所述第二待发送数据分成m个第二数据包,其中,m为分组参数;The second application program divides the second data to be sent into m second data packets, where m is a grouping parameter;
    所述第二应用程序对每一第二数据包增加冗余数据后进行编码,以得到i个第二编码数据包;The second application program adds redundant data to each second data packet and then encodes the data packet to obtain i second encoded data packets;
    所述第二应用程序将所述第二预设链路参数加入到每个第二编码数据包中,以得到第二目标数据。The second application program adds the second preset link parameter to each second encoded data packet to obtain second target data.
  9. 根据权利要求8所述的方法,其中,所述m的数值由所述数据传输设备根据所述目标接收端反馈的调整信息计算得到。The method according to claim 8, wherein the value of m is calculated by the data transmission device based on the adjustment information fed back by the target receiving end.
  10. 根据权利要求6-9任一项所述的方法,其中,所述第二预设链路参数至少包括以下一项:单包编码方式、单包发送数据大小、数据包发送速度和调制方式。The method according to any one of claims 6 to 9, wherein the second preset link parameter includes at least one of the following: single packet encoding mode, single packet transmission data size, data packet transmission speed and modulation mode.
  11. 一种数据传输方法,应用于目标接收端,所述目标接收端包括第三无线通信模组、第三应用程序和上层应用程序,所述第三无线通信模组设置为监听模式,包括:A data transmission method is applied to a target receiving end, wherein the target receiving end includes a third wireless communication module, a third application program, and an upper layer application program, wherein the third wireless communication module is set to a monitoring mode, including:
    所述第三无线通信模组接收待广播数据,所述待广播数据根据权利要求1-10任一项的数据传输方法发送;The third wireless communication module receives the data to be broadcast, wherein the data to be broadcast is sent according to the data transmission method according to any one of claims 1 to 10;
    所述第三应用程序获取所述第三无线通信模组所接收的待广播数据,并在确定满足处理条件的情况下,将所述待广播数据发送至所述上层应用程序所对 应的端口,以便所述上层应用程序获取所述待广播数据。The third application obtains the data to be broadcast received by the third wireless communication module, and sends the data to be broadcast to the upper layer application when it is determined that the processing condition is met. The corresponding port is used so that the upper layer application can obtain the data to be broadcast.
  12. 根据权利要求11所述的方法,其中,所述待广播数据通过无线网络通信广播链路接收。The method according to claim 11, wherein the data to be broadcast is received via a wireless network communication broadcast link.
  13. 根据权利要求11所述的方法,其中,所述处理条件为:所述待广播数据对应的目标地址与所述目标接收端的地址匹配,且所述待广播数据对应的组网地址与所述目标接收端的组网地址匹配。The method according to claim 11, wherein the processing condition is: the target address corresponding to the data to be broadcast matches the address of the target receiving end, and the networking address corresponding to the data to be broadcast matches the networking address of the target receiving end.
  14. 根据权利要求11-13任一项所述的方法,在所述第三应用程序将所述待广播数据发送至所述上层应用程序所对应的端口之前,还包括:The method according to any one of claims 11 to 13, before the third application sends the data to be broadcast to the port corresponding to the upper layer application, further comprising:
    所述第三应用程序根据所述待广播数据进行冗余恢复,根据冗余恢复后的数据计算所述待广播数据的当前丢包率;The third application performs redundancy recovery according to the data to be broadcast, and calculates the current packet loss rate of the data to be broadcast according to the data after redundancy recovery;
    所述第三应用程序根据所述当前丢包率确定分组参数k或m,并将所述分组参数作为调整信息反馈至所述发送端或所述数据传输设备。The third application determines a grouping parameter k or m according to the current packet loss rate, and feeds back the grouping parameter as adjustment information to the sending end or the data transmission device.
  15. 一种电子设备,包括:An electronic device, comprising:
    至少一个处理器;以及at least one processor; and
    与所述至少一个处理器通信连接的存储器;a memory communicatively coupled to the at least one processor;
    其中,所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-5以及11-14中任一项所述的数据传输方法。The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data transmission method described in any one of claims 1-5 and 11-14.
  16. 一种传屏器,包括处理器、存储器、通信接口和第二无线通信模组,所述存储器、所述通信接口、所述第二无线通信模组均与所述处理器形成电连接;A screen transmitter comprises a processor, a memory, a communication interface and a second wireless communication module, wherein the memory, the communication interface and the second wireless communication module are all electrically connected to the processor;
    所述通信接口,设置为与源设备连接;The communication interface is configured to connect to a source device;
    所述存储器,设置为存储第二应用程序,所述第二应用程序存储有第二预设链路参数;The memory is configured to store a second application program, wherein the second application program stores a second preset link parameter;
    所述处理器,设置为通过所述通信接口获取所述源设备生成的共享数据,基于所述共享数据执行所述第二应用程序以获取基于所述共享数据形成的采用用户数据报协议封装的第二待发送数据,根据第二预设链路参数对所述第二待发送数据进行处理以得到第二目标数据,将所述第二目标数据发给所述第二无线通信模组;The processor is configured to obtain the shared data generated by the source device through the communication interface, execute the second application based on the shared data to obtain second data to be sent encapsulated in a user datagram protocol based on the shared data, process the second data to be sent according to a second preset link parameter to obtain second target data, and send the second target data to the second wireless communication module;
    第二无线通信模组,设置为对所述第二目标数据进行解析确定第二待广播数据以及第二预设链路参数,根据所述第二预设链路参数广播所述第二待广播数据,以使所述第二待广播数据被目标接收端接收。 The second wireless communication module is configured to parse the second target data to determine second data to be broadcast and second preset link parameters, and broadcast the second data to be broadcast according to the second preset link parameters so that the second data to be broadcast is received by the target receiving end.
  17. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使处理器执行时实现权利要求1-14中任一项所述的数据传输方法。 A computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable a processor to implement the data transmission method according to any one of claims 1 to 14 when executed.
PCT/CN2023/115163 2022-10-08 2023-08-28 Data transmission method, electronic device, screen transmitter and storage medium WO2024074085A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211222789.6 2022-10-08
CN202211222789.6A CN117896447A (en) 2022-10-08 2022-10-08 Data transmission method, electronic equipment, screen transmitter and storage medium

Publications (1)

Publication Number Publication Date
WO2024074085A1 true WO2024074085A1 (en) 2024-04-11

Family

ID=90607532

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/115163 WO2024074085A1 (en) 2022-10-08 2023-08-28 Data transmission method, electronic device, screen transmitter and storage medium

Country Status (2)

Country Link
CN (1) CN117896447A (en)
WO (1) WO2024074085A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180131999A1 (en) * 2016-11-09 2018-05-10 Samsung Electronics Co., Ltd. Display apparatus and set-top box identification method thereof
CN108259813A (en) * 2018-01-30 2018-07-06 北京小鱼易连科技有限公司 Multi-functional biography screen device, system and method
CN110266437A (en) * 2019-06-26 2019-09-20 北京奇艺世纪科技有限公司 It throws screen message method, throw screen message treatment method, device and terminal
CN111405228A (en) * 2020-04-30 2020-07-10 聚好看科技股份有限公司 Television, device and method for realizing automatic optimization of video call fluency
CN111459433A (en) * 2020-03-30 2020-07-28 广州视源电子科技股份有限公司 Screen transmission method, equipment and storage medium
CN114610253A (en) * 2020-12-08 2022-06-10 华为技术有限公司 Screen projection method and equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180131999A1 (en) * 2016-11-09 2018-05-10 Samsung Electronics Co., Ltd. Display apparatus and set-top box identification method thereof
CN108259813A (en) * 2018-01-30 2018-07-06 北京小鱼易连科技有限公司 Multi-functional biography screen device, system and method
CN110266437A (en) * 2019-06-26 2019-09-20 北京奇艺世纪科技有限公司 It throws screen message method, throw screen message treatment method, device and terminal
CN111459433A (en) * 2020-03-30 2020-07-28 广州视源电子科技股份有限公司 Screen transmission method, equipment and storage medium
CN111405228A (en) * 2020-04-30 2020-07-10 聚好看科技股份有限公司 Television, device and method for realizing automatic optimization of video call fluency
CN114610253A (en) * 2020-12-08 2022-06-10 华为技术有限公司 Screen projection method and equipment

Also Published As

Publication number Publication date
CN117896447A (en) 2024-04-16

Similar Documents

Publication Publication Date Title
US20200358886A1 (en) Data Transmission Method, Apparatus, And System
KR101457241B1 (en) Full mesh rates transaction in a network
US9571382B2 (en) Method, controller, and system for processing data packet
US7502860B1 (en) Method and apparatus for client-side flow control in a transport protocol
US11477130B2 (en) Transmission control method and apparatus
US20230060066A1 (en) Data transmission method and apparatus, computer readable medium, and electronic device
US20230071243A1 (en) Conserving network resources during transmission of packets of interactive services
WO2015172668A1 (en) Method and device for determining congestion window in network
WO2023093879A1 (en) Data transmission method and apparatus, device, and storage medium
EP4287591A1 (en) Data transmission method and apparatus, and server, storage medium and program product
CN109067796A (en) A kind of data transmission method and device
WO2017148419A1 (en) Data transmission method and server
CN107508828B (en) A kind of very-long-range data interaction system and method
CN114221909B (en) Data transmission method, device, terminal and storage medium
WO2022100199A1 (en) Data transmission method and apparatus, and medium, electronic device and network access device
CN109067922A (en) A kind of data transmission method and device
WO2024074085A1 (en) Data transmission method, electronic device, screen transmitter and storage medium
CN107078837A (en) A kind of agreement frame transmission method, device, node device and system
CN112994848B (en) MCS (modulation and coding scheme) adjusting method and device, storage medium and wireless node
US20220217093A1 (en) Sequence Number Synchronization Method and Apparatus
WO2015096734A1 (en) Downlink transmission method for service data, and packet data gateway
CN115633037A (en) Method, device, virtual gateway equipment, medium and system for forwarding data packet
WO2021103822A1 (en) Method for acquiring common maximum segment size (mss), and device
CN115277649A (en) Method and device for collaboratively editing document in multimedia conference scene
CN112533154B (en) Data processing method, device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23874277

Country of ref document: EP

Kind code of ref document: A1