CN114221909B - Data transmission method, device, terminal and storage medium - Google Patents

Data transmission method, device, terminal and storage medium Download PDF

Info

Publication number
CN114221909B
CN114221909B CN202111515688.3A CN202111515688A CN114221909B CN 114221909 B CN114221909 B CN 114221909B CN 202111515688 A CN202111515688 A CN 202111515688A CN 114221909 B CN114221909 B CN 114221909B
Authority
CN
China
Prior art keywords
data
transmission
target
packet
strategy
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202111515688.3A
Other languages
Chinese (zh)
Other versions
CN114221909A (en
Inventor
胡海清
杨俊拯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Douku Software Technology Co Ltd
Original Assignee
Hangzhou Douku Software Technology Co Ltd
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 Hangzhou Douku Software Technology Co Ltd filed Critical Hangzhou Douku Software Technology Co Ltd
Priority to CN202111515688.3A priority Critical patent/CN114221909B/en
Publication of CN114221909A publication Critical patent/CN114221909A/en
Application granted granted Critical
Publication of CN114221909B publication Critical patent/CN114221909B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • 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

Abstract

The embodiment of the application discloses a data transmission method, a data transmission device, a terminal and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring the data type of target data; the data type is determined based on the service type of the service to which the target data belongs; determining a target transmission policy based on a data type of the target data; the target transmission strategy comprises relevant information for controlling congestion conditions in the transmission process of target data; and transmitting the target data to the data receiving device based on the target transmission policy. The scheme can pertinently configure related strategies in the transmission process for the data of different services, and pertinently improve the performance of data transmission, so as to meet different requirements on the data transmission under different services, and further improve the effect of the data transmission.

Description

Data transmission method, device, terminal and storage medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a data transmission method, a data transmission device, a terminal and a storage medium.
Background
At present, everything is becoming the technology development trend in the future gradually, and everything can be realized fast by the assistance of distributed architecture. The distributed architecture can realize quick connection and hardware capacity sharing among different devices, and perform cross-device data synchronous management and task scheduling.
In the related art, data transmission between the respective devices in the distributed architecture may be performed through a reliable transmission protocol based on UDP (User Datagram Protocol, user packet protocol), such as the quitc (Quick UDPInternet Connection, fast UDP network connection) protocol.
However, the QUIC protocol-based data transmission between devices has a fast data transmission speed, but cannot meet the requirements of delay, jamming and the like, resulting in poor data transmission effect.
Disclosure of Invention
The embodiment of the application provides a data transmission method, a device, a terminal and a storage medium, which can pertinently configure related strategies in the transmission process for different types of data, thereby meeting the requirements of different services on data transmission and further improving the effect of data transmission. The technical scheme is as follows:
in one aspect, an embodiment of the present application provides a data transmission method, where the method is performed by a data sending device, and the method includes:
acquiring the data type of target data; the data type is determined based on the service type of the service to which the target data belongs;
determining a target transmission strategy based on the data type of the target data; the target transmission strategy comprises relevant information for controlling congestion conditions in the transmission process of the target data;
And transmitting the target data to data receiving equipment based on the target transmission strategy.
In one aspect, an embodiment of the present application provides a data transmission method, which is performed by a data receiving apparatus, the method including:
receiving a target data packet sent by data sending equipment;
acquiring a target transmission strategy; the target transmission strategy is determined based on the data type of target data to which the target data packet belongs; the target transmission strategy comprises relevant information for controlling congestion conditions in the transmission process of the target data;
and analyzing the target data packet based on the target transmission strategy.
On the other hand, an embodiment of the present application provides a data transmission apparatus, where the apparatus is used in a data sending device, and the apparatus includes:
the type acquisition module is used for acquiring the data type of the target data; the data type is determined based on the service type of the service to which the target data belongs;
the strategy determining module is used for determining a target transmission strategy based on the data type of the target data; the target transmission strategy comprises relevant information for controlling congestion conditions in the transmission process of the target data;
And the data sending module is used for sending the target data to the data receiving equipment based on the target transmission strategy.
In another aspect, an embodiment of the present application provides a data transmission apparatus, where the apparatus is used in a data receiving device, and the apparatus includes:
the packet receiving module is used for receiving the target data packet sent by the data sending equipment;
the strategy acquisition module is used for acquiring a target transmission strategy; the target transmission strategy is determined based on the data type of target data to which the target data packet belongs; the target transmission strategy comprises relevant information for controlling congestion conditions in the transmission process of the target data;
and the packet analysis module is used for analyzing and processing the target data packet based on the target transmission strategy.
In another aspect, an embodiment of the present application provides a terminal, where the terminal includes a processor and a memory; the memory has stored therein at least one computer instruction that is loaded and executed by the processor to implement the data transmission method as described in the above aspects.
In another aspect, embodiments of the present application provide a computer readable storage medium having stored therein at least one computer instruction that is loaded and executed by a processor to implement a data transmission method as described in the above aspects.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the terminal performs the data transmission method provided in various alternative implementations of the above aspect.
The beneficial effects of the technical scheme provided by the embodiment of the application at least comprise:
when data transmission between devices is needed in the process of carrying out a certain service, the data sending side can determine a target transmission strategy of target data based on the data type of the target data transmitted in the service, so as to realize corresponding control on congestion conditions in the process of transmitting the target data according to the target transmission strategy, thereby completing the transmission of the target data of the service. Because the requirements on data transmission in different business processes are different, the scheme can pertinently configure related strategies in the transmission process for the data of different businesses, and the performance of the data transmission is pertinently improved, so that the different requirements on the data transmission in different businesses are met, and the effect of the data transmission is further improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic illustration of an application scenario in accordance with an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of data transmission according to an exemplary embodiment;
FIG. 3 is a flow chart illustrating a method of data transmission according to an exemplary embodiment;
fig. 4 is a flow chart illustrating a data transmission method according to another exemplary embodiment;
FIG. 5 is a flow chart of processing and transmitting target data in accordance with the embodiment of FIG. 4;
FIG. 6 is a flow chart of a process for receiving a destination data packet in accordance with the embodiment of FIG. 4;
FIG. 7 is a block diagram of a data transfer process according to the embodiment of FIG. 4;
fig. 8 is a block diagram of a data transmission apparatus according to an exemplary embodiment of the present application;
fig. 9 is a block diagram of a data transmission apparatus according to an exemplary embodiment of the present application;
fig. 10 is a block diagram illustrating a structure of a terminal according to an exemplary embodiment of the present application.
Specific embodiments of the present disclosure have been shown by way of the above drawings and will be described in more detail below. These drawings and the written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the disclosed concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
References herein to "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The subsequent embodiment of the application provides a scheme for data transmission, and the data transmission between the devices can be realized under the application scene of everything mutual fusion.
Please refer to fig. 1, which illustrates an application scenario diagram according to various embodiments of the present application. As shown in fig. 1, at least two terminals 100 are included in the system. For example, the terminal 100 may be a smart phone, a tablet computer, an electronic book reader, a personal portable computer, a smart home device, etc.
Alternatively, data transmission may be performed between the respective terminals 100 after session connection is established.
The terminals 100 may also be connected by a wired or wireless network, optionally using standard communication techniques and/or protocols, as one possible scenario. The network is typically the internet, but may be any network including, but not limited to, a Local area network (Local AreaNetwork, LAN), metropolitan area network (Metropolitan Area Network, MAN), wide area network (Wide Area Network, WAN), mobile, wired or wireless network, private network, or any combination of virtual private networks. In some embodiments, data exchanged over the network is represented using techniques and/or formats including HyperText Mark-up Language (HTML), extensible markup Language (Extensible Markup Language, XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as secure socket layer (Secure Socket Layer, SSL), transport layer security (Transport Layer Security, TLS), virtual private network (Virtual Private Network, VPN), internet protocol security (Internet Protocol Security, IPsec), and the like. In other embodiments, custom and/or dedicated data communication techniques may also be used in place of or in addition to the data communication techniques described above.
Fig. 2 shows a flowchart of a data transmission method according to an exemplary embodiment of the present application. The data transmission method may be performed by a data transmission device, which may be a terminal, for example, the terminal may be the terminal 100 in the application scenario shown in fig. 1. The data transmission method comprises the following steps:
step 201, obtaining the data type of target data; the data type is determined based on the service type of the service to which the target data belongs.
In the embodiment of the application, in the process of processing the service, the data sending device may generate the target data to be transmitted, and the data sending device may acquire the data type of the target data through the service type corresponding to the service to which the target data belongs.
Wherein the target data is data waiting to be transmitted to the data receiving device in the data transmitting device; the target data may be data that needs to be sent to the data receiving device when the data sending device performs a certain service; when the data transmitting apparatus executes a certain service, the generated data type of the target data to be transmitted to the data receiving apparatus may be related to the service type of the service.
For example, when the data transmitting device executes the video screen service, the target data to be transmitted to the data receiving device may be data with a data type of audio/video; when the data transmitting device executes the file transmission service, the target data to be transmitted to the data receiving device can be data with the data type as a file; when the data transmission apparatus performs an operation on the content of the screen-cast game, the target data to be transmitted to the data reception apparatus displaying the game screen may be data whose data type is a message for a control channel.
Step 202, determining a target transmission strategy based on the data type of the target data; the target transmission policy includes relevant information for controlling congestion conditions during transmission of the target data.
In the embodiment of the application, the data sending device may determine the selected target transmission policy based on the data type of the obtained target data.
In one possible implementation manner, at least one transmission policy is pre-stored in the data sending device, and the data sending device selects a target transmission policy corresponding to a data type of the target data from the at least one transmission policy based on the acquired data type of the target data.
Wherein the relevant information included in the at least one transmission policy controlling congestion conditions during transmission of the data may be different. For example, the types of the related information included in at least one transmission policy may be the same, and the parameters corresponding to the respective types of the related information may be different.
In one possible implementation manner, the target transmission policy includes at least one of a buffer related policy, a packet related policy, and a packet loss related policy. The buffer related strategy is used for controlling a buffer used in a data transmission process; the packet correlation strategy is used for controlling the generation and analysis processes of the data packets; the packet loss correlation strategy is used for controlling whether the data packet is discarded.
For example, each transmission policy may include a definition of a data packet format of data in a data transmission process, and each transmission policy may have a different data packet format; the transmission strategies can include definition of the size of the sending buffer of the data in the process of transmitting the data, and parameter values of the size of the sending buffer corresponding to the transmission strategies can be different.
Alternatively, the kind of the related information included in the at least one transmission policy may be different.
Step 203, sending the target data to the data receiving device based on the target transmission policy.
In the embodiment of the application, the data sending device sends the target data to the data receiving device according to the related information included in the selected target transmission strategy.
In one possible implementation, after the data transmitting device establishes a data transmission connection with the data receiving device, the data transmitting device may transmit the target data to the data receiving device through the established data transmission connection according to the related information included in the selected target transmission policy.
In summary, in the embodiment of the present application, when data transmission between devices is required in a process of performing a certain service, the data sending side may determine, based on the data type of the target data to be transmitted in the service, a target transmission policy of the target data, so as to implement corresponding control over the congestion situation in the process of transmitting the target data according to the target transmission policy, thereby completing transmission of the target data of the service. Because the requirements on data transmission in different business processes are different, the scheme can pertinently configure related strategies in the transmission process for the data of different businesses, and the performance of the data transmission is pertinently improved, so that the different requirements on the data transmission in different businesses are met, and the effect of the data transmission is further improved.
Fig. 3 shows a flowchart of a data transmission method according to an exemplary embodiment of the present application. The data transmission method may be performed by a data receiving device, which may be a terminal, for example, the terminal may be the terminal 100 in the application scenario shown in fig. 1. The data transmission method comprises the following steps:
step 301, a target data packet sent by a data sending device is received.
In the embodiment of the application, the data receiving device receives the target data packet sent by the data sending device from the network.
In one possible implementation, the data receiving device sequentially receives the plurality of target data packets transmitted by the data transmitting device.
The target data packet is a data packet generated by the data transmitting device after processing target data according to a determined target transmission policy, and based on the target data, the data transmitting device can correspondingly generate a plurality of target data packets. The data receiving device can analyze and obtain corresponding target data by receiving each target data packet sent by the data sending device.
Step 302, acquiring a target transmission strategy; the target transmission policy is determined based on a data type of target data to which the target data packet belongs; the target transmission policy includes relevant information for controlling congestion conditions during transmission of the target data.
In the embodiment of the application, the data receiving device may determine, according to the data type of the target data to which the target data packet belongs, a target transmission policy used by the target data in a transmission process. Wherein different data types may correspond to different transmission strategies.
In one possible implementation manner, after the data receiving device establishes a session connection with the data sending device, the data receiving device may acquire a data type corresponding to the target data through receiving the session connection of the target data, and the data receiving device determines a target transmission policy according to the data type.
The data receiving device may also have a pre-stored transmission policy, and after the data receiving device receives a data packet corresponding to the target data and determines a corresponding data type, the transmission policy corresponding to the data type in the pre-stored transmission policy may be used as a target transmission policy for analyzing the data packet.
Step 303, performing parsing processing on the target data packet based on the target transmission policy.
In the embodiment of the application, according to the determined target transmission policy, the data receiving device analyzes and processes the target data packets according to the related information in the target transmission policy, and obtains the target data corresponding to each target data packet.
In one possible implementation manner, the data receiving device sequentially analyzes the target data packets according to the determined target transmission policy to obtain target data corresponding to each target data packet.
In summary, in the embodiment of the present application, when data transmission between devices is required in a process of performing a certain service, the data sending side may determine, based on the data type of the target data to be transmitted in the service, a target transmission policy of the target data, so as to implement corresponding control over the congestion situation in the process of transmitting the target data according to the target transmission policy, thereby completing transmission of the target data of the service. Because the requirements on data transmission in different business processes are different, the scheme can pertinently configure related strategies in the transmission process for the data of different businesses, and the performance of the data transmission is pertinently improved, so that the different requirements on the data transmission in different businesses are met, and the effect of the data transmission is further improved.
For example, in order to realize the collaborative operation between multiple devices, so that the multiple devices provide services for users like the same device, the problems of unstable data transmission caused by data transmission between the devices, data loss in the data transmission process, transmission delay in the data transmission process and the like need to be solved, and the problems in the data transmission process which need to be solved seriously when different services are executed are different, for example, in the service a, the data transmission is required to be complete and correct, but the time of the data transmission is not strictly required, at this time, the reliability of the data transmission can be improved in a targeted manner, so that the execution effect of the service a of the device is improved. Different data transmission methods can be used for different service scenes, so that user experience is optimized to the greatest extent when the cached data needs to be transmitted between devices.
Fig. 4 shows a flowchart of a data transmission method according to an exemplary embodiment of the present application. The data transmission method may be interactively performed by a data transmission device and a data reception device, and the data transmission device and the data reception device may be terminals, for example, the terminals may be the terminals 100 in the application scenario shown in fig. 1. The data transmission method comprises the following steps:
in step 401, the data transmitting apparatus acquires a data type of the target data.
In the embodiment of the application, when the data transmitting device executes the service, the target data which needs to be transmitted to the data receiving device is generated, and after the target data is generated, the data type of the target data is determined according to the service type of the service to which the target data belongs.
In one possible implementation, when executing a service, the data sending device runs the service through a specified application program, generates corresponding target data through the application program, and obtains a corresponding payload type parameter (i.e., the data type) through an initialized application program interface (Application Programming Interface, API) for data sending, and an incoming service type.
In step 402, the data transmitting apparatus establishes a session connection for transmitting the target data with the data receiving apparatus based on the data type of the target data.
In the embodiment of the application, the data sending device establishes session connection for sending the target data with the data receiving device according to the acquired data type of the target data.
In one possible implementation, the data transmitting device generates a session connection identifier, and establishes a session connection with the data receiving device based on the session connection identifier.
The session connection identifier may include type indication information, where the type indication information may be used to indicate a data type of the target data.
That is, the data transmitting apparatus transmits in the payload type parameter corresponding to the target data through the initialization API, generates a corresponding session connection identifier, which may contain type indication information for indicating the data type of the target data, and establishes a session connection with the data receiving apparatus according to the session connection identifier.
Illustratively, the code content corresponding to the payload type parameter is entered through the initialization API of the data transmitting device,
int initalize(PAYLOAD_TYPEpayloadType);
wherein payoad_type is a PAYLOAD TYPE parameter and payloadType is a PAYLOAD TYPE parameter value.
Illustratively, when the data receiving apparatus establishes a session connection, the session connection with the data transmitting apparatus may be established through an incoming session connection identification, the pseudo code corresponding to the process of establishing the session connection with the data transmitting apparatus through the session connection identification may be,
bool Connect(IntsessionID);
the session id may be a session connection identifier.
In step 403, the data transmitting apparatus determines a target transmission policy based on the data type of the target data.
In the embodiment of the application, the data sending device determines a target transmission policy used when transmitting the target data according to the acquired data type of the target data.
The data type may be determined based on a service type of a service to which the target data belongs. The target transmission policy may include related information for controlling a transmission process of the target data.
In one possible implementation, the data transmission device includes an API for transmitting the target data, a transmission buffer area for temporarily storing the target data, and a transmission component for processing the target data and transmitting the processed data.
The sending buffer area corresponding to the target data and the corresponding session connection identifier can be obtained by calling an API for sending the target data. The pseudo code corresponding to the API for transmitting the target data may be,
int send(char*buffer,int bufferLen,sessionID);
The session id may be a return value of int initize (payoad_type payloadType), that is, a session connection identifier.
In one possible implementation, when the target data is in the sending buffer area, according to the data type of the target data indicated by the acquired session connection identifier, a transmission policy corresponding to the data type is selected from the congestion controller as the target transmission policy.
The congestion controller comprises at least one pre-stored transmission strategy, so that when the data sending equipment needs to transmit target data, the transmission strategy matched with the data type of the target data is selected as the target transmission strategy.
For example, the data transmission method may predefine enumerated values of five data types for the user service party to select a transmission policy therefrom. The code defined by the data type may be as follows:
Enum{PAYLOAD_MESSAGE,
PAYLOAD_FILE,
PAYLOAD_AUDIO_STREAM,
PAYLOAD_VIDEOSTREAM_ONLY,
PAYLOAD_VIDEOSTREAM_WITHCONTROL}PAYLOAD_TYPE;
wherein, payload_MESSAGE is a MESSAGE transmission data type, payload_FILE is a FILE transmission data type, payload_Audio_stream is an AUDIO transmission data type, payload_video stream_only is a unidirectional video transmission data type, payload_video stream_WITHCONTROL is a reverse control video transmission data type.
Wherein, the congestion controller can contain transmission strategies corresponding to the data types respectively.
For example, the target transmission policy corresponding to the message transmission data type may be a message transmission policy, the target transmission policy corresponding to the file transmission data type may be a file transmission policy, the target transmission policy corresponding to the audio transmission data type may be an audio transmission policy, the target transmission policy corresponding to the unidirectional video transmission data type may be a unidirectional video transmission policy, and the target transmission policy corresponding to the reverse control video transmission data type may be a reverse control video transmission policy.
In one possible implementation, the target transmission policy includes at least one of the following information: the method comprises the steps of sending buffer size, receiving buffer size, data packet format, packetization strategy, reliability requirement parameter, packet loss processing strategy of a sending end and packet loss processing strategy of a receiving end.
The packet loss processing strategy comprises at least one of the following strategies: whether packet retransmission is enabled, whether packet forward error correction coding is enabled, and whether packet dropping is allowed.
That is, the transmission buffer size included in the target transmission policy may be used to control the amount of buffered data from the sender side; the size of the receive buffer included in the target transmission policy may be used to control the amount of data received buffered from the receiver side.
In step 404, the data transmitting apparatus transmits the target data to the data receiving apparatus based on the target transmission policy.
In the embodiment of the application, the data sending device processes the target data based on the related information contained in the determined target transmission policy and sends the processed target data to the data receiving device.
In one possible implementation manner, the target transmission policy includes one or more information of a sending buffer size, a receiving buffer size, a data packet format, a packetizing policy, a reliability requirement parameter, a packet loss processing policy of the sending end, and a packet loss processing policy of the receiving end, where in a case where the information included in the target transmission policy is different, steps of processing the target data according to the target transmission policy and transmitting the target data to the data receiving device are different.
1) In the case where the packet format and packetization policy are included in the target transmission policy.
Acquiring the packetization size included in the packetization strategy in the target transmission strategy; splitting target data according to the sub-package size to obtain the body of each data package; generating packet heads of all the data packets according to the data packet format in the target transmission strategy; combining the packet heads of all the data packets with the packet bodies of all the data packets to generate all the data packets; and sending each data packet to the data receiving equipment.
The packetizing size may be a data length corresponding to each packet body when performing packetizing processing on the target data.
In one possible implementation manner, the packet header corresponding to each data packet includes basic information and custom information, the basic information included in the packet header is information defined in each transmission policy, and the custom information is data packet information custom configured in the target transmission policy.
For example, the basic information of the packet header may include a packet sequence number of the data packet, and the custom information of the packet header may include information about whether the data packet includes a key frame, or may include information that the data packet belongs to a P frame or an I frame according to a streaming media protocol.
2) And under the condition that the target transmission strategy comprises a packet loss processing strategy of the sending end.
And under the condition that the packet loss processing strategy of the transmitting end comprises a strategy for enabling forward error correction coding of the data packet, forward error correction coding is carried out on the target data, and the target data after forward error correction coding is transmitted to the data receiving equipment based on the target transmission strategy. And under the condition that the packet loss processing strategy of the transmitting end comprises a strategy of not enabling the forward error correction coding of the data packet, skipping the step of the forward error correction coding, and transmitting target data to the data receiving equipment based on the target transmission strategy.
That is, whether to forward error correction encode the target data may be determined according to a policy of whether to enable the forward error correction encoding of the data packet included in the target transmission policy.
In one possible implementation, the data packets support reliable transmission and direct discard according to traffic requirements.
For example, key frames of a video stream are packets that support reliable transmission, and non-key frames of a video stream are packets that are discarded directly.
By way of example, fig. 5 is a flow chart of processing and transmitting target data according to the present application. As shown in fig. 5, when target data waiting for transmission is transferred into a transmission buffer area, a corresponding target transmission policy may be selected from among transmission policies based on a data type corresponding to the target data, and a data amount supporting data buffered in the transmission buffer area may be determined according to a buffer area size included in the target transmission policy, where the data in the transmission buffer area may be data waiting for data processing and transmission. According to the target transmission strategy, determining whether the target transmission strategy contains forward error correction coding configuration (S51), and when the target transmission strategy contains configuration information for indicating that forward error correction coding is needed for target data, performing forward error correction coding on the received target data, calculating coding data generated by the target data after forward error correction coding according to an algorithm of the forward error correction coding (S52), and when the target transmission strategy contains configuration information for indicating that forward error correction coding is not needed for the target data, directly performing packetization processing or performing packetization processing on the target data after forward error correction coding generated by forward error correction coding on the target data (S53), wherein the target transmission strategy comprises defined packetization size, and dividing the target data or the coded target data into packet bodies of data packets according to the packetization size. And then generating packet heads corresponding to the packet bodies according to the data packet formats included in the target transmission strategy (S54), combining the packet heads with the packet bodies of the corresponding data packets to generate data packets obtained by splicing the packet heads with the packet bodies (S55), adding the spliced data packets into a transmission queue, and sequentially transmitting the data packets to the data receiving equipment according to the queuing sequence (S56).
In one possible implementation, the target transmission policy is one of a message transmission policy, a file transmission policy, an audio transmission policy, a unidirectional video transmission policy, and a reverse control video transmission policy.
The message transmission strategy is used for controlling the message transmission process of the control channel; the file transmission strategy is used for controlling the transmission process of the offline file; the audio transmission strategy is used for controlling the transmission process of the real-time audio stream data; the unidirectional video transmission strategy is used for controlling the transmission process of video stream data; the inverse control video transmission strategy is used for controlling the transmission process of video stream data and control information based on video stream data feedback.
For example, according to the enumerated values of the five predefined data types, corresponding transmission strategies are configured, and each transmission strategy may include the following contents:
1) If the target transmission policy is determined to be the message transmission policy, the data type of the target data corresponding to the message transmission policy may be a control message, and since the bandwidth of the control message is relatively small, the average bandwidth may be 10kb/s, and when transmitting the data, the requirement of relatively high instantaneity and certain reliability needs to be met, so that the configured target transmission policy for transmitting the target data of the type may be configured with a relatively small sending buffer area and a receiving buffer area, and forward error correction coding needs to be configured to be started. The configuration code of the message transmission policy may be as follows:
Wherein "message_structure" is used to indicate a Message transmission policy, "update" is used to indicate that the data packet is configured with a reliability parameter, "SendBufferSize" is used to indicate that the size of a transmission buffer area for transmitting the data packet is 16KB, "RecvBufferSize" is used to indicate that the size of a reception buffer area for receiving the data packet is 16KB, "FEC" is used to indicate a configuration for starting forward error correction coding when the data packet is transmitted, "update" is used to indicate that the data packet is not retransmitted, "packetFormat": "." packet format for defining data packets ".
For example, in the process of projecting a game screen onto a data receiving device for display and transmitting game control data through a data transmitting device, the control data needs to be transmitted, and the control data is transmitted according to a determined message transmission policy.
2) If the target transmission policy is determined to be the file transmission policy, the data type of the target data corresponding to the file transmission policy may be the file data, and since the bandwidth required in the process of performing offline file transmission is relatively large, and the requirement on the completion time of the whole file transmission is relatively high, that is, the file transmission needs to be complete and fast, and the stability in the transmission process is not required, that is, the time-lapse during the transmission process is not required, so that the configured target transmission policy for transmitting the target data of the type may be configured with a relatively large sending buffer area and receiving buffer area, and the forward error correction coding needs to be configured to be closed. The configuration code of the file transfer policy may be as follows:
The file_structy is used for indicating a File transmission policy, "SendBufferSize" 32MB "and" RecvBufferSize "32MB" respectively indicate that the size of a sending buffer area for sending the data packet and the size of a receiving buffer area for receiving the data packet are both 32MB, "FEC" is used for indicating that the configuration management forward error correction coding, "Retry" is used for indicating that data retransmission is required if data loss occurs in transmission.
3) If the target transmission strategy is determined to be the audio transmission strategy, the data type of the target data corresponding to the audio transmission strategy can be real-time audio data, and the bandwidth required in the process of transmitting the real-time audio data is relatively small, generally about 10kbps, and the real-time requirement on the audio data transmission is relatively high, meanwhile, the transmission process is required to be relatively stable, and under the condition that the network is unstable, the smoothness of the audio transmission can be realized by discarding part of the data packets, and because more CPU (central processing unit) is required to occupy for performing the forward error correction coding, the configured target transmission strategy for transmitting the type of target data can be configured with a smaller sending buffer area and a receiving buffer area, and the forward error correction coding is required to be configured to be closed. The configuration code of the audio transmission policy may be as follows:
For example, in the process of conducting a voice conversation, real-time audio data needs to be transmitted, and in order to meet the smoothness of the conversation process, the audio data is transmitted according to an audio transmission strategy.
4) If the target transmission strategy is determined to be the unidirectional video transmission strategy, the data type of the target data corresponding to the unidirectional video transmission strategy can be video stream data, the bandwidth requirement is higher in the process of video stream data transmission, the real-time requirement on video stream data transmission is general, but the transmission process is required to be stable, and the forward error correction coding is required to be configured to be closed because the bandwidth is larger, so that the configured target transmission strategy for transmitting the target data of the type can be configured to be larger in sending buffer area and receiving buffer area, and the forward error correction coding is required to be configured to be closed. The configuration code of the unidirectional video transmission policy may be as follows:
for example, the unidirectional video transmission strategy can be applied to the process of data transmission in business scenes including live broadcast and video on demand.
5) If the target transmission strategy is determined to be the reverse control video transmission strategy, the data type of the target data corresponding to the reverse control video transmission strategy can be control information data, and the service scene belongs to the control information data transmission while receiving the real-time video stream. The bandwidth requirement and the real-time requirement are high in the process of carrying out control information data transmission, and the transmission process is also required to be stable, but partial discarding of the data frames can be carried out. The configured target transmission policy for transmitting this type of target data may configure a larger transmit buffer area as well as a receive buffer area, requiring configuration to shut down the forward error correction coding. The configuration code of the unidirectional video transmission policy may be as follows:
The method comprises the steps that a data receiving device or a data sending device detects that a data packet temporarily stored in a sending buffer area or a receiving buffer area reaches an execution threshold value, and the data sending device discards the data packet to ensure the real-time performance of target data transmission.
For example, the reverse control video transmission policy may be applied to a process that the data transmitting device transmits control information to the receiving end while the data receiving device receives real-time video stream data. The reverse control video transmission strategy can be applied to remote desktop application based on screen throwing, and the situation that video streams of desktops are transmitted to a receiving end and control input information of the receiving end to graphics is transmitted back to a transmitting end is eliminated.
In step 405, the data receiving apparatus receives the target data packet sent by the data sending apparatus.
In the embodiment of the application, the data receiving device may receive, from the network, each data packet sent by the data sending device, and the target data packet may be any one of the respective data packets sent by the data sending device.
In one possible implementation, the data packets are acquired sequentially in the order in which they are transmitted by the data transmitting device to the data receiving device.
In step 406, the data receiving device determines a target transmission policy according to the data type of the target data to which the target data packet belongs.
In the embodiment of the present application, before determining the target transmission policy according to the data type of the target data to which the target data packet belongs, the data receiving device may acquire the data type of the target data based on the session connection for receiving the target data packet.
For example, when the data receiving device receives the target data packet, the session connection identifier of the session connection for receiving the target data packet is obtained, and then the data type of the target data is obtained based on the type indication information in the session connection identifier.
When the data transmitting device and the data receiving device establish session connection, the data receiving device can acquire a session connection identifier transmitted by the data transmitting device, establish session connection according to the session connection identifier, and subsequently determine a data type corresponding to target data to which the target data packet belongs according to the session connection identifier when the target data packet is received through the session connection, and then determine a target transmission policy based on the data type.
In one possible implementation manner, when the data sending device and the data receiving device establish session connection, the data receiving device obtains a data type of target data from the received session connection identifier, determines a target transmission policy according to the obtained data type, and then establishes a corresponding relationship between the target transmission policy and the session connection identifier, so that after receiving the target data packet, the subsequent data receiving device directly queries the established corresponding relationship through the session connection identifier of the session connection for receiving the target data packet, and obtains the target transmission policy corresponding to the session connection identifier.
That is, when receiving the target data packet, the data receiving device can directly query the corresponding relation between the session connection identifier established after the session connection is established and the target transmission policy through the session connection identifier of the session connection, and the data type is not required to be acquired through the session connection identifier after the target data packet is received, and then the target transmission policy is determined according to the data type, so that the step of determining the target transmission policy after the target data packet is received is simpler and more convenient, and the smoothness of the transmission of the target data packet is improved.
Wherein the target transmission policy includes at least one of the following information: the method comprises the steps of sending buffer size, receiving buffer size, data packet format, packetization strategy, reliability requirement parameter, packet loss processing strategy of a sending end and packet loss processing strategy of a receiving end.
The packet loss processing strategy comprises at least one of the following strategies: whether packet retransmission is enabled, whether packet forward error correction coding is enabled, and whether packet dropping is allowed.
Step 407, performing parsing processing on the target data packet based on the target transmission policy.
In the embodiment of the application, the data receiving device may perform parsing processing on each received target data packet according to the determined target transmission policy.
In one possible implementation manner, the target transmission policy includes one or more information of a sending buffer size, a receiving buffer size, a data packet format, a packetizing policy, a reliability requirement parameter, a packet loss processing policy of the sending end, and a packet loss processing policy of the receiving end, where in a case that the information included in the target transmission policy is different, the parsing step and the subsequent step of the target data according to the target transmission policy are different.
1) In case the packet format is included in the target transmission policy.
The data receiving device may analyze the target data packet according to the data packet format in the target transmission policy.
2) And in the case that the target transmission policy includes a packet loss processing policy of the receiving end.
If the packet sequence number of the target data packet is discontinuous with the packet sequence number of the last received data packet belonging to the target data, the target data packet is processed based on the packet loss processing strategy of the receiving end.
That is, the packet sequence number of the target data packet is discontinuous with the packet sequence number of the last received data packet belonging to the target data, which can indicate that the data transmission is lost in the data packet transmission process of the target data, and in this case, the target data packet can be processed according to the packet loss processing policy in the target transmission policy, so as to reduce the influence of the data transmission loss on the belonging service.
Under the condition that the packet loss processing strategy of the receiving end comprises the enabling of data packet retransmission, a retransmission notification is sent to the data sending equipment based on the packet loss sequence number; the packet loss sequence number is the other sequence number between the packet sequence number of the target data packet and the packet sequence number of the last received data packet belonging to the target data.
And under the condition that the packet loss processing strategy of the receiving end comprises enabling forward error correction coding, performing forward error correction decoding on the target data packet.
And under the condition that the packet loss processing strategy of the receiving end comprises the allowable drop data packet, if the target data packet belongs to the allowable drop data packet, the target data packet is dropped.
Fig. 6 is a flowchart illustrating a process for receiving a target packet according to an embodiment of the present application. As shown in fig. 6, the data receiving apparatus may receive a data packet of a maximum transmission unit from the network (S61), determine a data type of target data to which the target data packet belongs according to the session connection identifier when the data receiving apparatus receives the target data packet according to the session connection identifier received at the time of session connection establishment, and determine a target transmission policy corresponding to the target data according to the data type (S62). According to the packet format of the data packet included in the target transmission policy, the received target data packet is parsed to obtain the packet body data corresponding to the target data packet (S63), whether the packet sequence number in the packet header of the received data packet is continuous with the packet sequence number in the packet header of the last acquired data packet is judged (S64), if the packet sequence numbers corresponding to adjacent data packets are not continuous, it can be determined that there is a packet loss condition, so that the data packet needs to be processed according to the packet loss processing policy included in the target transmission policy (S65), the packet loss processing policy can include three conditions, in one case, if the data packet is configured in the target transmission policy to be discarded, the data packet is directly discarded, in one case, if the forward error correction coding is configured in the target transmission policy, the target data packet can be decoded based on the forward error correction coding, and thus the data packet is attempted to be restored according to the data packet adjacent to the data packet before and after the lost data packet, and in the other case, if the retransmission configuration is included in the target transmission policy, the data transmission policy can be notified to retransmit the lost data packet. After the data packet processing is completed or when the packet numbers of the adjacent data packets are continuous, the packet body of the data packet is temporarily stored in a receiving buffer area (S66), and the size of the receiving buffer area can be configured according to the target transmission policy. The business side is informed to acquire the target data temporarily stored in the receiving buffer area through the callback receiving API (S67).
Fig. 7 is a block diagram illustrating a data transmission process according to an embodiment of the present application. As shown in fig. 7, a transmission application interface 71, a transmission buffer area 72, a transmission component 73, a forward error correction encoder 74, a congestion controller 75, and a sender packet loss recorder 76 may be included in the data transmission apparatus. The data receiving apparatus may include therein a receiving application interface 79, a receiving buffer area 78, a receiving component 77, a forward error correction decoder 710, and a receiving packet loss recorder 711. The data transmitting equipment and the data receiving equipment are connected through a user data packet protocol transmission channel. The congestion controller includes various transmission policies therein. Wherein the dashed arrow corresponds to control information of the reception status returned by the data reception device. The target data is sent to the sending buffer area 72 through the sending application interface 71 for temporary storage, and meanwhile, the congestion controller 75 can select and confirm the target transmission strategy, then the target data is processed according to the target transmission strategy through the sending component 73, if the forward error correction coding is required to be started according to the target transmission strategy, the target data is encoded through the forward error correction encoder 74 and then is subjected to other processing in the sending component 73, based on a user data packet protocol transmission channel, each data packet is sent to the data receiving device through the sending component 73, the data receiving device analyzes the data packet through the receiving component 77, and if the forward error correction coding is required to be started according to the target transmission strategy, the target data is decoded through the forward error correction decoder 710. The processed data is temporarily stored in the receiving buffer area 78, and the receiving application interface 79 notifies the corresponding client of the service side of receiving the target data.
In summary, in the embodiment of the present application, when data transmission between devices is required in a process of performing a certain service, the data sending side may determine, based on the data type of the target data to be transmitted in the service, a target transmission policy of the target data, so as to implement corresponding control over the congestion situation in the process of transmitting the target data according to the target transmission policy, thereby completing transmission of the target data of the service. Because the requirements on data transmission in different business processes are different, the scheme can pertinently configure related strategies in the transmission process for the data of different businesses, and the performance of the data transmission is pertinently improved, so that the different requirements on the data transmission in different businesses are met, and the effect of the data transmission is further improved.
Fig. 8 is a block diagram illustrating a data transmission apparatus according to an exemplary embodiment of the present application. The data transmission device is used in data transmission equipment, and comprises:
a type acquisition module 810, configured to acquire a data type of the target data; the data type is determined based on the service type of the service to which the target data belongs;
A policy determining module 820, configured to determine a target transmission policy based on a data type of the target data; the target transmission strategy comprises related information for controlling the transmission process of the target data;
and a data sending module 830, configured to send the target data to a data receiving device based on the target transmission policy.
In one possible implementation, the target transmission policy includes at least one of the following information:
the method comprises the steps of sending buffer size, receiving buffer size, data packet format, subpackaging strategy, reliability requirement parameters, packet loss processing strategy of a sending end and packet loss processing strategy of a receiving end;
wherein, the packet loss processing strategy comprises at least one of the following strategies:
whether packet retransmission is enabled, whether packet forward error correction coding is enabled, and whether packet dropping is allowed.
In a possible implementation manner, in a case that the target transmission policy includes the packet format and the packetization policy, the data sending module 830 includes:
a size obtaining sub-module, configured to obtain a packetization size included in the packetization policy in the target transmission policy;
The packet body acquisition submodule is used for splitting the target data according to the sub-package size to obtain the packet bodies of all the data packets;
a packet header generation sub-module, configured to generate a packet header of each data packet according to the data packet format in the target transmission policy;
the data packet generation sub-module is used for combining the packet heads of the data packets with the packet bodies of the data packets to generate the data packets;
and the data packet sending sub-module is used for sending each data packet to the data receiving equipment.
In a possible implementation manner, in a case that the target transmission policy includes a packet loss processing policy of the transmitting end, the data transmitting module 830 includes:
a first sending sub-module, configured to perform forward error correction coding on the target data when a packet loss processing policy of the sending end includes a policy that enables forward error correction coding of a data packet, and send the forward error correction coded target data to the data receiving device based on the target transmission policy;
and the second sending sub-module is used for skipping the step of forward error correction coding and sending the target data to the data receiving equipment based on the target transmission strategy under the condition that the packet loss processing strategy of the sending end comprises a strategy for not enabling the forward error correction coding of the data packet.
In one possible implementation, the apparatus further includes:
and the session establishment module is used for establishing session connection for sending the target data with the data receiving equipment based on the data type of the target data before sending the target data to the data receiving equipment based on the target transmission strategy.
In one possible implementation, the session establishment module includes:
the identifier generation sub-module is used for generating a session connection identifier, wherein the session connection identifier comprises type indication information; the type indication information is used for indicating the data type of the target data;
and the session establishment sub-module is used for establishing the session connection with the data receiving equipment based on the session connection identifier.
In one possible implementation, the target transmission policy is one of a message transmission policy, a file transmission policy, an audio transmission policy, a unidirectional video transmission policy, and a reverse control video transmission policy;
the message transmission strategy is used for controlling the message transmission process of the control channel; the file transmission strategy is used for controlling the transmission process of the offline file; the audio transmission strategy is used for controlling the transmission process of real-time audio stream data; the unidirectional video transmission strategy is used for controlling the transmission process of video stream data; the reverse control video transmission strategy is used for controlling the transmission process of video stream data and control information based on the video stream data feedback.
In summary, in the embodiment of the present application, when data transmission between devices is required in a process of performing a certain service, the data sending side may determine, based on the data type of the target data to be transmitted in the service, a target transmission policy of the target data, so as to implement corresponding control over the congestion situation in the process of transmitting the target data according to the target transmission policy, thereby completing transmission of the target data of the service. Because the requirements on data transmission in different business processes are different, the scheme can pertinently configure related strategies in the transmission process for the data of different businesses, and the performance of the data transmission is pertinently improved, so that the different requirements on the data transmission in different businesses are met, and the effect of the data transmission is further improved.
Fig. 9 is a block diagram illustrating a data transmission apparatus according to an exemplary embodiment of the present application. The data transmission device is used in data receiving equipment, and comprises:
a packet receiving module 910, configured to receive a target data packet sent by a data sending device;
a policy obtaining module 920, configured to determine a target transmission policy according to a data type of the target data to which the target data packet belongs; the target transmission strategy comprises related information for controlling the transmission process of the target data;
And a packet parsing module 930, configured to parse the target data packet based on the target transmission policy.
In one possible implementation, the target transmission policy includes at least one of the following information:
the method comprises the steps of sending buffer size, receiving buffer size, data packet format, subpackaging strategy, reliability requirement parameters, packet loss processing strategy of a sending end and packet loss processing strategy of a receiving end;
wherein, the packet loss processing strategy comprises at least one of the following strategies:
whether packet retransmission is enabled, whether packet forward error correction coding is enabled, and whether packet dropping is allowed.
In one possible implementation manner, in a case that the target transmission policy includes the data packet format, the packet parsing module 930 includes:
and the packet processing sub-module is used for analyzing and processing the target data packet according to the data packet format in the target transmission strategy.
In a possible implementation manner, in a case that the target transmission policy includes a packet loss processing policy of the receiving end, the apparatus further includes:
and the packet processing module is used for processing the target data packet based on the packet loss processing strategy of the receiving end if the packet sequence number of the target data packet is discontinuous with the packet sequence number of the last received data packet belonging to the target data.
In one possible implementation, the packet processing module includes:
a retransmission sub-module, configured to send a retransmission notification to the data sending device based on a packet loss sequence number when the packet loss processing policy of the receiving end includes enabling packet retransmission; the packet loss sequence number is the other sequence number between the packet sequence number of the target data packet and the packet sequence number of the last received data packet belonging to the target data;
the decoding sub-module is used for carrying out forward error correction decoding on the target data packet under the condition that the packet loss processing strategy of the receiving end contains forward error correction coding;
and the discarding sub-module is used for discarding the target data packet if the target data packet belongs to the data packet which is allowed to be discarded under the condition that the packet discarding processing strategy of the receiving end comprises the data packet which is allowed to be discarded.
In one possible implementation, the apparatus further includes:
and the type acquisition module is used for acquiring the data type of the target data based on session connection for receiving the target data packet before determining the target transmission strategy according to the data type of the target data to which the target data packet belongs.
In one possible implementation manner, the type obtaining module includes:
the identifier acquisition sub-module is used for acquiring the session connection identifier of the session connection;
and the type acquisition sub-module is used for acquiring the data type of the target data based on the type indication information in the session connection identifier.
In summary, in the embodiment of the present application, when data transmission between devices is required in a process of performing a certain service, the data sending side may determine, based on the data type of the target data to be transmitted in the service, a target transmission policy of the target data, so as to implement corresponding control over the congestion situation in the process of transmitting the target data according to the target transmission policy, thereby completing transmission of the target data of the service. Because the requirements on data transmission in different business processes are different, the scheme can pertinently configure related strategies in the transmission process for the data of different businesses, and the performance of the data transmission is pertinently improved, so that the different requirements on the data transmission in different businesses are met, and the effect of the data transmission is further improved.
Fig. 10 is a block diagram illustrating a structure of a terminal according to an exemplary embodiment of the present application. The terminal may be an electronic device in which an application program is installed and run, such as a smart phone, a tablet computer, an electronic book, a portable personal computer, etc. A terminal in the present application may include one or more of the following: a processor 1010, a memory 1020, and a screen 1030.
Processor 1010 may include one or more processing cores. The processor 1010 connects various parts within the overall terminal using various interfaces and lines, performs various functions of the terminal and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1020, and invoking data stored in the memory 1020. Alternatively, the processor 1010 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 1010 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is responsible for rendering and drawing of the content required to be displayed by the screen 1030; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 1010 and may be implemented solely by a single communication chip.
The Memory 1020 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (ROM). Optionally, the memory 1020 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). Memory 1020 may be used to store instructions, programs, code, sets of codes, or instruction sets. The memory 1020 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, which may be an Android (Android) system (including a system developed based on an Android system), an IOS system developed by apple corporation (including a system developed based on an IOS system depth), or other systems, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like. The storage data area may also store data created by the terminal in use (such as phonebook, audio-video data, chat-record data), etc.
The screen 1030 may be a capacitive touch display screen for receiving touch operations by a user on or near any suitable object, such as a finger, stylus, or the like, and displaying a user interface for each application. The touch display screen is typically provided at the front panel of the terminal. The touch display screen may be designed as a full screen, a curved screen, or a contoured screen. The touch display screen can also be designed to be a combination of a full screen and a curved screen, and a combination of a special-shaped screen and a curved screen, which is not limited in the embodiment of the application.
In addition, those skilled in the art will appreciate that the configuration of the terminal illustrated in the above-described figures does not constitute a limitation of the terminal, and the terminal may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the terminal further includes components such as a radio frequency circuit, a shooting component, a sensor, an audio circuit, a wireless fidelity (Wireless Fidelity, wiFi) component, a power supply, a bluetooth component, and the like, which are not described herein.
Embodiments of the present application also provide a computer readable storage medium having stored therein at least one computer instruction that is loaded and executed by a processor to implement the data transmission method described in the above embodiments.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the terminal performs the data transmission method provided in various alternative implementations of the above aspect.
Those skilled in the art will appreciate that in one or more of the examples described above, the functions described in the embodiments of the present application may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, these functions may be stored on or transmitted over as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The foregoing description of the preferred embodiments is merely exemplary in nature and is in no way intended to limit the invention, since it is intended that all modifications, equivalents, improvements, etc. that fall within the spirit and scope of the invention.

Claims (17)

1. A data transmission method, wherein the method is performed by a transmitting end, the method comprising:
acquiring the data type of target data; the data type is determined based on the service type of the service to which the target data belongs;
Determining a target transmission strategy based on the data type of the target data; the target transmission strategy comprises relevant information for controlling congestion conditions in the transmission process of the target data;
transmitting the target data to a receiving end based on the target transmission strategy;
the target transmission strategy is one of a message transmission strategy, a file transmission strategy, an audio transmission strategy, a unidirectional video transmission strategy and a reverse control video transmission strategy;
the message transmission strategy is used for controlling the message transmission process of the control channel; the message transmission policy includes: enabling a reliability requirement parameter, a first size of a transmit buffer region and a first size of a receive buffer region, enabling forward error correction coding, and disabling packet retransmission;
the file transmission strategy is used for controlling the transmission process of the offline file; the file transfer policy includes: enabling a reliability requirement parameter, a transmission buffer region of a second size and a reception buffer region of a second size, disabling forward error correction coding, and enabling packet retransmission;
the audio transmission strategy is used for controlling the transmission process of real-time audio stream data; the audio transmission strategy comprises the following steps: disabling the reliability requirement parameter, the third size of the transmit buffer region and the third size of the receive buffer region, disabling the forward error correction coding, disabling the retransmission of the data packet, and allowing the discarding of the data packet;
The unidirectional video transmission strategy is used for controlling the transmission process of video stream data; the unidirectional video transmission strategy comprises the following steps: disabling the reliability requirement parameter, the fourth size of the transmit buffer region and the fourth size of the receive buffer region, disabling the forward error correction coding, and disabling the retransmission of the data packet;
the reverse control video transmission strategy is used for controlling the transmission process of video stream data and control information fed back based on the video stream data; the reverse control video transmission strategy comprises the following steps: the method comprises the steps that a reliability requirement parameter is not started, a transmission buffer area with a fifth size and a receiving buffer area with a fifth size are not started, forward error correction coding is not started, and when a data packet temporarily stored in the transmission buffer area or the receiving buffer area reaches an execution threshold value, the transmitting end discards the data packet;
wherein the first size is 16KB, the second size is 32MB, the third size is 1MB, the fourth size is 5MB, and the fifth size is 5MB.
2. The method of claim 1, wherein the target transmission policy comprises at least one of the following information:
the method comprises the steps of sending buffer size, receiving buffer size, data packet format, subpackaging strategy, reliability requirement parameters, packet loss processing strategy of a sending end and packet loss processing strategy of a receiving end;
Wherein, the packet loss processing strategy comprises at least one of the following strategies:
whether packet retransmission is enabled, whether packet forward error correction coding is enabled, and whether packet dropping is allowed.
3. The method of claim 2, wherein, in the case where the packet format and the packetization policy are included in the target transmission policy,
the sending the target data to the receiving end based on the target transmission policy includes:
acquiring a packetization size included in the packetization strategy in the target transmission strategy;
splitting the target data according to the sub-package size to obtain the body of each data package;
generating a packet header of each data packet according to the data packet format in the target transmission strategy;
combining the packet heads of the data packets with the packet bodies of the data packets to generate the data packets;
and sending each data packet to the receiving end.
4. The method of claim 2, wherein, in the case that the target transmission policy includes a packet loss processing policy of the sender,
the sending the target data to the receiving end based on the target transmission policy includes:
Under the condition that the packet loss processing strategy of the transmitting end comprises a strategy for enabling forward error correction coding of a data packet, forward error correction coding is carried out on the target data, and the target data after forward error correction coding is transmitted to the receiving end based on the target transmission strategy;
and under the condition that the packet loss processing strategy of the transmitting end comprises a strategy of not enabling the forward error correction coding of the data packet, skipping the step of the forward error correction coding, and transmitting the target data to the receiving end based on the target transmission strategy.
5. The method of claim 1, wherein before the sending the target data to the receiving end based on the target transmission policy, further comprises:
and establishing session connection for transmitting the target data with the receiving end based on the data type of the target data.
6. The method according to claim 5, wherein the establishing a session connection with the receiving end for transmitting the target data based on the data type of the target data includes:
generating a session connection identifier, wherein the session connection identifier comprises type indication information; the type indication information is used for indicating the data type of the target data;
And establishing the session connection with the receiving end based on the session connection identifier.
7. A data transmission method, the method being performed by a receiving end, the method comprising:
receiving a target data packet sent by a sending end;
acquiring a target transmission strategy; the target transmission strategy is determined based on the data type of target data to which the target data packet belongs; the target transmission strategy comprises relevant information for controlling congestion conditions in the transmission process of the target data;
analyzing the target data packet based on the target transmission strategy;
the target transmission strategy is one of a message transmission strategy, a file transmission strategy, an audio transmission strategy, a unidirectional video transmission strategy and a reverse control video transmission strategy;
the message transmission strategy is used for controlling the message transmission process of the control channel; the message transmission policy includes: enabling a reliability requirement parameter, a first size of a transmit buffer region and a first size of a receive buffer region, enabling forward error correction coding, and disabling packet retransmission;
the file transmission strategy is used for controlling the transmission process of the offline file; the file transfer policy includes: enabling a reliability requirement parameter, a transmission buffer region of a second size and a reception buffer region of a second size, disabling forward error correction coding, and enabling packet retransmission;
The audio transmission strategy is used for controlling the transmission process of real-time audio stream data; the audio transmission strategy comprises the following steps: disabling the reliability requirement parameter, the third size of the transmit buffer region and the third size of the receive buffer region, disabling the forward error correction coding, disabling the retransmission of the data packet, and allowing the discarding of the data packet;
the unidirectional video transmission strategy is used for controlling the transmission process of video stream data; the unidirectional video transmission strategy comprises the following steps: disabling the reliability requirement parameter, the fourth size of the transmit buffer region and the fourth size of the receive buffer region, disabling the forward error correction coding, and disabling the retransmission of the data packet;
the reverse control video transmission strategy is used for controlling the transmission process of video stream data and control information fed back based on the video stream data; the reverse control video transmission strategy comprises the following steps: the method comprises the steps that a reliability requirement parameter is not started, a transmission buffer area with a fifth size and a receiving buffer area with a fifth size are not started, forward error correction coding is not started, and when a data packet temporarily stored in the transmission buffer area or the receiving buffer area reaches an execution threshold value, the transmitting end discards the data packet;
Wherein the first size is 16KB, the second size is 32MB, the third size is 1MB, the fourth size is 5MB, and the fifth size is 5MB.
8. The method of claim 7, wherein the target transmission policy comprises at least one of the following information:
the method comprises the steps of sending buffer size, receiving buffer size, data packet format, subpackaging strategy, reliability requirement parameters, packet loss processing strategy of a sending end and packet loss processing strategy of a receiving end;
wherein, the packet loss processing strategy comprises at least one of the following strategies:
whether packet retransmission is enabled, whether packet forward error correction coding is enabled, and whether packet dropping is allowed.
9. The method of claim 8, wherein, in the case where the packet format is included in the target transmission policy,
the analyzing the target data packet based on the target transmission policy includes:
and analyzing the target data packet according to the data packet format in the target transmission strategy.
10. The method according to claim 8, wherein in case the target transmission policy includes a packet loss processing policy of the receiving end, the method further comprises:
And if the packet sequence number of the target data packet is discontinuous with the packet sequence number of the last received data packet belonging to the target data, processing the target data packet based on the packet loss processing strategy of the receiving end.
11. The method according to claim 10, wherein the processing the target data packet based on the packet loss processing policy of the receiving end includes:
transmitting a retransmission notification to the transmitting end based on a packet loss sequence number under the condition that the packet loss processing strategy of the receiving end contains the enabling data packet retransmission; the packet loss sequence number is the other sequence number between the packet sequence number of the target data packet and the packet sequence number of the last received data packet belonging to the target data;
under the condition that the packet loss processing strategy of the receiving end comprises enabling forward error correction coding, performing forward error correction decoding on the target data packet;
and under the condition that the packet loss processing strategy of the receiving end comprises the data packet which is allowed to be discarded, if the target data packet belongs to the data packet which is allowed to be discarded, discarding the target data packet.
12. The method of claim 8, wherein prior to the obtaining the target transmission policy, further comprising:
Acquiring the data type of the target data based on session connection of the target data packet;
the acquiring the target transmission policy includes:
and acquiring the target transmission strategy based on the data type of the target data.
13. The method of claim 12, wherein the obtaining the data type of the target data based on the session connection receiving the target data comprises:
acquiring a session connection identifier of the session connection;
and acquiring the data type of the target data based on the type indication information in the session connection identifier.
14. A data transmission apparatus, wherein the apparatus is used in a transmitting end, the apparatus comprising:
the type acquisition module is used for acquiring the data type of the target data; the data type is determined based on the service type of the service to which the target data belongs;
the strategy determining module is used for determining a target transmission strategy based on the data type of the target data; the target transmission strategy comprises relevant information for controlling congestion conditions in the transmission process of the target data;
the data sending module is used for sending the target data to a receiving end based on the target transmission strategy;
The target transmission strategy is one of a message transmission strategy, a file transmission strategy, an audio transmission strategy, a unidirectional video transmission strategy and a reverse control video transmission strategy;
the message transmission strategy is used for controlling the message transmission process of the control channel; the message transmission policy includes: enabling a reliability requirement parameter, a first size of a transmit buffer region and a first size of a receive buffer region, enabling forward error correction coding, and disabling packet retransmission;
the file transmission strategy is used for controlling the transmission process of the offline file; the file transfer policy includes: enabling a reliability requirement parameter, a transmission buffer region of a second size and a reception buffer region of a second size, disabling forward error correction coding, and enabling packet retransmission;
the audio transmission strategy is used for controlling the transmission process of real-time audio stream data; the audio transmission strategy comprises the following steps: disabling the reliability requirement parameter, the third size of the transmit buffer region and the third size of the receive buffer region, disabling the forward error correction coding, disabling the retransmission of the data packet, and allowing the discarding of the data packet;
the unidirectional video transmission strategy is used for controlling the transmission process of video stream data; the unidirectional video transmission strategy comprises the following steps: disabling the reliability requirement parameter, the fourth size of the transmit buffer region and the fourth size of the receive buffer region, disabling the forward error correction coding, and disabling the retransmission of the data packet;
The reverse control video transmission strategy is used for controlling the transmission process of video stream data and control information fed back based on the video stream data; the reverse control video transmission strategy comprises the following steps: the method comprises the steps that a reliability requirement parameter is not started, a transmission buffer area with a fifth size and a receiving buffer area with a fifth size are not started, forward error correction coding is not started, and when a data packet temporarily stored in the transmission buffer area or the receiving buffer area reaches an execution threshold value, the transmitting end discards the data packet;
wherein the first size is 16KB, the second size is 32MB, the third size is 1MB, the fourth size is 5MB, and the fifth size is 5MB.
15. A data transmission apparatus, wherein the apparatus is used in a receiving end, the apparatus comprising:
the packet receiving module is used for receiving the target data packet sent by the sending end;
the strategy acquisition module is used for acquiring a target transmission strategy; the target transmission strategy is determined based on the data type of target data to which the target data packet belongs; the target transmission strategy comprises relevant information for controlling congestion conditions in the transmission process of the target data;
The packet analysis module is used for analyzing and processing the target data packet based on the target transmission strategy;
the target transmission strategy is one of a message transmission strategy, a file transmission strategy, an audio transmission strategy, a unidirectional video transmission strategy and a reverse control video transmission strategy;
the message transmission strategy is used for controlling the message transmission process of the control channel; the message transmission policy includes: enabling a reliability requirement parameter, a first size of a transmit buffer region and a first size of a receive buffer region, enabling forward error correction coding, and disabling packet retransmission;
the file transmission strategy is used for controlling the transmission process of the offline file; the file transfer policy includes: enabling a reliability requirement parameter, a transmission buffer region of a second size and a reception buffer region of a second size, disabling forward error correction coding, and enabling packet retransmission;
the audio transmission strategy is used for controlling the transmission process of real-time audio stream data; the audio transmission strategy comprises the following steps: disabling the reliability requirement parameter, the third size of the transmit buffer region and the third size of the receive buffer region, disabling the forward error correction coding, disabling the retransmission of the data packet, and allowing the discarding of the data packet;
The unidirectional video transmission strategy is used for controlling the transmission process of video stream data; the unidirectional video transmission strategy comprises the following steps: disabling the reliability requirement parameter, the fourth size of the transmit buffer region and the fourth size of the receive buffer region, disabling the forward error correction coding, and disabling the retransmission of the data packet;
the reverse control video transmission strategy is used for controlling the transmission process of video stream data and control information fed back based on the video stream data; the reverse control video transmission strategy comprises the following steps: the method comprises the steps that a reliability requirement parameter is not started, a transmission buffer area with a fifth size and a receiving buffer area with a fifth size are not started, forward error correction coding is not started, and when a data packet temporarily stored in the transmission buffer area or the receiving buffer area reaches an execution threshold value, the transmitting end discards the data packet;
wherein the first size is 16KB, the second size is 32MB, the third size is 1MB, the fourth size is 5MB, and the fifth size is 5MB.
16. A terminal, the terminal comprising a processor and a memory; the memory has stored therein at least one computer instruction that is loaded and executed by the processor to implement the data transmission method of any of claims 1 to 13.
17. A computer readable storage medium having stored therein at least one computer instruction that is loaded and executed by a processor to implement the data transmission method of any one of claims 1 to 13.
CN202111515688.3A 2021-12-13 2021-12-13 Data transmission method, device, terminal and storage medium Active CN114221909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111515688.3A CN114221909B (en) 2021-12-13 2021-12-13 Data transmission method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111515688.3A CN114221909B (en) 2021-12-13 2021-12-13 Data transmission method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN114221909A CN114221909A (en) 2022-03-22
CN114221909B true CN114221909B (en) 2024-02-02

Family

ID=80701191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111515688.3A Active CN114221909B (en) 2021-12-13 2021-12-13 Data transmission method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN114221909B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314445B (en) * 2022-08-26 2023-12-12 网易(杭州)网络有限公司 Data message transmission method and device, storage medium and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108848532A (en) * 2018-06-06 2018-11-20 Oppo广东移动通信有限公司 A kind of data transfer optimization method, apparatus and computer storage medium
CN109729438A (en) * 2017-10-31 2019-05-07 杭州海康威视数字技术股份有限公司 A kind of method and device for sending video bag, receiving video bag
CN110312147A (en) * 2019-06-12 2019-10-08 高新兴科技集团股份有限公司 Method, system and the storage medium of business data transmission
CN111182257A (en) * 2020-01-14 2020-05-19 中国平安财产保险股份有限公司 Communication group establishing method, communication group establishing device, computer equipment and storage medium
WO2020134559A1 (en) * 2018-12-29 2020-07-02 北京达佳互联信息技术有限公司 Data transmission method and apparatus, terminal device, and storage medium
CN112398855A (en) * 2020-11-16 2021-02-23 Oppo广东移动通信有限公司 Method and device for transferring application contents across devices and electronic device
CN112913199A (en) * 2018-11-15 2021-06-04 深圳市欢太科技有限公司 Data transmission method and related product

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109729438A (en) * 2017-10-31 2019-05-07 杭州海康威视数字技术股份有限公司 A kind of method and device for sending video bag, receiving video bag
CN108848532A (en) * 2018-06-06 2018-11-20 Oppo广东移动通信有限公司 A kind of data transfer optimization method, apparatus and computer storage medium
CN112913199A (en) * 2018-11-15 2021-06-04 深圳市欢太科技有限公司 Data transmission method and related product
WO2020134559A1 (en) * 2018-12-29 2020-07-02 北京达佳互联信息技术有限公司 Data transmission method and apparatus, terminal device, and storage medium
CN110312147A (en) * 2019-06-12 2019-10-08 高新兴科技集团股份有限公司 Method, system and the storage medium of business data transmission
CN111182257A (en) * 2020-01-14 2020-05-19 中国平安财产保险股份有限公司 Communication group establishing method, communication group establishing device, computer equipment and storage medium
CN112398855A (en) * 2020-11-16 2021-02-23 Oppo广东移动通信有限公司 Method and device for transferring application contents across devices and electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
无线传感器网络数据传输可靠性研究综述;朱晓娟;陆阳;邱述威;官骏鸣;;计算机科学(第09期);全文 *

Also Published As

Publication number Publication date
CN114221909A (en) 2022-03-22

Similar Documents

Publication Publication Date Title
US11349900B2 (en) Voice encoding and sending method and apparatus
EP1271830B1 (en) Negotiated dynamic error correction for streamed media
EP2786537B1 (en) Device for obtaining content by choosing the transport protocol according to the available bandwidth
JP3775346B2 (en) Videophone system and terminal device thereof
US20150271233A1 (en) Method and apparatus for dash streaming using http streaming
US20230083441A1 (en) Managing subpacket transmission and reception for advanced interactive services
US20070286121A1 (en) Systems and techniques for selective point-to-multipoint retransmission of multicast frames in a wireless network
US20050123042A1 (en) Moving picture streaming file, method and system for moving picture streaming service of mobile communication terminal
US10367873B2 (en) Method of communicating data packets within data communication systems
US11792130B2 (en) Audio/video communication method, terminal, server, computer device, and storage medium
US10044831B2 (en) Method and apparatus for transmitting messages to a dash client
CN111246284B (en) Video stream playing method, system, terminal and storage medium
MX2015004596A (en) Method and apparatus for media data delivery control.
CN106921843B (en) Data transmission method and device
EP3515083A1 (en) Method and apparatus for performing synchronization operation on contents
CN113766317A (en) Video transmission method, video transmission device, electronic equipment and storage medium
CN103348657A (en) Stream media playing method, device and system
EP3399713B1 (en) Device, system, and method to perform real-time communication
CN114221909B (en) Data transmission method, device, terminal and storage medium
CN107547517B (en) Audio and video program recording method, network equipment and computer device
CN110012363B (en) Video chat system based on SIP protocol
CN114051173B (en) RTP extension header-based video frame reliable transmission method, device and equipment
WO2023217188A1 (en) Livestream data transmission method, apparatus and system, device and medium
EP1802121A2 (en) Information provisioning device and method
CN114710568B (en) Audio and video data communication method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant