WO2020119347A1 - 一种消息传输方法、装置、设备及介质 - Google Patents

一种消息传输方法、装置、设备及介质 Download PDF

Info

Publication number
WO2020119347A1
WO2020119347A1 PCT/CN2019/116527 CN2019116527W WO2020119347A1 WO 2020119347 A1 WO2020119347 A1 WO 2020119347A1 CN 2019116527 W CN2019116527 W CN 2019116527W WO 2020119347 A1 WO2020119347 A1 WO 2020119347A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
sequence number
sent
queue
message
Prior art date
Application number
PCT/CN2019/116527
Other languages
English (en)
French (fr)
Inventor
同鑫
戴博
区润强
朱敏
Original Assignee
广州市百果园信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州市百果园信息技术有限公司 filed Critical 广州市百果园信息技术有限公司
Publication of WO2020119347A1 publication Critical patent/WO2020119347A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Definitions

  • This application relates to the field of Internet technology, such as a message transmission method, device, device, and medium.
  • TCP Transmission Control Protocol
  • Embodiments of the present application provide a message transmission method, device, equipment, and medium to strengthen the message transmission quality of network applications and improve the transmission effect based on User Datagram Protocol (User Datagram Protocol, UDP).
  • User Datagram Protocol User Datagram Protocol
  • an embodiment of the present application provides a message transmission method, including: extracting an instruction message to be sent from a message queue of a network application, wherein the instruction message to be sent is the original message with the highest priority in the message queue Instruction message; split the instruction message to be sent into sending units; generate unit data packets according to the sending unit; send the unit data packets according to a preset user datagram protocol UDP.
  • an embodiment of the present application further provides another message transmission method, including: receiving a unit data packet according to a preset user datagram protocol UDP, where the unit data packet is generated by a network application according to a sending unit, The sending unit is obtained by dividing the original instruction message for the network application; the original instruction message is synthesized according to the unit data packet.
  • an embodiment of the present application further provides a message transmission device, including an instruction message extraction module, an instruction message splitting module, a data packet generation module, and a data packet transmission module;
  • the instruction message extraction module is set to Extract the instruction message to be sent from the message queue, wherein the instruction message to be sent is the original instruction message with the highest priority in the message queue;
  • the instruction message splitting module is set to split the instruction message to be sent into sending Unit;
  • a data packet generation module configured to generate a unit data packet according to the sending unit;
  • a data packet transmission module configured to send the unit data packet according to a preset user datagram protocol UDP.
  • an embodiment of the present application further provides a device, including: a processor and a memory; at least one instruction is stored in the memory, and the instruction is executed by the processor, so that the device executes as the first Aspect of the message transmission method.
  • an embodiment of the present application further provides a computer-readable storage medium.
  • the device When instructions in the storage medium are executed by a processor of a device, the device enables the device to execute the message transmission method described in the first aspect.
  • an embodiment of the present application further provides another message transmission device, including a data packet receiving module and an instruction message synthesis module.
  • the data packet receiving module is configured to receive unit data packets according to a preset user datagram protocol UDP, wherein the unit data packets are generated by the network application according to the sending unit, and the sending unit is the network application by splitting the original The instruction message is obtained; the instruction message synthesis module is set to synthesize the original instruction message according to the unit data packet.
  • an embodiment of the present application further provides a device, including: a processor and a memory; at least one instruction is stored in the memory, and the instruction is executed by the processor, so that the device executes as the second Aspect of the message transmission method.
  • an embodiment of the present application further provides a computer-readable storage medium.
  • the device When instructions in the storage medium are executed by a processor of a device, the device enables the device to execute the message transmission method according to the second aspect.
  • FIG. 1 is a schematic flowchart of steps at a sending end in a message transmission method according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of steps at a receiving end in a message transmission method according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart of steps in a message transmission method at a sending end in an embodiment of the present application
  • FIG. 4 is a schematic flowchart of steps of a message transmission method at a receiving end in an embodiment of the present application
  • FIG. 5 is a schematic diagram of message transmission between a sending end and a receiving end in an embodiment of the present application
  • FIG. 6 is a schematic structural block diagram of a message transmission device in an embodiment of the present application.
  • FIG. 7 is a schematic structural block diagram of a device in an example of this application.
  • FIG. 8 is a schematic structural block diagram of another embodiment of a message transmission device in an embodiment of the present application.
  • TCP Transmission Control Protocol
  • TCP is mostly implemented by the operating system kernel, and it is more difficult to adjust according to its own business
  • TCP is sent sequentially. If the data packets cannot be transmitted, the subsequent data packets cannot be transmitted, and congestion occurs.
  • Related network applications usually use another technical solution-use UDP with packet loss retransmission to transmit, that is, through UDP.
  • the embodiments of the present application propose a new message transmission method based on UDP.
  • FIG. 1 there is shown a schematic flowchart of steps of a sending end in a message transmission method of the present application, which may include steps 110 to 140.
  • step 110 the instruction message to be sent is extracted from the message queue of the network application, wherein the instruction message to be sent is the original instruction message with the highest priority in the message queue.
  • the original instruction message with the highest priority can be extracted from the message queue of the network application as the current instruction message to be sent.
  • the original instruction message may refer to an instruction message that the network application needs to send, and may include an instruction message generated by the network application according to the operation, a signaling message carrying instruction parameters, and the like, which are not limited in the embodiments of the present application.
  • the network application in the embodiment of the present application may add instruction messages to be sent, such as instruction messages generated according to input operations, signaling messages carrying instruction parameters, etc., to the message queue to wait for sending.
  • instruction messages to be sent such as instruction messages generated according to input operations, signaling messages carrying instruction parameters, etc.
  • step 120 the instruction message to be sent is split into sending units.
  • the instruction message to be sent may be split to obtain a split sending unit, and the message transmission is performed according to the sending unit.
  • the sending unit may refer to a part obtained by splitting the instruction message to be sent.
  • the instruction message to be sent can be split into at least two sending units, for example, the first part of the data in the sending instruction message can be used as the first A sending unit, using the second part data and the third part data in the sending instruction message as the second sending unit obtained by splitting; for another example, the second part data and the first part in the sending instruction message can be used
  • the data is used as the first sending unit after splitting, and the third part of the data in the sending instruction message is used as the second sending unit after splitting; or, the first part of the sending instruction message can be used as the splitting unit.
  • the first sending unit obtained after the division uses the second part of the data in the sending instruction message as the second sending unit obtained after the split, and the third part of the data in the sending instruction message as the obtained after splitting The third sending unit, etc.
  • step 130 a unit data packet is generated according to the sending unit.
  • the sending unit may be used to generate a corresponding unit data packet, and the sending unit may be transmitted in the form of a data packet.
  • step 140 the unit data packet is sent according to a preset user datagram protocol UDP.
  • the sending data packet generated by the user datagram protocol can be sent to transmit the sending unit data packet to the receiving end, so that the receiving end can receive the unit data packet to achieve the transmission purpose.
  • the two ends of the transmission message can be divided into a sending end and a receiving end.
  • the sending end may send various messages that need to be sent, such as instruction messages, signaling messages, and acknowledgment (Acknowledgement, ACK) to be sent to the peer end.
  • the receiving end after receiving the message sent by the sending end, the opposite end can process according to the received message.
  • the opposite end as the receiving end can receive the instruction message sent by the sending end
  • the instruction message is uploaded to the web application to perform the instruction operation specified by the instruction message through the web application.
  • the embodiments of the present application further provide a message transmission method applied to the receiving end.
  • the message transmission method may include steps 210 to 220.
  • a unit data packet is received according to a preset user datagram protocol UDP, wherein the unit data packet is generated by the network application according to the sending unit, and the sending unit is for the network application by splitting the original instruction message get.
  • the receiving end can communicate with the sending end according to the datagram protocol, that is, it can receive various data packets sent by the sending end according to the datagram protocol, such as receiving unit data packets sent by the sending end.
  • step 220 the original instruction message is synthesized according to the unit data packet.
  • the message transmission method can extract the instruction message to be sent from the message queue of the network application, and the instruction message to be sent can be the original instruction message with the highest priority in the message queue of the network application. This can ensure that the highest priority message can be transmitted as soon as possible to improve the transmission quality; and after splitting the to-be-sent instruction message of the network application into the sending unit, the unit data packet can be generated according to the sending unit, and then the unit can be sent according to UDP Data packets, which can avoid the situation encountered by TCP.
  • the embodiments of the present application can not only avoid the situation encountered by TCP, but also ensure that the instruction messages with high priority can be transmitted as soon as possible, thereby avoiding the situation that the transmission of the network application is abnormal and the subsequent operation of the network application cannot be performed. Ensure that network applications can operate normally.
  • the embodiments of the present application can not only prevent TCP from encountering high packet loss, network jitter, and excessive delay, but also ensure that instruction messages with high priority can be transmitted as soon as possible to improve transmission quality.
  • the message transmission of the network application can be divided into two layers, namely an upper layer A and a lower layer B, wherein the upper layer A can be called a service layer and the lower layer B can be called a transmission layer.
  • the business layer can process the obtained data first. For example, after obtaining the original instruction message that needs to be sent in the network application, the original instruction message can be divided according to the timeliness of the message sent. Priority, and at least one sending unit can be split from the original instruction message with the highest priority and transmitted to the transmission layer, so as to transmit the sending unit through the transmission layer.
  • the transmission layer is set to transmit data packets. For example, two types of data packets can be transmitted.
  • One of the data packets can be a unit data packet generated according to the sending unit sent by the service layer to send the sending unit through the unit data packet; the other The data packet may be an acknowledgment data packet, and the acknowledgment data packet carries an ACK so that the sending end can confirm that the data packet sent by it has been successfully transmitted to the opposite end. If the sending end does not receive the confirmation data packet corresponding to the sent data packet within a certain time, it can be considered that the data packet is lost during the transmission process, and the data packet can be added to the retransmission queue (ResendList) in order to Subsequent retransmission of the lost data packet can be achieved based on the retransmission queue.
  • ResendList retransmission queue
  • both the receiving end and the sending end may include a transmission layer and a service layer.
  • the service layer of the sending end is set to extract the instruction message to be sent from the message queue of the network application, and split the instruction message to be sent into sending units;
  • the transmission layer of the sending end is set to generate the unit according to the sending unit A data packet and send the unit data packet according to a preset user datagram protocol UDP;
  • the transmission layer of the receiving end is set to receive the unit data packet according to the preset user datagram protocol UDP;
  • the business layer of the receiving end is set to The original instruction message is synthesized according to the unit data packet.
  • the service layer in the sending end can extract the instruction message to be sent from the message queue of the network application, and split the instruction message to be sent into sending units, so that the transmission layer in the sending end can Generate unit data packets according to the sending unit.
  • the transmission layer in the sending end can send the unit data packet according to a preset user datagram protocol UDP, so that the transmission layer at the receiving end can receive the unit data packet.
  • the transmission layer of the receiving end can receive the unit data packet according to the preset user datagram protocol UDP, and can transmit the unit data packet to the business layer of the receiving end, so that the business layer of the receiving end can synthesize the original instruction message according to the unit data packet, Provided to network applications to complete the message transmission of network applications.
  • the transmission layer at the receiving end may use the sequence number carried in the unit data packet as the confirmation sequence number corresponding to the unit data packet, and return the confirmation sequence number to the transmission end transmitting the unit data packet for transmission Layer, so that the transmission layer at the sending end can determine whether the sent data packet is lost according to the confirmation sequence number.
  • the transmission layer at the sending end can determine whether a retransmission is required by detecting whether the retransmission queue is empty, that is, whether the retransmission queue stores a retransmission sequence number.
  • the retransmission queue stores the retransmission sequence number, it can be determined that the data packet corresponding to the retransmission sequence number needs to be retransmitted; when the retransmission queue is an empty queue, that is, there is no retransmission sequence number stored in the retransmission queue, it can be determined that it is not currently needed Retransmission.
  • FIG. 3 shows a schematic flowchart of the steps of the message transmission method of the sending end in an embodiment of the present application.
  • the message transmission method applied to the sending end may include steps 302 to 316.
  • step 302 it is detected whether the retransmission queue is an empty queue.
  • the transmission layer at the sending end can determine whether the data packet can be sent by detecting the transmission status of the network before sending the unit data packet, for example, by detecting the network's bottleneck bandwidth (Bottleneck Bandwidth, BtlBW) and a data packet's Round-trip time (RTT) to determine the current number of data packets that can be sent.
  • BtlBW Bottleneck Bandwidth
  • RTT Round-trip time
  • the current number of data packets that can be sent is zero, it can be determined that the current data packets cannot be sent; the current data packets can be sent If the number is greater than zero, it can be determined that the current data packet can be sent, and then check whether the retransmission queue is empty to determine whether the data packet needs to be retransmitted, and can be based on the number of data packets that can be sent Packet sending. If the retransmission queue is an empty queue, go to step 306; if the retransmission queue stores a retransmission sequence number, go to step 304.
  • the bottleneck bandwidth BtlBW can be determined according to the transmission rate (DeliveryRate) of the network, which is not limited in the embodiment of the present application.
  • the transport layer before detecting whether the retransmission queue is an empty queue, can also detect the bottleneck bandwidth corresponding to the network application and the round-trip delay of the data packet; subsequently, the bottleneck bandwidth and the The round-trip delay determines the number of packets that can be sent; if the number of packets that can be sent is an integer greater than zero, the above step 302 is performed.
  • the sending end can detect bottleneck bandwidth and data packets corresponding to network applications according to a preset congestion control protocol, such as a bottleneck bandwidth and round-trip delay measurement (Bottleneck Bandwidth and Round-trip propagation time, BBR).
  • the round-trip delay; then, according to the algorithm specified in the congestion control protocol, the detected bottleneck bandwidth BtlBW and the round-trip delay RTT can be used to determine the number of packets that can be sent by the network application.
  • the number of packets that can be sent is zero, it can be determined that there are currently no idle network resources, that is, data packets cannot be sent continuously; when the number of packets that can be sent is an integer greater than zero, it is determined that there are currently idle network resources, that is, the sender's
  • the transport layer can send a data packet, and then the above step 302 can be executed to detect whether ResendList is an empty queue.
  • ResendList is an empty queue, that is, when ResendList does not store a retransmission sequence number
  • the business layer is triggered to perform step 306;
  • ResendList is not an empty queue, that is, when ResendList stores a retransmission sequence number
  • step 304 is performed to When there is a retransmission sequence number, the data packet corresponding to the retransmission sequence number is preferentially sent.
  • step 304 the target retransmission sequence number is extracted from the retransmission queue, and the sent data packet corresponding to the target retransmission sequence number is extracted from the sent queue, and the sent data packet is retransmitted.
  • the transmission layer at the sending end can extract at least one retransmission sequence number with the highest priority from the retransmission queue according to the number of packets that can be sent as the target retransmission sequence number; then the target retransmission can be found in the sent queue
  • the sent data packet corresponding to the serial number, and the found sent data packet can be extracted from the sent queue, and then the extracted sent data packet can be re-sent according to UDP to complete the sent data Packet retransmission.
  • the transport layer may return to step 302 to send the unit data packet corresponding to the sending unit transmitted by the service layer after the retransmission of the sent data packet.
  • step 306 the instruction message to be sent is extracted from the message queue of the network application.
  • the service layer of the sending end may divide each instruction message sent in the network application according to the three priorities of P0, P1, and P2 according to the real-time requirement of message sending to determine each sent instruction The priority of the message. Among them, P0 can be the highest priority; P2 can be the lowest priority.
  • the service layer of the sending end may extract the original instruction message with the highest priority from the message queue as the instruction message to be sent, and then perform step 308.
  • the network application in the embodiment of the present application needs to send a message, it can submit the message to be sent to the interface provided by the business layer of the sending end, so that the business layer of the sending end can obtain the network application through the interface
  • the message needs to be sent, so that the message can be split through the service layer of the sending end to obtain the sending unit, and the sending unit is transmitted to the sending layer of the sending end, so as to transmit the unit data corresponding to the sending unit through the sending layer of the sending end package.
  • step 308 the instruction message to be sent is split into sending units.
  • the service layer of the sending end may split the sending instruction message into sending units, and may transfer the split sending unit to the transport layer to pass through the transport layer Realize the transmission of the sending unit.
  • step 310 a unit data packet is generated according to the sending unit.
  • the transmission layer of the transmitting end may encapsulate according to the data contained in the transmission unit to obtain a data packet as a unit data packet.
  • the unit data packet may carry instruction information and associated packet information corresponding to the sending unit; the associated packet information may be used to determine the associated data packet of the unit data packet; the instruction information may be used to determine the sending unit data Operation instruction corresponding to the package.
  • the first unit data packet can be generated according to one of the two sending units, and the second unit data packet can be generated based on the other sending unit, and the first unit data Both the packet and the second unit data packet carry associated packet information.
  • the associated data packet of the first unit data packet may be determined as the second unit data packet according to the associated packet information carried by the first unit data packet, such as the associated packet carried by the first unit data packet The information is the sequence number, identification, etc. of the data packet of the second unit.
  • the associated data packet of the second unit data packet can be determined to be the first unit data packet according to the associated packet information carried by the second unit data packet.
  • the associated packet information carried by the second unit data packet is the first The sequence number, identification, etc. of a unit data packet.
  • step 312 the unit data packet is sent according to UDP.
  • the transmission layer at the sending end may send the unit data packet according to UDP, so that the receiving peer can receive the unit data packet.
  • the transmission layer at the receiving end can extract the sequence number from the received unit data packet, and can use the extracted sequence number as the confirmation sequence number to generate the confirmation data packet corresponding to the unit data packet according to the sequence number.
  • the confirmation data packet can be sent to the sending end, so that the sending end can determine whether there is a packet loss phenomenon according to the confirmation sequence number carried in the confirmation data packet.
  • the unit data packet may be added to the sent queue to record the unit data packet as the sent data packet.
  • the transmission layer at the sending end may record the unit data packet sent after each unit data packet is sent, that is, each time the unit data packet is sent, the sent unit data packet is put into the SentList, To record the currently sent unit data packet as a sent data packet.
  • the transmission layer at the receiving end can generate an acknowledgment data packet based on the sequence number carried by the unit data packet, and can use the sequence number carried by the unit data packet as the confirmation sequence number, and then follow the ACK
  • the protocol returns the confirmation data packet carrying the confirmation sequence number to the sending end, so that the sending end can determine whether the sent data packet is lost according to the confirmation sequence number.
  • step 314 the transport layer receives an acknowledgement data packet, where the acknowledgement data packet carries an acknowledgement sequence number.
  • step 316 a packet loss sequence number is determined according to the confirmation sequence number, and the packet loss sequence number is added to the retransmission queue as a retransmission sequence number.
  • the retransmission queue in the embodiment of the present application may be in the transmission layer in the sending end, that is, the transmission layer in the sending end may operate the retransmission queue.
  • the transmission layer in the sending end may compare the confirmation sequence number carried in the confirmation data packet with the confirmation sequence number previously received to determine the current reception Whether the received confirmation sequence number is a continuous sequence number corresponding to the confirmation sequence number received in history.
  • the confirmation sequence number currently received is a continuous sequence number corresponding to the confirmation sequence number received in history, it can be determined that no packet loss occurs, and the data packet corresponding to the confirmation sequence number currently received can be sent from the sent queue (SentList) Deleted.
  • SentList can be used to determine the sent data packet in the sending end.
  • the serial number stored in the SentList can be the serial number of the sent data packet in the sending end, such as the unit sent The serial number of the data packet; for another example, in the case where the data packet stored in the SentList is the data packet stored in the SentList, it may be a sent data packet in the sending end, such as a sent unit data packet, and so on.
  • the packet loss sequence number can refer to the sequence number of the lost data packet, and then the packet loss sequence number can be added to the retransmission queue to use the determined packet loss sequence number as the retransmission sequence number, which can then be based on the packet loss sequence number Realize retransmission of lost data packets to ensure transmission quality.
  • the transmission layer at the sending end can parse the confirmation data packet to obtain the confirmation sequence number carried in the confirmation data, and then check whether the confirmation sequence number belongs to the continuous sequence number of the sent data packet.
  • the sequence number of the sent data packet stored in the sending queue determines whether the currently received confirmation sequence number belongs to the continuous sequence number of the sent data packet; or, it can be determined based on the confirmation sequence number carried in the last received confirmation data packet Whether the confirmation sequence number carried in the received confirmation data packet belongs to the continuous sequence number of the sent data packet.
  • the data packet corresponding to the confirmation sequence number can be deleted to save the resource at the sending end.
  • the confirmation sequence number received this time does not belong to the continuous sequence number of the sent data packet
  • the confirmation sequence number carried in the last received confirmation packet is 2
  • the confirmation packet carried in this time received The confirmation sequence number is 4 or 6, that is, if it is determined that the confirmation sequence number 4 or 6 carried in the confirmation packet received this time does not belong to the continuous sequence number of the transmitted packet, it can be based on the confirmation sequence number and the previous received
  • the packet loss sequence number is determined, and then the packet loss sequence number can be placed in the retransmission queue as the retransmission sequence number, so that the lost data packet can be subsequently retransmitted according to the packet loss sequence number.
  • the packet loss sequence number can be used to characterize the lost data packet, such as the sequence number of the lost unit data packet.
  • the sending end may delete the retransmission sequence number that is the same as the confirmation sequence number from the retransmission queue. For example, when the transmission layer at the sending end retransmits a data packet, it can extract the retransmission sequence number with the highest priority from the retransmission queue ResendList, and then extract the unit data packet corresponding to the retransmission sequence number from the sent queue SendList. The unit data packet is retransmitted within the sending time corresponding to the unit data until the confirmation data packet corresponding to the unit data packet is received.
  • the transmission layer at the sending end may receive the unit data packet according to UDP.
  • the unit data packet may be generated by the network application according to the sending unit, and may include instruction information and associated packet information corresponding to the sending unit.
  • step 404 the sequence number carried in the unit data packet is used as the confirmation sequence number, and a confirmation data packet corresponding to the unit data packet is generated according to the confirmation sequence number.
  • the transmission layer at the receiving end may extract the sequence number carried in the unit data packet from the received unit data packet, and may use the extracted sequence number as a confirmation sequence number to The confirmation data packet corresponding to the unit data packet is generated according to the sequence number.
  • step 406 the confirmation data packet is sent.
  • step 408 the original instruction message is synthesized according to the unit data packet.
  • the transmission layer at the receiving end can transmit the received unit data packet to the business layer, so that the business layer can synthesize the original instruction message according to the unit data packet.
  • the business layer at the receiving end may parse the unit data packet to obtain various information carried in the unit data packet, such as associated packet information, instruction message, and the unit data packet contained in the unit data packet. Serial number, etc., and then the data packet associated with the unit data packet can be determined according to the associated packet information, that is, the associated data packet of the unit data packet can be determined, and then the information carried by the associated data packet and the unit data packet can be subsequently determined
  • the carried information restores the original command message that the sending end needs to send.
  • step 504 the target retransmission sequence number is extracted from the retransmission queue.
  • the target retransmission sequence number may be the highest priority retransmission sequence number in the retransmission queue. For example, when the number of sendable packets is greater than zero, the transmission layer of the sending end can extract at least one retransmission sequence number with the highest priority from the retransmission queue according to the number of sendable packets, as the target retransmission sequence number.
  • step 506 the sent data packet corresponding to the target retransmission sequence number is extracted from the sent queue.
  • the transmission layer at the sending end can find the sent data packet corresponding to the target retransmission sequence number in the sent queue according to the target retransmission sequence number, and The sent data packets found in the sent queue are extracted as data packets that need to be retransmitted.
  • step 508 the transmitted data packet is resent.
  • the unit data packet corresponding to the sending unit removed from each service layer in the sending end can be set with a timeout time; when the current time of the unit data packet sent exceeds the timeout time of the unit data packet, it can be no longer Send this unit packet and remove the unit packet from SendList to avoid retransmitting the unit packet after the timeout period of the unit packet is reached; the current time of the unit packet sent does not exceed the unit data
  • the unit data packet can be retransmitted according to the preset data packet retransmission rule until the confirmation data packet corresponding to the high unit data packet is received.
  • the sending end may detect whether the current time is within the sending time range corresponding to the sent data packet; when the current time is within the sending time range Next, retransmit the sent data packet; when the current time exceeds the sent time range, delete the sent data packet from the sent queue, and delete the sent data packet from the retransmission queue
  • the target retransmission sequence number can be used to characterize the timeout period for sending a data packet. For example, the data packet can be sent within the sending time range of the data packet, and the data packet can be not sent outside the sending time range of the data packet.
  • the transmission layer of the sending end can detect whether the current time exceeds the transmission time range corresponding to the transmitted data packet; at the current time, the corresponding If the transmission time is within the range, step 508 may be executed to retransmit the sent data packet so that the receiving end can receive the data packet, that is, the receiving end performs step 518; the current time exceeds the sent data packet
  • the sent data packet can be deleted from the sent queue, and the retransmission sequence number corresponding to the sent data packet can be deleted from the retransmission queue, that is, the target retransmission sequence number is removed from the retransmission queue
  • step 502 can be returned to determine whether there is a data packet that needs to be retransmitted.
  • step 510 the instruction message to be sent is extracted from the message queue.
  • step 512 is then executed.
  • step 512 the instruction message to be sent is split into sending units.
  • the service layer at the sending end may split the sending instruction message into sending units, and may transmit the split sending unit to the transport layer to pass through the transport layer Realize the transmission of the sending unit.
  • step 514 unit data packets are generated according to the sending unit.
  • the transmission layer of the transmitting end may encapsulate according to the data contained in the transmission unit to obtain a data packet as a unit data packet.
  • the unit data packet may carry instruction information and associated packet information corresponding to the sending unit; the associated packet information may be used to determine the associated data packet of the unit data packet; the instruction information may be used to determine the operation corresponding to the sending unit data packet instruction.
  • step 516 the unit data packet is sent according to UDP.
  • the transmission layer of the sending end sends the unit data packet according to UDP, so that the receiving peer can receive the unit data packet.
  • step 518 unit data packets are received according to UDP.
  • the transmission layer of the receiving end can receive the unit data packet according to UDP, and can transmit the received unit data to the business layer of the receiving end.
  • the service layer at the receiving end can synthesize the original instruction message based on the unit data packet, for example, the unit data packet can be parsed according to UDP to obtain various information carried in the unit data packet, such as contained in the unit data packet Associated packet information, instruction message, serial number carried by the unit data packet, etc., and then the data packet associated with the unit data packet can be determined according to the associated packet information, that is, the associated data packet of the unit data packet can be determined, and then the Based on the information carried by the associated data packet and the information carried by the unit data packet, the original instruction message to be sent by the sending end is restored.
  • step 520 a confirmation packet is sent.
  • the transmission layer of the receiving end may use the sequence number of the unit data packet as the confirmation sequence number, and then may generate the confirmation data packet containing the confirmation sequence number according to the ACK protocol, and then perform step 520 to The generated confirmation data packet is returned to the sending end sending the data packet of the unit.
  • the determination sequence number can be used to characterize the confirmation character sent by the receiving end after receiving the unit data packet, so that the sending end determines that the unit data packet has been successfully sent according to the confirmation data packet.
  • step 522 a confirmation packet is received.
  • the confirmation data packet carries a confirmation sequence number.
  • the transmission layer at the sending end may parse the confirmation data packet according to the ACK protocol to obtain the confirmation sequence number carried in the confirmation data packet.
  • step 524 the packet loss sequence number is determined according to the confirmation sequence number.
  • the transmission layer at the sending end may detect whether the confirmation sequence number belongs to a continuous sequence number of the transmitted data packet.
  • the packet loss sequence number can be determined according to the confirmation sequence number, and the determined packet loss sequence number can be added to the retransmission queue as the retransmission sequence number, If the sequence number in the received ACK packet is not continuous, it can be considered that the unit data packet corresponding to the missing sequence number is lost, and the missing sequence number can be placed in the ResendList as the retransmission sequence number, so that it can be based on The retransmission sequence number realizes the retransmission of unit data packets.
  • the sent data packet corresponding to the confirmation sequence number is deleted from the sent queue, for example, if the sequence number in the ACK packet received at the sending end is continuous Next, delete the unit data packet corresponding to the serial number from the sent queue SendList, and then return to step 502 or step 506 to continue transmitting the data packet corresponding to the original command message that the sending end needs to send.
  • the sending end may also delete the same retransmission sequence number as the confirmation sequence number from the retransmission series to avoid repeated transmission of the data pack.
  • the transmission layer at the sending end can extract the packet sequence number from the confirmation data packet as the confirmation sequence number, and detect whether the confirmation sequence number belongs to the continuous sequence number corresponding to the sent data packet; the confirmation sequence number belongs to the continuous sequence number
  • the unit can continue to retransmit the unit data packet based on the retransmission queue ResendList to guide the receipt of the confirmation sequence number corresponding to the unit data packet.
  • the embodiment of the present application incorporates the Congestion-Based Congestion Control into the message transmission method to guide the sending speed of the sending end, so that the sending end can first start from the ResendList each time it calculates a packet that can be sent. Find the highest priority retransmission sequence number in order to find the packet to be retransmitted in SendList according to the retransmission sequence number and send it to achieve retransmission. If there is no sequence number that needs to be retransmitted in ResendList, a unit data packet corresponding to a sending unit can be obtained from the service layer and sent.
  • the embodiment of the present application introduces a congestion control algorithm and self-designed packet loss retransmission logic to avoid network congestion and excessive delays, and makes UDP transmission more efficient and reliable, thereby making it possible to avert network conditions.
  • the message transmission device may include an instruction message extraction module 610, an instruction message splitting module 620, a data packet generation module 630, and a data packet transmission Module 640.
  • the instruction message extraction module 610 is configured to extract the instruction message to be sent from the message queue of the network application, wherein the instruction message to be sent is the original instruction message with the highest priority in the message queue.
  • the instruction message splitting module 620 is configured to split the instruction message to be sent into sending units.
  • the data packet generating module 630 is configured to generate unit data packets according to the sending unit.
  • the data packet sending module 640 is configured to send the unit data packet according to a preset user datagram protocol UDP.
  • the above message transmission device is applied to a sending end, and the sending end includes a transmission layer and a business layer; the above instruction message extraction module and instruction message splitting module may be integrated in the business layer, a data packet generation module and data The packet sending module can be integrated in the business layer.
  • the above message transmission device further includes modules: a retransmission queue detection module and a retransmission module, and both the retransmission queue detection module and the retransmission module can be integrated in the transmission layer.
  • the retransmission queue detection module is set to detect whether the retransmission queue is an empty queue; when the retransmission queue is an empty queue, the instruction message extraction module 610 in the business layer is triggered to execute the message from the network application
  • the retransmission module is configured to extract the sent data packet corresponding to the target retransmission sequence number from the sent queue; and trigger the data packet sending module to retransmit the sent data packet.
  • the retransmission queue detection module may detect whether the retransmission queue is an empty queue before the instruction message extraction module 610 extracts the instruction message to be sent from the message queue; in the case that the retransmission queue is an empty queue, the instruction message extraction may be triggered
  • Module 610 executes the extraction of the instruction message with the highest priority from the message queue to achieve the rapid transmission of the instruction message with the highest priority
  • the retransmission queue stores the retransmission sequence number, that is, when the retransmission queue is not an empty queue ,
  • the retransmission module can be triggered to extract the target retransmission sequence number with the highest priority from the retransmission queue, so that the retransmission of the message with the highest priority can be quickly realized, so as to ensure that the most important messages can be transmitted as soon as possible and improve the transmission effect.
  • the above message transmission device further includes a network detection module and a module for determining the number of packets that can be sent.
  • the network detection module is set to detect the bottleneck bandwidth and the round-trip delay of the data packet corresponding to the network application.
  • a module for determining the number of packets that can be sent is set to determine the number of packets that can be sent based on the bottleneck bandwidth and the round-trip delay; when the number of packets that can be sent is an integer greater than zero, the retransmission queue detection module is triggered Detect whether the retransmission queue is an empty queue.
  • the network detection module can detect the bottleneck bandwidth corresponding to the network application and the round-trip delay of the data packet, so that the number of packets that can be sent is determined by the network detection module.
  • Detects the current corresponding bottleneck bandwidth of the network application and the round-trip delay of the data packet determines the number of packets that the network application can send, and triggers the retransmission queue detection module to detect the retransmission when the number of packets that can be sent is an integer greater than zero Whether the retransmission queue is an empty queue, if the retransmission queue is an empty queue, the message transmission is performed according to the instruction message to be sent by the network application, or, if the retransmission queue is not an empty queue, the retransmission queue is The stored retransmission sequence number is used for message transmission.
  • the message transmission device may further include: a confirmation data packet receiving module, a packet loss sequence number determination module, and a retransmission queue module. Confirm that the data packet receiving module, the packet loss sequence number determining module, and the retransmission queue module can all be integrated in the transmission layer. , Confirmation packet receiving module, set to receive confirmation packet, wherein the confirmation packet carries confirmation sequence number; Packet loss sequence number determination module, set to determine the packet loss sequence number according to the confirmation sequence number; Retransmission queue module, setting To add the packet loss sequence number to the retransmission queue as the retransmission sequence number.
  • the above message transmission device may further include: a sent queue module and a confirmation sequence number detection module.
  • the sent queue module and the confirmation sequence number detection module can also be integrated in the transmission layer.
  • the sent queue module may be configured to add the unit data packet to the sent queue to record the unit data packet as a sent data packet, for example, after the data packet sending module 640 sends the unit data packet, Add the unit data packet sent by the data packet sending module 640 to the sent queue to record the unit data packet as the sent data packet.
  • the confirmation sequence number detection module may be configured to detect whether the confirmation sequence number belongs to the continuous sequence number of the sent data packet; in the case where the confirmation sequence number belongs to the continuous sequence number of the sent data packet, trigger the sent queue module to Delete the sent data packet corresponding to the confirmation sequence number in the sending queue; in the case where the confirmation sequence number does not belong to the continuous sequence number of the sent data packet, the packet loss sequence number determination module may be triggered to perform the determination of the loss based on the confirmation sequence number Package sequence number steps.
  • the confirmation sequence number detection module may detect whether the confirmation sequence number currently received by the confirmation packet reception module belongs to the continuous sequence number of the transmitted packet; In the case of consecutive sequence numbers of data packets, the sent queue module can be triggered to delete the sent data packets corresponding to the confirmation sequence number from the sent queue; in the case where the confirmation sequence number does not belong to the continuous sequence number of the sent data packet, the trigger is lost.
  • the packet sequence number determination module executes the step of determining the packet loss sequence number according to the confirmation sequence number.
  • the retransmission queue module is further configured to delete the retransmission sequence number that is the same as the confirmation sequence number from the retransmission queue.
  • the above message transmission device may further include: a sending time detection module.
  • the time detection module can be integrated in the transmission layer and set to detect whether the current time is within the sending time range corresponding to the sent data packet; when the current time is within the sending time range, the data packet sending module can be triggered The step of resending the sent data packet; when the current time exceeds the sent time range, trigger the sent queue module to delete the sent data packet from the sent queue, and may trigger retransmission The queue module deletes the target retransmission sequence number from the retransmission queue.
  • the time detection module can detect whether the current time is within the sending time range corresponding to the sent data packet; the current time is within the sending time range In this case, the data packet sending module may be triggered to resend the sent data packet; when the current time exceeds the sent time range, the sent queue module is triggered to delete the sent queue from the sent queue Sending a data packet, and triggering the retransmission queue module to delete the target retransmission sequence number from the retransmission queue.
  • the unit data packet of an embodiment of the present application carries instruction information and associated packet information corresponding to the sending unit, and the associated packet information may be used to determine the associated data packet of the unit data packet.
  • the above message transmission device may be integrated in the device as the sending end.
  • the device can be composed of at least two physical entities or a physical entity, such as the device can be a personal computer (Personal Computer (PC), computer, mobile phone, tablet device, personal digital assistant, server, messaging device, game Console etc.
  • PC Personal Computer
  • mobile phone mobile phone
  • tablet device personal digital assistant
  • server messaging device
  • game Console etc.
  • An embodiment of the present application further provides a device, including: a processor and a memory. At least one instruction is stored in the memory, and the instruction is executed by the processor, so that the device executes the message transmission method of the sending end in the foregoing method embodiment.
  • the device may include a processor 70, a memory 71, a display screen 72 with a touch function, an input device 73, an output device 74, and a communication device 75.
  • the number of processors 70 in the device may be at least one, and one processor 70 is used as an example in FIG. 7.
  • the number of the memory 71 in the device may be at least one, and one memory 71 is taken as an example in FIG. 7.
  • the processor 70, the memory 71, the display screen 72, the input device 73, the output device 74, and the communication device 75 of the device may be connected by a bus or other means. In FIG. 7, the connection by a bus is used as an example.
  • the memory 71 is configured to store software programs, computer executable programs, and modules, such as program instructions/modules corresponding to the message transmission method described in any embodiment of the present application (for example, in the above message transmission device Instruction message extraction module 610, instruction message splitting module 620, data packet generation module 630 and data packet sending module 640, etc.).
  • the memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store operation devices and application programs required for at least one function; the storage data area may store data created according to the use of the device and the like.
  • the memory 71 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the memory 71 may include memories remotely provided with respect to the processor 70, and these remote memories may be connected to the device through a network. Examples of the above network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof.
  • the display screen 72 is a display screen 72 with a touch function, which may be a capacitive screen, an electromagnetic screen or an infrared screen.
  • the display screen 72 is configured to display data according to the instructions of the processor 70, and is also configured to receive a touch operation acting on the display screen 72 and send corresponding signals to the processor 70 or other devices.
  • the display screen 72 when the display screen 72 is an infrared screen, the display screen 72 further includes an infrared touch frame, and the infrared touch frame is disposed around the display screen 72.
  • the display screen 72 may also be configured to receive infrared signals, and The infrared signal is sent to the processor 70 or other devices.
  • the communication device 75 is configured to establish a communication connection with other devices, which may be at least one of a wired communication device or a wireless communication device.
  • the input device 73 receives input numeric or character information, and generates key signal input related to user settings and function control of the device, and can also be set as a camera for acquiring images and a sound pickup device for acquiring audio data.
  • the output device 74 may include an audio device such as a speaker. It should be noted that the composition of the input device 73 and the output device 74 can be set according to actual conditions.
  • the processor 70 executes various functional applications and data processing of the device by running software programs, instructions, and modules stored in the memory 71 to implement the above-mentioned message transmission method.
  • the processor 70 executes at least one program stored in the memory 71, the following operation is implemented: extracting the instruction message to be sent from the message queue of the network application, wherein the instruction message to be sent is the message queue The original instruction message with the highest priority in the middle; splitting the instruction message to be sent into sending units; generating unit data packets according to the sending unit; sending the unit data packets according to a preset user datagram protocol UDP.
  • Embodiments of the present application also provide a computer-readable storage medium, when instructions in the storage medium are executed by a processor of a device, so that the device can execute the message transmission method described in the foregoing method embodiments.
  • the message transmission method includes: extracting an instruction message to be sent from a message queue of a network application, wherein the instruction message to be sent is an original instruction message with the highest priority in the message queue; The instruction message is split into sending units; unit data packets are generated according to the sending unit; and the unit data packets are sent according to a preset user datagram protocol UDP.
  • the message transmission device may include a data packet receiving module 810 and an instruction message synthesis module 820.
  • the data packet receiving module 810 is configured to receive a unit data packet according to a preset user datagram protocol UDP, wherein the unit data packet is generated by a network application according to a sending unit, and the sending unit is divided by the network application The original instruction message is obtained.
  • the instruction message synthesis module 820 is configured to synthesize the original instruction message according to the unit data packet.
  • the foregoing another message transmission device may be applied to a receiving end, where the receiving end includes a transmission layer and a service layer; wherein, the data packet receiving module 810 may be integrated in the transmission layer; the instruction message The synthesis module 820 may be integrated at the business layer.
  • the instruction message synthesis module 820 integrated in the business layer may include a data packet reading submodule, an associated data packet determination submodule, and a message synthesis submodule.
  • the data packet reading submodule is configured to read the associated packet information carried in the unit data packet.
  • the associated data packet determination submodule is configured to determine the associated data packet of the unit data packet according to the associated packet information.
  • the message synthesis submodule is configured to synthesize the original instruction message based on the instruction information carried in the unit data packet and the instruction information carried in the associated data packet.
  • the message transmission device used in the receiving end may further include: a confirmation sequence number module, a confirmation data packet generating module, and a confirmation data packet sending module.
  • the confirmation sequence number module, confirmation data packet generation module, and confirmation data packet sending module can all be integrated in the transmission layer of the receiving end.
  • the confirmation sequence number module is set to use the sequence number carried in the unit data packet as the confirmation sequence number;
  • the confirmation data packet generation module is set to generate the confirmation data packet corresponding to the unit data packet according to the confirmation sequence number;
  • the confirmation data packet The sending module is configured to send the confirmation data packet.
  • the confirmation sequence number module can use the sequence number carried by the unit data packet received by the data packet reception module 810 as the confirmation sequence number, so that the confirmation data packet generation module can generate according to the confirmation sequence number
  • the corresponding confirmation data packet can then be sent to the sending end through the confirmation data packet sending module to notify the sending end that the unit data packet has been successfully sent.
  • the message transmission apparatus may be integrated in a device as a receiving end.
  • the device can be composed of at least two physical entities or a physical entity, such as the device can be a personal computer (Personal Computer (PC), computer, mobile phone, tablet device, personal digital assistant, server, messaging device, game Console etc.
  • PC Personal Computer
  • mobile phone mobile phone
  • tablet device personal digital assistant
  • server messaging device
  • game Console etc.
  • An embodiment of the present application further provides a device, including: a processor and a memory. At least one instruction is stored in the memory, and the instruction is executed by the processor, so that the device executes the message transmission method of the receiving end in the foregoing method embodiment.
  • the processor executes at least one program stored in the memory, the following operations are implemented: according to a preset user datagram protocol UDP, a unit data packet is received, wherein the unit data packet is generated by the network application according to the sending unit, The sending unit is obtained by splitting the original instruction message for the network application; the original instruction message is synthesized according to the unit data packet.
  • An embodiment of the present application also provides a computer-readable storage medium, where the instructions in the storage medium are executed by the processor of the device, so that the device can execute the message transmission method of the receiving end in the foregoing method embodiments.
  • a unit data packet is received according to a preset user datagram protocol UDP, wherein the unit data packet is generated by the network application according to the sending unit, and the sending unit is obtained by splitting the original instruction message for the network application ; Synthesize the original instruction message according to the unit data packet.
  • the technical solution of the present application can essentially be embodied in the form of a software product that contributes to the related technology, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, Read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disc, etc., including several instructions to make a computer device (which can be a robot, personal A computer, server, or network device, etc.) executes the message transmission method described in any embodiment of the present application.
  • a computer device which can be a robot, personal A computer, server, or network device, etc.
  • each unit and module included are only divided according to functional logic, but it is not limited to the above division, as long as the corresponding function can be realized; in addition, the function units The name is only for the purpose of distinguishing each other, and is not used to limit the scope of protection of this application.
  • each part of the present application may be implemented by hardware, software, firmware, or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution device.
  • a logic gate circuit for implementing a logic function on a data signal
  • PGA programmable gate arrays
  • FPGA field programmable gate arrays

Abstract

本申请公开了一种消息传输方法、装置、设备及介质,涉及互联网技术领域,该方法包括:从网络应用的消息队列中提取待发送指令消息,其中,所述待发送指令消息为所述消息队列中优先级最高的原始指令消息;将所述待发送指令消息拆分为发送单元;依据所述发送单元生成单元数据包;依据预设的用户数据报协议UDP,发送所述单元数据包。

Description

一种消息传输方法、装置、设备及介质
本申请要求在2018年12月13日提交中国专利局、申请号为201811526715.5的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请涉及互联网技术领域,例如一种消息传输方法、装置、设备及介质。
背景技术
随着互联网技术的快速发展,越来越多的网络应用出现,这些网络应用可以帮助我们解决很多日常的需求。这些网络应用通常分为客户端和服务器端,它们之间相互通信,如通过网络下发和应答相应的指令消息。这些指令消息的传输非常重要,如果指令消息的传输出现问题,网络应用后续的操作都无法进行。
为了保证消息传输的可靠性,目前多数应用的指令消息是根据传输控制协议(Transmission Control Protocol,TCP)来进行传输的。但是,直接采用TCP进行传输,在遇到高丢包、网络抖动时,会出现拥堵和超大延时的情况,在网络带宽低时,还往往会出现消息传输超时的情况,影响消息传输质量和传输效果。
发明内容
本申请实施例提供一种消息传输方法、装置、设备及介质,以基于用户数据报协议(User Datagram Protocol,UDP)加强网络应用的消息传输质量,提高传输效果。
第一方面,本申请实施例提供了一种消息传输方法,包括:从网络应用的消息队列中提取待发送指令消息,其中,所述待发送指令消息为所述消息队列中优先级最高的原始指令消息;将所述待发送指令消息拆分为发送单元;依据所述发送单元生成单元数据包;依据预设的用户数据报协议UDP,发送所述单元数据包。
第二方面,本申请实施例还提供了另一种消息传输方法,包括:依据预设的用户数据报协议UDP,接收单元数据包,其中,所述单元数据包为网络应用依据发送单元生成,所述发送单元为所述网络应用通过拆分原始指令消息得到;依据所述单元数据包合成所述原始指令消息。
第三方面,本申请实施例还提供了一种消息传输装置,包括指令消息提取模块、指令消息拆分模块、数据包生成模块及数据包发送模块;指令消息提取 模块,设置为从网络应用的消息队列中提取待发送指令消息,其中,所述待发送指令消息为所述消息队列中优先级最高的原始指令消息;指令消息拆分模块,设置为将所述待发送指令消息拆分为发送单元;数据包生成模块,设置为依据所述发送单元生成单元数据包;数据包发送模块,设置为依据预设的用户数据报协议UDP,发送所述单元数据包。
第四方面,本申请实施例还提供了一种设备,包括:处理器和存储器;所述存储器中存储有至少一条指令,所述指令由所述处理器执行,使得所述设备执行如第一方面所述的消息传输方法。
第五方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质中的指令由设备的处理器执行时,使得设备能够执行如第一方面所述的消息传输方法。
第六方面,本申请实施例还提供了另一种消息传输装置,包括数据包接收模块及指令消息合成模块。数据包接收模块,设置为依据预设的用户数据报协议UDP,接收单元数据包,其中,所述单元数据包为网络应用依据发送单元生成,所述发送单元为所述网络应用通过拆分原始指令消息得到;指令消息合成模块,设置为依据所述单元数据包合成所述原始指令消息。
第七方面,本申请实施例还提供了一种设备,包括:处理器和存储器;所述存储器中存储有至少一条指令,所述指令由所述处理器执行,使得所述设备执行如第二方面所述的消息传输方法。
第八方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质中的指令由设备的处理器执行时,使得设备能够执行如第二方面所述的消息传输方法。
附图说明
图1是本申请一实施例的一种消息传输方法中发送端的步骤流程示意图;
图2是本申请一实施例的一种消息传输方法中接收端的步骤流程示意图;
图3是本申请一实施例中发送端的消息传输方法的步骤流程示意图;
图4是本申请一实施例中接收端的消息传输方法的步骤流程示意图;
图5是本申请一实施例中的发送端与接收端进行消息传输的示意图;
图6是本申请一实施例中的一种消息传输装置的结构方框示意图;
图7是本申请一个示例中的一种设备的结构方框示意图;
图8是本申请一实施例中的另一种消息传输装置实施例的结构方框示意图。
具体实施方式
发明人在实现本申请时发现,网络应用直接采用TCP来进行传输存在以下 缺点:一是不可控,TCP多由操作系统内核实现,比较难根据自身业务做调整;二是TCP是顺序发送,前面的数据包传不到,后面的数据包就无法传输,出现拥堵情况;三是网络环境如果是高丢包网络环境,TCP的发送速率往往会受到丢包影响而变低。为了避免TCP遇到高丢包、网络抖动时会出现拥堵和超大延时的情况,相关网络应用通常采用另一种技术方案——用加了丢包重传的UDP去传输,即通过UDP来传输指令消息,加上丢包对抗技术,使本身不具备可靠性的UDP变的可靠,但是这种技术方案的缺点就是没法根据网络环境调整发包速率,可能会造成网络拥堵,最终传输效果可能还不如用TCP来传输。
为了避免TCP遇到的情况和避免UDP发送时的拥塞情况,本申请实施例基于UDP提出了一种新的消息传输方法。
参照图1,示出了本申请的一种消息传输方法中的发送端的步骤流程示意图,可以包括步骤110至步骤140。
在步骤110中,从网络应用的消息队列中提取待发送指令消息,其中,所述待发送指令消息为所述消息队列中优先级最高的原始指令消息。
本申请一实施例在确定出可发送数据包的情况下,可以从网络应用的消息队列中提取出优先级最高的原始指令消息,以作为当前的待发送指令消息。其中,原始指令消息可以是指网络应用所需要发送的指令消息,可以包括网络应用依据操作生成的指令消息、携带指令参数的信令消息等,本申请实施例对此不作限制。
需要说明的是,本申请实施例中的网络应用可以将需要发送的指令消息,如依据输入操作生成的指令消息、携带有指令参数的信令消息等,添加到消息队列中,以等待发送。
在步骤120中,将所述待发送指令消息拆分为发送单元。
本申请一实施例在获取到待发送指令消息后,可以对待发送指令消息进行拆分,得到拆分后的发送单元,以按照发送单元为单元进行消息传输。其中,发送单元可以是指将待发送指令消息拆分后的一个部分。例如,在待发送指令消息包括三部分数据的情况下,可以将该待发送指令消息拆分为至少两个发送单元,如可以将该发送指令消息中的第一部分数据作为拆分后得到的第一个发送单元,将发送指令消息中的第二部分数据和第三部分数据作为拆分后得到的第二个发送单元;又如,可以将该发送指令消息中的第二部分数据和第一部分数据作为拆分后得到的第一个发送单元,将发送指令消息中的第三部分数据作为拆分后得到的第二个发送单元;或者,可以将该发送指令消息中的第一部分数据作为拆分后得到的第一个发送单元,将发送指令消息中的第二部分数据作为拆分后得到的第二个发送单元,以及,将发送指令消息中的第三部分数据作为拆分后得到的第三个发送单元等。
在步骤130中,依据所述发送单元生成单元数据包。
本申请一实施例在拆分出待发送消息对应的发送单元后,可采用该发送单元生成对应的单元数据包,以采用数据包的形式对发送单元进行传输。
在步骤140中,依据预设的用户数据报协议UDP,发送所述单元数据包。
本一实施例可以按照用户数据报协议生成的发送数据包进行发送,以将该发送单元数据包传输给接收端,使得接收端可以接收到该单元数据包,达到传输目的。
在实际处理中,可以将传输消息的两端分为发送端和接收端。其中,发送端可以将需要发送的各种消息,如网络应用所需要发送的指令消息、信令消息、确认字符(Acknowledgement,ACK)等,发送给对端。对端作为接收端,在接收到发送端所发送的消息后,可以依据接收到的消息进行处理,如结合上述例子,作为接收端的对端在接收到发送端所发送的指令消息后,可以将指令消息上传给网络应用,以通过网络应用执行该指令消息所指定的指令操作。
在上述实施例的基础上,本申请实施例还提供应用于接收端的消息传输方法,如图2所述,该消息传输方法可以包括步骤210至步骤220。
在步骤210中,依据预设的用户数据报协议UDP,接收单元数据包,其中,所述单元数据包为网络应用依据发送单元生成,所述发送单元为所述网络应用通过拆分原始指令消息得到。
本申请一实施例中的接收端可以按照数据报协议与发送端进行通讯,亦即可以按照数据报协议接收发送端所发送的各种数据包,如接收到发送端所发送的单元数据包。
在步骤220中,依据所述单元数据包合成所述原始指令消息。
本申请一实施例中的接收端在接收到单元数据包后,可以依据接收到的单元数据包中所包含的数据生成该单元数据包所对应的原始指令消息,从可以依据原始指令消息触发接收端或该接收端所安装的网络应用执行相应的操作,保证网络应用的正常操作。
综上,采用本申请实施例提供的消息传输方法,可以从网络应用的消息队列中提取待发送指令消息,且该待发送指令消息可以为网络应用的消息队列中优先级最高的原始指令消息,从而可以保证优先级最高的消息能够尽快传输,提高传输质量;并在将网络应用的待发送指令消息拆分为发送单元后,可以依据该发送单元生成单元数据包,随后可依据UDP发送该单元数据包,从而可以避免TCP遇到的情况。由此可见,本申请实施例不仅能够避免TCP遇到的情况,还能保证优先级高的指令消息能够尽快传输,进而能够避免网络应用的传输出现异常导致网络应用后续的操作无法进行的情况,保证网络应用能够正常操作。
本申请实施例不仅能够避免TCP遇到高丢包、网络抖动和超大延时的情况, 还能保证优先级高的指令消息能够尽快传输,提高传输质量。
在一实施例中,可以将网络应用的消息传输分为两层,分别为上层A和下层B,其中,上层A可称为业务层,下层B可以称为传输层。业务层在获取到网络应用的数据后,可以先对获取到的数据进行处理,如在获取到网络应用中需要发送的原始指令消息后,可以按照消息发送的及时性划分获取到原始指令消息的优先级,并可以从优先级最高的原始指令消息中拆分出至少一个发送单元,传输给传输层,以通过传输层对该发送单元进行传输。传输层设置为传输数据包,如可以传输两种数据包,其中一种数据包可以是依据业务层发送的发送单元生成的单元数据包,以通过该单元数据包将发送单元发送出去;另一种数据包可以是确认数据包,该确认数据包携带有ACK,使得发送端可以确认其所发送的数据包已成功传输到对端。在发送端在一定时间内没有接收到已发送的数据包对应的确认数据包的情况下,可以认为在传输过程中丢失数据包,可以将该数据包添加到重传队列(ResendList)中,以便后续可以基于该重传队列实现丢失的数据包的重传。
在本申请一个实施例中,接收端和发送端可以均可以包含有传输层和业务层。其中,发送端的业务层,设置为从网络应用的消息队列中提取待发送指令消息,并将所述待发送指令消息拆分为发送单元;发送端的传输层,设置为依据所述发送单元生成单元数据包,并依据预设的用户数据报协议UDP发送所述单元数据包;接收端的传输层设置为依据预设的用户数据报协议UDP接收所述单元数据包;以及,接收端的业务层设置为依据所述单元数据包合成所述原始指令消息。
在一实施例中,发送端中的业务层可以从于从网络应用的消息队列中提取待发送指令消息,并将所述待发送指令消息拆分为发送单元,使得发送端中的传输层可以依据所述发送单元生成单元数据包。发送端中的传输层在生成单元数据包后,可以依据预设的用户数据报协议UDP发送所述单元数据包,使得接收端的传输层可以接收到该单元数据包。接收端的传输层可以依据预设的用户数据报协议UDP接收单元数据包,并可以将该单元数据包传输给接收端的业务层,使得接收端的业务层可以依据单元数据包合成所述原始指令消息,提供给网络应用,完成网络应用的消息传输。此外,接收端的传输层在接收到单元数据包后,可以将该单元数据包中携带的序号作为该单元数据包对应的确认序号,并将该确认序号返回给发送该单元数据包的发送端的传输层,使得发送端的传输层可以依据该确认序号确定已发送的数据包是否丢失。
基于上述划分的业务层和传输层,下文分别论述发送端和接收端的消息传输方法的步骤。
在实际处理中,发送端的传输层在确定出可发送数据包后,可以通过检测 重传队列是否为空队列,即检测重传队列是否存放有重传序号,来确定是否需要重传。当重传队列存放有重传序号,可以确定当前需要重传该重传序号对应的数据包;当重传队列为空队列,即重传队列中没有存放有重传序号,可以确定当前不需要重传。因此,在本申请的一个实施例中,在业务层从网络应用的消息队列中提取待发送指令消息之前,发送端的传输层可以检测重传队列是否为空队列;在所述重传队列存有重传序号的情况下,从所述重传队列中提取目标重传序号,并从已发送队列中提取所述目标重传序号对应的已发送数据包,重发所述已发送数据包,所述目标重传序号为所述重传队列中优先级最高的重传序号;在所述重传队列为空队列的情况下,触发所述业务层从网络应用的消息队列中提取待发送指令消息。
参照图3,示出了本申请一个实施例中发送端的消息传输方法的步骤流程示意图。应用于发送端的消息传输方法,可以包括步骤302至步骤316。
在步骤302中,检测重传队列是否为空队列。
在实际处理中,发送端的传输层在发送单元数据包之前,可以通过检测网络的传输状态来确定是否可以发送数据包,如可以通过检测网络的瓶颈带宽(Bottleneck Bandwidth,BtlBW)和一个数据包的往返时延(Round-Trip Time,RTT)来确定当前的可发送数据包数量,在当前的可发送数据包数量为零的情况下,可以确定当前不可以发送数据包;在当前可发送数据包数量为大于零的数值的情况下,可以确定当前可以发送数据包,随后检测重传队列是否为空队列,以确定是否需要进行数据包的重传,并可依据该可发送数据包数量进行数据包的发送。在重传队列为空队列的情况下,执行步骤306;在重传队列存放有重传序号的情况下,执行步骤304。其中,瓶颈带宽BtlBW可以依据网络的传输速率(DeliveryRate)确定,本申请实施例对此不作限制。
本申请一实施例中,传输层在检测所述重传队列是否为空队列之前,还可以检测网络应用对应的瓶颈带宽和数据包的往返时延;随后,可依据所述瓶颈带宽和所述往返时延,确定可发送包数量;在所述可发送包数量为大于零的整数的情况下,执行上述步骤302。例如,发送端可以依据预设的拥塞控制协议,如一种基于瓶颈带宽和往返时延测量的拥塞控制协议(Bottleneck Bandwidth and Round-trip propagation time,BBR),检测网络应用对应的瓶颈带宽和数据包的往返时延;随后,可按照该拥塞控制协议所规定的算法,采用检测到的瓶颈带宽BtlBW和往返时延RTT,确定出该网络应用的可发送包数量。在可发送包数量为零的情况下,可以确定当前没有空闲网络资源,即不可继续发送数据包;在可发送包数量为大于零的整数的情况下,确定当前具有空闲网络资源,即发送端的传输层可以发送数据包,随后可执行上述步骤302,以检测ResendList是否为空队列。在ResendList为空队列,即在ResendList未存放有重传序号的情况 下,触发业务层执行步骤306;在ResendList不为空队列,即在ResendList存放有重传序号的情况下,执行步骤304,以在有重传序号的情况下优先发送该重传序号对应的数据包。
在步骤304中,从所述重传队列中提取目标重传序号,并从已发送队列中提取所述目标重传序号对应的已发送数据包,重发所述已发送数据包。
在一实施例中,发送端的传输层可以依据可发送包数量从重传队列中提取至少一个优先级最高的重传序号,以作为目标重传序号;随后可在已发送队列中查找出目标重传序号所对应的已发送数据包,并可以从该已发送队列中提取出查找到的已发送数据包,然后可以按照UDP,重新对提取到的已发送数据包进行发送,以完成该已发送数据包的重传。在完成已发送数据包的重传后,传输层可以返回执行步骤302,以在重传完已发送数据包后发送业务层传输过来的发送单元对应的单元数据包。
在步骤306中,从网络应用的消息队列中提取待发送指令消息。
在一实施例中,发送端的业务层可以按照消息发送的实时性要求,将网络应用中每个发送的指令消息按照P0、P1、P2这三个优先级进行划分,以确定每个发送的指令消息对应的优先级。其中,P0可以为最高的优先级;P2可以为最低的优先级。在确定出可发送数据包后,且不需要重传数据包的情况下,发送端的业务层可以从消息队列中提取优先级最高的原始指令消息,以作为待发送指令消息,然后执行步骤308。
需要说明的是,本申请实施例中的网络应用在需要发送消息的时候,可以将需要发送的消息提交给发送端的业务层提供的接口,使得发送端的业务层可以通过该接口获取到网络应用所需要发送的消息,从而可以通过发送端的业务层将拆分该消息,得到的发送单元,并将该发送单元传输到发送端的传输层,以通过该发送端的传输层传输该发送单元对应的单元数据包。
在步骤308中,将所述待发送指令消息拆分为发送单元。
在一实施例中,发送端的业务层在获取到待发送指令消息后,可以将该发送指令消息拆分为发送单元,并可以将拆分后得到的发送单元传输给传输层,以通过传输层实现该发送单元的传输。
在步骤310中,依据所述发送单元生成单元数据包。
在一实施例中,发送端的传输层在接收到业务层所传输的发送单元后,可以依据该发送单元中所包含的数据进行封装,得到作为单元数据包的数据包。示例性的,该单元数据包可以携带有所述发送单元对应的指令信息和关联包信息;关联包信息可以用于确定所述单元数据包的关联数据包;指令信息可以用于确定发送单元数据包对应的操作指令。
例如,在待发送指令消息拆分为2个发送单元后,可以依据这2个中的一 个发送单元生成第一单元数据包,依据另一个发送单元生成第二单元数据包,且第一单元数据包和第二单元数据包均携带有关联包信息。在一实施例中,可以依据该第一单元数据包携带的关联包信息,确定出该第一单元数据包的关联数据包为第二单元数据包,如该第一单元数据包携带的关联包信息为第二单元数据包的序号、标识等。同理,可以依据该第二单元数据包携带的关联包信息,确定出该第二单元数据包的关联数据包为第一单元数据包,如该第二单元数据包携带的关联包信息为第一单元数据包的序号、标识等。
在步骤312中,依据UDP发送所述单元数据包。
在一实施例中,发送端的传输层在生成单元数据包后,可以按照UDP发送该单元数据包,使得接收对端可以接收到该单元数据包。接收端的传输层在接收到单元数据包后,可以从接收到的单元数据包中提取序号,并可以将该提取到的序号作为确认序号,以依据该序号生成单元数据包对应的确认数据包,随后可将确认数据包发送给发送端,使得发送端可以依据该确认数据包中携带的确认序号确定是否存在丢包现象。
在一实施例中,在所述传输层发送单元数据包之后,可以将该单元数据包添加到已发送队列中,以将该单元数据包记录为已发送数据包。示例性的,发送端的传输层可以在每次发送单元数据包后,将发送的单元数据包记录下来,即在每次发送单元数据包时,将发送到的单元数据包放入到SentList中,以将当前发送的单元数据包记录为已发送数据包。接收端的传输层在接收到发送端所发送的单元数据包后,可以基于该单元数据包所携带的序号生成确认数据包,并可将该单元数据包所携带的序号作为确认序号,随后按照ACK协议,将携带确认序号的确认数据包返回给发送端,使得发送端可以依据该确认序号确定已发送的数据包是否丢失。
在步骤314中,传输层接收确认数据包,其中,所述确认数据包携带有确认序号。
在步骤316中,依据所述确认序号确定丢包序号,并将所述丢包序号添加到所述重传队列中,以作为重传序号。
需要说明的是,本申请实施例中的重传队列可以在发送端中传输层中,亦即,发送端中传输层可以对该重传队列进行操作。
在一实施例中,发送端中的传输层在接收到接收端所返回的确认数据包后,可以将该确认数据包所携带的确认序号与之前接收到的确认序号进行比较,以确定当前接收到的确认序号是否是历史接收到的确认序号对应的连续序号。在当前接收到的确认序号是历史接收到的确认序号对应的连续序号的情况下,可以确定没有发生丢包现象,并可以将当前接收到的确认序号对应的数据包从已发送队列(SentList)中删除。其中,SentList可以用于确定发送端中已发送数 据包,如在SentList中存放是序号的情况下,该在SentList中存放的序号可以是发送端中已发送数据包的序号,如已发送的单元数据包的序号;又如,在SentList中存放是数据包的情况下,该在SentList中存放的数据包可以是发送端中已发送数据包,如已发送的单元数据包等等。在当前接收到的确认序号不是历史接收到的确认序号对应的连续序号的情况下,可以确定发生丢包现象,并可以基于该当前接收到的确认序号和历史接收到的确认序号,确定出丢包序号,该丢包序号可以是指丢失的数据包的序号,随后可将丢包序号添加到重传队列中,以将确定出的丢包序号作为重传序号,进而可以依据该丢包序号实现丢失数据包的重传,保证传输质量。
在一实施例中,本实施例在传输层接收确认数据包之后,可以检测该确认数据包携带的确认序号是否属于所述已发送数据包的连续序号;在所述确认序号属于所述已发送数据包的连续序号的情况下,从所述已发送队列中删除所述确认序号对应的已发送数据包;在所述确认序号不属于所述已发送数据包的连续序号的情况下,依据所述确认序号确定丢包序号,将所述丢包序号添加到重传队列中,以作为重传序号。例如,发送端的传输层在接收到确认数据包后,可以通过解析该确认数据包,得到该确认数据所携带的确认序号,随后检测确认序号是否属于已发送数据包的连续序号,如可以基于已发送队列中存放的已发送数据包的序号确定当前接收到的确认序号是否属于已发送数据包的连续序号;或者,可以基于上一次接收到确认数据包所携带的确认序号,来确定本次接收到的确认数据包所携带的确认序号是否属于已发送数据包的连续序号。在本次接收到的确认序号属于已发送数据包的连续序号的情况下,可以删除该确认序号对应的以发送数据包,以节省发送端资源。
作为本申请的一个示例,在上一次接收到确认数据包所携带的确认序号为2,而本次接收到的确认数据包所携带的确认序号为3的情况下,可以确定本次接收到的确认数据包所携带的确认序号3属于已发送数据包的连续序号,进而可以确定本次接收到的确认序号所对应的已发送数据包已传输到接收端,随后基于可从已发送队列中删除本次接收到确认序号所对应的已发送数据包或者该已发送数据包的序号,如在SentList中存放的是序号的情况下,将SentList中存放的与本次接收到确认序号相同的序号删除;又如,在SentList中存放的是数据包的情况下,按照本次接收到确认序号从SentList中查找出对应的已发送数据并删除等。
在本次接收到的确认序号不属于已发送数据包的连续序号的情况下,如在上一次接收到确认数据包所携带的确认序号为2,而本次接收到的确认数据包所携带的确认序号为4或6,即在确定本次接收到的确认数据包所携带的确认序号4或6不属于已发送数据包的连续序号情况下,可以基于该本次接收到的确认序 号和上一次接收到确认序号确定出丢包序号,随后可将该丢包序号放入到重传队列中,作为重传序号,以便后续可以依据该丢包序号实现对丢失数据包的重传。其中,丢包序号可以用于表征丢失数据包,如可以是丢失的单元数据包的序号。
在一实施例中,在所述确认序号属于连续序号的情况下,发送端可以从所述重传队列中删除与所述确认序号相同的重传序号。例如,发送端的传输层在重传数据包时,可以从重传队列ResendList中提取优先级最高的重传序号,随后可从已发送队列SendList中提取该重传序号对应的单元数据包,以及在该单元数据对应的发送时间内重传该单元数据包,直到接收到该单元数据包对应的确认数据包。
可见,本申请实施例中发送端的传输层也可以从重传系列中删除与该确认序号相同的重传序号,以避免重复发送已传输到接收端的数据包,节省网络传输资源。
在实际处理中,本申请实施例中的接收端在所述传输层接收单元数据包之后,可以通过该传输层将接收到的单元数据包中携带的序号作为确认序号,并返回给发送端,使得发送端可以依据该确认序号确定是否存在丢包现象。在一实施例中,接收端在所述传输层接收单元数据包之后,可以通过传输层,将该单元数据包中携带的序号作为确认序号;随后可依据所述确认序号生成所述单元数据包对应的确认数据包,并发送确认数据包。
参照图4,示出了本申请一个实施例中接收端的消息传输方法的步骤流程示意图。应用于接收端的消息传输方法,可以包括步骤402至步骤408。
在步骤402中,依据UDP接收单元数据包。
在一实施例中,在发送端的传输层按照UDP发送单元数据包后,接收端的传输层可以按照UDP接收到该单元数据包。该单元数据包可以为网络应用依据发送单元生成的,可以包括发送单元对应的指令信息和关联包信息等。
在步骤404中,将所述单元数据包中携带的序号作为确认序号,并依据所述确认序号生成所述单元数据包对应的确认数据包。
在一实施例中,接收端的传输层在接收到单元数据包后,可以从接收到的单元数据包中提取该单元数据包所携带的序号,并可以将该提取到的序号作为确认序号,以依据该序号生成单元数据包对应的确认数据包。
在步骤406中,发送所述确认数据包。
接收端的传输层在生成确认数据包后,可将确认数据包发送给发送端,使得发送端可以依据该确认数据包中携带的确认序号确定是否存在丢包现象。
在步骤408中,依据所述单元数据包合成所述原始指令消息。
本申请一实施例中,接收端的传输层可以将接收到的单元数据包传输给业 务层,使得业务层可以依据该单元数据包合成原始指令消息。示例性的,接收端的业务层可对该单元数据包进行解析,得到该单元数据包所携带的各种信息,如单元数据包中所包含的关联包信息、指令消息、该单元数据包携带的序号等,进而可以依据该关联包信息确定出与该单元数据包关联的数据包,即确定出该单元数据包的关联数据包,随后可依据该关联数据包所携带的信息和该单元数据包携带的信息还原出发送端所需要发送的原始指令消息。
在一实施例中,业务层依据所述单元数据包合成所述原始指令消息可以包括:读取所述单元数据包中携带的关联包信息;依据所述关联包信息确定所述单元数据包的关联数据包;基于所述单元数据包中携带的指令信息和所述关联数据包中携带的指令信息,合成所述原始指令消息。
在一实施例中,接收端的传输层在接收到单元数据包后,可以将该单元数据包传输给接收端的业务层,使得接收端的业务层可以依据该单元数据包合成原始指令消息。接收端的业务层在接收到传输层所传输的单元数据包后,可以从该单元数据包读取出关联包信息,以依据该关联包信息确定出该单元数据包的关联数据包,随后可分别读取关联数据包携带的指令消息和该单元数据包携带的指令信息,以采用读取出的指令消息合成网络应用的原始指令消息,以及将该原始指令消息提供给网络应用,使得网页应用可以依据该原始指令消息执行相应的指令操作,保证网络应用能够正常操作。
可见,本申请实施例中接收端的业务层能够依据单元数据包中携带的信息尽可能合成原始信令消息,不需要保持每个单元数据包的连续性,从而能够避免丢失的单元数据包对其不关联的单元数据包所造成的影响,提高传输质量。
参照图5,示出了本申请实施例中的发送端与接收端进行消息传输的示意图。如图5所示,本申请实施例提供的消息传输方法可以包括步骤502至步骤524。
在步骤502中,检测重传队列是否为空队列。
在实际处理中,发送端的传输层在确定出当前可以发送数据包后,可以检测重传队列是否为空队列的步骤,以确定是否需要进行数据包的重传。当重传队列为空队列,即在重传队列未存放有重传序号的情况下,执行步骤510;当重传队列不为空队列,即在重传队列存放有重传序号的情况下,执行步骤504。
在步骤504中,从所述重传队列中提取目标重传序号。
其中,目标重传序号可以为重传队列中优先级最高的重传序号。例如,在可发送包数量为大于零的数值的情况下,发送端的传输层可以依据该可发送包数量从重传队列中提取至少一个优先级最高的重传序号,以作为目标重传序号。
在步骤506中,从已发送队列中提取所述目标重传序号对应的已发送数据包。
在一实施例中,发送端的传输层在提取出目标重传序号后,可以依据目标 重传序号,在已发送队列中查找出该目标重传序号所对应的已发送数据包,并可以从该已发送队列中提取出查找到的已发送数据包,以作为需要重传的数据包。
在步骤508中,重发所述已发送数据包。
在一实施例中,发送端的传输层在提取出需要重传的已发送数据包后,可以按照UDP,重新对该已发送数据包进行发送,以完成该已发送数据包的重传。
在实际处理中,发送端中的每一个业务层拆出来发送单元对应的单元数据包可以设置有超时时间;当发送的该单元数据包当前时间超过了这个单元数据包的超时时间,可以不再发送这个单元数据包,并从SendList里移除该单元数据包,以避免在到达该单元数据包的超时时间后重传该单元数据包;在发送的该单元数据包当前时间未超过这个单元数据包的超时时间的情况下,可以按照预设的数据包重传规则一直重传该单元数据包,直到收到高单元数据包对应的确认数据包。
在一实施例中,发送端在传输层重发已发送数据包之前,可以检测当前时间是否在所述已发送数据包对应的发送时间范围内;在当前时间在所述发送时间范围内的情况下,重传所述已发送数据包;在所述当前时间超出所发送时间范围的情况下,从所述已发送队列中删除所述已发送数据包,并从所述重传队列中删除所述目标重传序号。其中,发送时间范围可以用于表征数据包发送的超时时间,如在该数据包的发送时间范围内可以发送该数据包,而在该数据包的发送时间范围外就可以不发该数据包。
在一实施例中,发送端的传输层在确定出需要重传的已发送数据包后,可以检测当前时间是否超过已发送数据包对应的发送时间范围;在当前时间在该已发送数据包对应的发送时间范围内的情况下,可以执行步骤508,以实现该已发送数据包的重传,使得接收端可以接收到该数据包,即接收端执行步骤518;在当前时间超出该已发送数据包对应的发送时间范围的情况下,可以从所述已发送队列中删除已发送数据包,并可以从重传队列中删除该已发送数据包对应的重传序号,即将目标重传序号从重传队列中移除,随后可返还执行步骤502,以确定是否有需要重传的数据包。
在步骤510中,从消息队列中提取待发送指令消息。
在一实施例中,在发送端的传输层确定出可发送数据包后,且不需要重传数据包的情况下,可以触发发送端的业务层从消息队列中提取优先级最高的原始指令消息,以作为待发送指令消息,然后执行步骤512。
在步骤512中,将所述待发送指令消息拆分为发送单元。
在一实施例中,发送端的业务层在提取到待发送指令消息后,可以将该发送指令消息拆分为发送单元,并可以将拆分后得到的发送单元传输给传输层, 以通过传输层实现该发送单元的传输。
在步骤514中,依据所述发送单元生成单元数据包。
在一实施例中,发送端的传输层在接收到业务层所传输的发送单元后,可以依据该发送单元中所包含的数据进行封装,得到作为单元数据包的数据包。该单元数据包可以携带有所述发送单元对应的指令信息和关联包信息;关联包信息可以用于确定所述单元数据包的关联数据包;指令信息可以用于确定发送单元数据包对应的操作指令。
在步骤516中,依据UDP发送所述单元数据包。
在一实施例中,发送端的传输层按照UDP发送该单元数据包,使得接收对端可以接收到该单元数据包。
在步骤518中,依据UDP接收单元数据包。
在一实施例中,在发送端的传输层按照UDP发送单元数据包后,接收端的传输层可以按照UDP接收到该单元数据包,并可将接收到单元数据传输给接收端的业务层。随后,接收端的业务层可以依据该单元数据包合成所述原始指令消息,如可依据UDP对该单元数据包进行解析,得到该单元数据包所携带的各种信息,如单元数据包中所包含的关联包信息、指令消息、该单元数据包携带的序号等,进而可以依据该关联包信息确定出与该单元数据包关联的数据包,即确定出该单元数据包的关联数据包,随后可依据该关联数据包所携带的信息和该单元数据包携带的信息还原出发送端所需要发送的原始指令消息。
在步骤520中,发送确认数据包。
在一实施例中,接收端的传输层在接收到单元数据包后,可以该单元数据包的序号作为确认序号,随后可按照ACK协议生成包含该确认序号的确认数据包,然后执行步骤520,以将生成的确认数据包返回给发送该单元数据包的发送端。其中,确定序号可以用于表征接收端接收到单元数据包后所发送的确认字符,使得发送端依据该确认数据包确定该单元数据包已成功发送。
在步骤522中,接收确认数据包。
其中,所述确认数据包携带有确认序号。在一实施例中,发送端的传输层在接收到确认数据包后,可以按照ACK协议对该确认数据包进行解析,得到该确认数据包中所携带的确认序号。
在步骤524中,依据所述确认序号确定丢包序号。
在一实施例中,发送端的传输层在得到确认数据包所携带的确认序号后,可以检测所述确认序号是否属于所述已发送数据包的连续序号。在该确认序号不属于已发送数据包的连续序号的情况下,可以依据所述确认序号确定丢包序号,并可将确定出的丢包序号添加到重传队列中,以作为重传序号,如在接收到的ACK包里的序号不连续的情况下,可以认为缺掉的序号对应的单元数据包 丢了,并可将缺掉的序号作为重传序号放入ResendList中,以便后续可以依据该重传序号实现单元数据包的重传。在该确认序号属于已发送数据包的连续序号的情况下,从所述已发送队列中删除所述确认序号对应的已发送数据包,如在发送端接收到的ACK包里的序号连续的情况下,将该序号对应的单元数据包从已发送队列SendList里删掉,然后返回执行步骤502或步骤506,以继续传输该发送端所需要发送的原始指令消息对应的数据包。当然,在接收到的确认序号为数据包重传时所携带的序号的情况下,发送端也可以从重传系列中删除与该确认序号相同的重传序号,以避免重复发送已传输到接收端的数据包。
例如,发送端的传输层在接收到确认数据包后,可以从该确认数据包提取出包序号,作为确认序号,并检测确认序号是否属于已发送数据包对应的连续序号;在确认序号属于连续序号的情况下,可以将该确认序号对应的单元数据包从已发送队列SendList里删掉,以及,将确认序号从重传队列ResendList中删掉;在检测到收到的确认序号不连续的情况下,可以认为缺掉的序号对应的单元数据包丢了,进可以基于重传队列ResendList继续重传该单元数据包,指导接收到该单元数据包对应的确认序号。
综上,本申请实施例将拥塞控制算法(Congestion-Based Congestion Control)纳入消息传输方法中,以指导发送端的发送速度,从而使得发送端在每次计算出可发包的情况下,可以先从ResendList里找出最高优先级的重传序号,以根据该重传序号在SendList里找到需要重传的数据包发送,实现重传。在ResendList里没有需要重传的序号的情况下,可以从业务层获取一个发送单元对应的单元数据包来发送。
可见,本申请实施例通过引入拥塞控制算法和自主设计的丢包重传逻辑,避免出现网络拥堵和超大延时的情况,将UDP的发送变的更加高效和可靠,从而可以在恶略网络条件下保证传输效率;并可通过分层概念实现优先级和传输的分离,进而可以尽快地完成优先级最高的指令消息的传输,保证更重要的消息能够尽快传输,进而提升传输质量。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。
参照图6,示出了本申请实施例中的一种消息传输装置的结构框图,该消息传输装置可以包括指令消息提取模块610、指令消息拆分模块620、数据包生成模块630及数据包发送模块640。
指令消息提取模块610,设置为从网络应用的消息队列中提取待发送指令消息,其中,所述待发送指令消息为所述消息队列中优先级最高的原始指令消息。
指令消息拆分模块620,设置为将所述待发送指令消息拆分为发送单元。
数据包生成模块630,设置为依据所述发送单元生成单元数据包。
数据包发送模块640,设置为依据预设的用户数据报协议UDP,发送所述单元数据包。
在一实施例中,上述消息传输装置应用于发送端,所述发送端包含传输层和业务层;上述指令消息提取模块和指令消息拆分模块可以集成在业务层中,数据包生成模块和数据包发送模块可以集成在业务层中。此外,上述消息传输装置还包括模块:重传队列检测模块和重传模块,且该重传队列检测模块和重传模块均可以集成在传输层中。其中,重传队列检测模块,设置为检测重传队列是否为空队列;在所述重传队列为空队列的情况下,触发业务层中的指令消息提取模块610执行所述从网络应用的消息队列中提取待发送指令消息的步骤;在所述重传队列存有重传序号的情况下,触发重传模块从所述重传队列中提取目标重传序号,所述目标重传序号为所述重传队列中优先级最高的重传序号。重传模块,设置为从已发送队列中,提取所述目标重传序号对应的已发送数据包;并触发所述数据包发送模块重发所述已发送数据包。
例如,重传队列检测模块可以在指令消息提取模块610从消息队列中提取待发送指令消息之前,检测重传队列是否为空队列;在重传队列为空队列的情况下,可以触发指令消息提取模块610执行从消息队列中提取优先级最高的待发送指令消息,以实现优先级最高的指令消息的快速传输;在重传队列存有重传序号,即在重传队列不是空队列的情况下,可以触发重传模块从该重传队列中提取优先级最高的目标重传序号,以便能够快速实现优先级最高的消息的重传,从而保证最重要的消息能尽快传输,提高传输效果。
在一实施例中,上述消息传输装置还包括网络检测模块和可发送包数量确定模块。
网络检测模块,设置为测检网络应用对应的瓶颈带宽和数据包的往返时延。
可发送包数量确定模块,设置为依据所述瓶颈带宽和所述往返时延,确定可发送包数量;在所述可发送包数量为大于零的整数的情况下,触发上述重传队列检测模块检测所述重传队列是否为空队列。
例如,重传队列检测模块检测重传队列是否为空队列之前,网络检测模块可以测检网络应用对应的瓶颈带宽和数据包的往返时延,使得可发送包数量确定模块可以依据该网络检测模块检测到网络应用当前对应的瓶颈带宽和数据包的往返时延,确定网络应用的可发送包数量,并可在可发送包数量为大于零的整数的情况下,触发重传队列检测模块检测重传队列是否为空队列,以在重传队列为空队列的情况下,依据网络应用的待发送指令消息进行消息传输,或者,在重传队列不是空队列的情况下,依据该重传队列中存放的重传序号进行消息 传输。
本申请一实施例的消息传输装置还可以包括:确认数据包接收模块、丢包序号确定模块和重传队列模块。确认数据包接收模块、丢包序号确定模块和重传队列模块均可以集成在在传输层中。,确认数据包接收模块,设置为接收确认数据包,其中,所述确认数据包携带有确认序号;丢包序号确定模块,设置为依据所述确认序号确定丢包序号;重传队列模块,设置为将所述丢包序号添加到所述重传队列中,以作为重传序号。
在本申请的一个实施例中,上述消息传输装置还可以包括:已发送队列模块和确认序号检测模块。已发送队列模块和确认序号检测模块也可以集成在传输层中。其中,已发送队列模块可以设置为将所述单元数据包添加到已发送队列中,以将所述单元数据包记录为已发送数据包,如可以在数据包发送模块640发送单元数据包之后,将该数据包发送模块640发送的单元数据包添加到已发送队列中,以将该单元数据包记录为已发送数据包。确认序号检测模块可以设置为检测所述确认序号是否属于所述已发送数据包的连续序号;在所述确认序号属于所述已发送数据包的连续序号的情况下,触发已发送队列模块从已发送队列中删除所述确认序号对应的已发送数据包;在所述确认序号不属于所述已发送数据包的连续序号的情况下,可以触发丢包序号确定模块执行依据所述确认序号确定丢包序号的步骤。例如,在确认数据包接收模块接收确认数据包之后,确认序号检测模块可以检测该确认数据包接收模块当前所接收到确认序号是否属于已发送数据包的连续序号;在所述确认序号属于已发送数据包的连续序号的情况下,可以触发已发送队列模块从已发送队列中删除所述确认序号对应的已发送数据包;在确认序号不属于已发送数据包的连续序号的情况下,触发丢包序号确定模块执行依据所述确认序号确定丢包序号的步骤。
本申请一实施例中,在所述确认序号属于已发送数据包的连续序号的情况下,重传队列模块还设置为从所述重传队列中删除与所述确认序号相同的重传序号。
在本申请的一个实施例中,上述消息传输装置还可以包括:发送时间检测模块。该时间检测模块,可以集成在传输层中,设置为检测当前时间是否在已发送数据包对应的发送时间范围内;在当前时间在所述发送时间范围内的情况下,可以触发数据包发送模块重发所述已发送数据包的步骤;在所述当前时间超出所发送时间范围的情况下,触发已发送队列模块从所述已发送队列中删除所述已发送数据包,并可触发重传队列模块从所述重传队列中删除所述目标重传序号。
例如,在数据包发送模块重发所述已发送数据包之前,时间检测模块可以检测当前时间是否在所述已发送数据包对应的发送时间范围内;在当前时间在 所述发送时间范围内的情况下,可以触发数据包发送模块重发所述已发送数据包的步骤;在所述当前时间超出所发送时间范围的情况下,触发已发送队列模块从所述已发送队列中删除所述已发送数据包,并可触发重传队列模块从所述重传队列中删除所述目标重传序号。
本申请一实施例的单元数据包携带有所述发送单元对应的指令信息和关联包信息,所述关联包信息可以用于确定所述单元数据包的关联数据包。
在一实施例中,上述消息传输装置可以集成在作为发送端的设备中。该设备可以是至少两个物理实体构成,也可以是一个物理实体构成,如设备可以是个人计算机(Personal Computer,PC)、电脑、手机、平板设备、个人数字助理、服务器、消息收发设备、游戏控制台等。
本申请实施例还提供一种设备,包括:处理器和存储器。存储器中存储有至少一条指令,且指令由所述处理器执行,使得所述设备执行如上述方法实施例中发送端的消息传输方法。
参照图7,示出了本申请一个示例中的一种设备的结构示意图。如图7所示,该设备可以包括:处理器70、存储器71、具有触摸功能的显示屏72、输入装置73、输出装置74以及通信装置75。该设备中处理器70的数量可以是至少一个,图7中以一个处理器70为例。该设备中存储器71的数量可以是至少一个,图7中以一个存储器71为例。该设备的处理器70、存储器71、显示屏72、输入装置73、输出装置74以及通信装置75可以通过总线或者其他方式连接,图7中以通过总线连接为例。
存储器71作为一种计算机可读存储介质,设置为存储软件程序、计算机可执行程序以及模块,如本申请任意实施例所述的消息传输方法对应的程序指令/模块(例如,上述消息传输装置中的指令消息提取模块610、指令消息拆分模块620、数据包生成模块630以及数据包发送模块640等)。存储器71可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作装置、至少一个功能所需的应用程序;存储数据区可存储根据设备的使用所创建的数据等。此外,存储器71可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器71可包括相对于处理器70远程设置的存储器,这些远程存储器可以通过网络连接至设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
显示屏72为具有触摸功能的显示屏72,其可以是电容屏、电磁屏或者红外屏。一般而言,显示屏72设置为根据处理器70的指示显示数据,还设置为接收作用于显示屏72的触摸操作,并将相应的信号发送至处理器70或其他装置。在一实施例中,在显示屏72为红外屏的情况下,显示屏72还包括红外触摸框, 该红外触摸框设置在显示屏72的四周,显示屏72还可以设置为接收红外信号,并将该红外信号发送至处理器70或者其他设备。
通信装置75,设置为与其他设备建立通信连接,其可以是有线通信装置或无线通信装置中至少一种。
输入装置73接收输入的数字或者字符信息,以及产生与设备的用户设置以及功能控制有关的键信号输入,还可以设置为获取图像的摄像头以及获取音频数据的拾音设备。输出装置74可以包括扬声器等音频设备。需要说明的是,输入装置73和输出装置74的组成可以根据实际情况设定。
处理器70通过运行存储在存储器71中的软件程序、指令以及模块,从而执行设备的各种功能应用以及数据处理,以实现上述消息传输方法。
在一实施例中,处理器70执行存储器71中存储的至少一个程序时,实现如下操作:从网络应用的消息队列中提取待发送指令消息,其中,所述待发送指令消息为所述消息队列中优先级最高的原始指令消息;将所述待发送指令消息拆分为发送单元;依据所述发送单元生成单元数据包;依据预设的用户数据报协议UDP,发送所述单元数据包。
本申请实施例还提供一种计算机可读存储介质,所述存储介质中的指令由设备的处理器执行时,使得设备能够执行如上述方法实施例所述的消息传输方法。示例性的,该消息传输方法包括:从网络应用的消息队列中提取待发送指令消息,其中,所述待发送指令消息为所述消息队列中优先级最高的原始指令消息;将所述待发送指令消息拆分为发送单元;依据所述发送单元生成单元数据包;依据预设的用户数据报协议UDP,发送所述单元数据包。
参照图8,示出了本申请实施例中的另一种消息传输装置的结构框图。该消息传输装置可以包括数据包接收模块810、指令消息合成模块820。
数据包接收模块810,设置为依据预设的用户数据报协议UDP,接收单元数据包,其中,所述单元数据包为网络应用依据发送单元生成,所述发送单元为所述网络应用通过拆分原始指令消息得到。
指令消息合成模块820,设置为依据所述单元数据包合成所述原始指令消息。
在本申请的一个实施例中,上述另一种消息传输装置可以应用于接收端中,所述接收端包含传输层和业务层;其中,数据包接收模块810可以集成在传输层中;指令消息合成模块820可以集成在业务层。此外,集成在业务层中的指令消息合成模块820可以包括数据包读取子模块、关联数据包确定子模块及消息合成子模块。
数据包读取子模块,设置为读取所述单元数据包中携带的关联包信息。
关联数据包确定子模块,设置为依据所述关联包信息确定所述单元数据包的关联数据包。
消息合成子模块,设置为基于所述单元数据包中携带的指令信息和所述关联数据包中携带的指令信息,合成所述原始指令消息。
在一实施例中,应用于接收端中的消息传输装置还可以包括:确认序号模块、确认数据包生成模块以及确认数据包发送模块。确认序号模块、确认数据包生成模块以及确认数据包发送模块均可以集成在接收端的传输层中。其中,确认序号模块,设置为将所述单元数据包中携带的序号作为确认序号;确认数据包生成模块,设置为依据所述确认序号生成所述单元数据包对应的确认数据包;确认数据包发送模块,设置为发送所述确认数据包。
例如,在数据包接收模块810接收单元数据包之后,确认序号模块可以将该数据包接收模块810接收到的单元数据包所携带的序号作为确认序号,使得确认数据包生成模块可以依据确认序号生成对应的确认数据包,随后可以通过确认数据包发送模块将确认数据包发送给发送端,以通知发送端该单元数据包已成功发送。
本申请实施例提供的消息传输装置可以集成在作为接收端的设备中。该设备可以是至少两个物理实体构成,也可以是一个物理实体构成,如设备可以是个人计算机(Personal Computer,PC)、电脑、手机、平板设备、个人数字助理、服务器、消息收发设备、游戏控制台等。
本申请实施例还提供一种设备,包括:处理器和存储器。存储器中存储有至少一条指令,且指令由所述处理器执行,使得所述设备执行如上述方法实施例中接收端的消息传输方法。示例性的,处理器执行存储器中存储的至少一个程序时,实现如下操作:依据预设的用户数据报协议UDP,接收单元数据包,其中,所述单元数据包为网络应用依据发送单元生成,所述发送单元为所述网络应用通过拆分原始指令消息得到;依据所述单元数据包合成所述原始指令消息。
本申请实施例还提供一种计算机可读存储介质,所述存储介质中的指令由设备的处理器执行时,使得设备能够执行如上述方法实施例中接收端的消息传输方法。示例性的,依据预设的用户数据报协议UDP,接收单元数据包,其中,所述单元数据包为网络应用依据发送单元生成,所述发送单元为所述网络应用通过拆分原始指令消息得到;依据所述单元数据包合成所述原始指令消息。
可见,本申请实施例提供的设备、装置执行本申请任意实施例所提供的消息传输方法。
需要说明的是,对于装置、设备、存储介质实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到, 本申请可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是机器人,个人计算机,服务器,或者网络设备等)执行本申请任意实施例所述的消息传输方法。
值得注意的是,上述消息传输装置中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的名称也只是为了便于相互区分,并不用于限制本申请的保护范围。
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行装置执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的至少一个实施例或示例中以合适的方式结合。

Claims (17)

  1. 一种消息传输方法,包括:
    从网络应用的消息队列中提取待发送指令消息,其中,所述待发送指令消息为所述消息队列中优先级最高的原始指令消息;
    将所述待发送指令消息拆分为发送单元;
    依据所述发送单元生成单元数据包;
    依据预设的用户数据报协议UDP,发送所述单元数据包。
  2. 根据权利要求1所述的方法,应用于发送端,所述发送端包含传输层和业务层;
    所述业务层,设置为从网络应用的消息队列中提取待发送指令消息,并将所述待发送指令消息拆分为发送单元;
    所述传输层,设置为依据所述发送单元生成单元数据包,并依据预设的用户数据报协议UDP发送所述单元数据包;
    其中,在所述业务层从网络应用的消息队列中提取待发送指令消息之前,所述方法还包括:
    所述传输层检测重传队列是否为空队列;在所述重传队列存有重传序号的情况下,从所述重传队列中提取目标重传序号,并从已发送队列中提取所述目标重传序号对应的已发送数据包,重发所述已发送数据包,所述目标重传序号为所述重传队列中优先级最高的重传序号;在所述重传队列为空队列的情况下,触发所述业务层从所述消息队列中提取待发送指令消息。
  3. 根据权利要求2所述的方法,所述检测重传队列是否为空队列之前,还包括:
    检测网络应用对应的瓶颈带宽和数据包的往返时延;
    依据所述瓶颈带宽和所述往返时延,确定可发送包数量;
    在所述可发送包数量为大于零的整数的情况下,检测重传队列是否为空队列。
  4. 根据权利要求2或3所述的方法,还包括:
    所述传输层接收确认数据包,其中,所述确认数据包携带有确认序号;
    依据所述确认序号确定丢包序号;
    将所述丢包序号添加到重传队列中,以作为重传序号。
  5. 根据权利要求4所述的方法,在所述传输层发送所述单元数据包之后,还包括:将所述单元数据包添加到所述已发送队列中,以将所述单元数据包记录为已发送数据包;
    在所述传输层接收确认数据包之后,还包括:检测所述确认序号是否属于所述已发送数据包的连续序号;在所述确认序号属于所述已发送数据包的连续序号的情况下,从所述已发送队列中删除所述确认序号对应的已发送数据包; 在所述确认序号不属于所述已发送数据包的连续序号的情况下,依据所述确认序号确定丢包序号,将所述丢包序号添加到重传队列中,以作为重传序号。
  6. 根据权利要求5所述的方法,在所述确认序号属于所述已发送数据包的连续序号的情况下,所述方法还包括:
    从所述重传队列中删除与所述确认序号相同的重传序号。
  7. 根据权利要求2或3所述的方法,在所述传输层重发所述已发送数据包之前,还包括:
    检测当前时间是否在所述已发送数据包对应的发送时间范围内;
    在当前时间在所述发送时间范围内的情况下,重发所述已发送数据包;
    在所述当前时间超出所发送时间范围的情况下,从所述已发送队列中删除所述已发送数据包,并从所述重传队列中删除所述目标重传序号。
  8. 根据权利要求1至3任一项所述的方法,其中,所述单元数据包携带有所述发送单元对应的指令信息和关联包信息,所述关联包信息用于确定所述单元数据包的关联数据包。
  9. 一种消息传输方法,包括:
    依据预设的用户数据报协议UDP,接收单元数据包,其中,所述单元数据包为网络应用依据发送单元生成,所述发送单元为所述网络应用通过拆分原始指令消息得到;
    依据所述单元数据包合成所述原始指令消息。
  10. 根据权利要求9所述的方法,应用于接收端,所述接收端包含传输层和业务层;
    所述传输层,设置为依据预设的用户数据报协议UDP接收所述单元数据包;
    所述业务层,设置为依据所述单元数据包合成所述原始指令消息;
    其中,所述业务层依据所述单元数据包合成所述原始指令消息包括:读取所述单元数据包中携带的关联包信息;依据所述关联包信息确定所述单元数据包的关联数据包;基于所述单元数据包中携带的指令信息和所述关联数据包中携带的指令信息,合成所述原始指令消息。
  11. 根据权利要求9或10所述的方法,在接收单元数据包之后,还包括:
    将所述单元数据包中携带的序号作为确认序号;
    依据所述确认序号生成所述单元数据包对应的确认数据包;
    发送所述确认数据包。
  12. 一种消息传输装置,包括:指令消息提取模块、指令消息拆分模块、数据包生成模块及数据包发送模块;
    指令消息提取模块,设置为从网络应用的消息队列中提取待发送指令消息,其中,所述待发送指令消息为所述消息队列中优先级最高的原始指令消息;
    指令消息拆分模块,设置为将所述待发送指令消息拆分为发送单元;
    数据包生成模块,设置为依据所述发送单元生成单元数据包;
    数据包发送模块,设置为依据预设的用户数据报协议UDP,发送所述单元数据包。
  13. 一种设备,包括:处理器和存储器;
    所述存储器中存储有至少一条指令,所述指令由所述处理器执行,使得所述设备执行如权利要求1至8任一项所述的消息传输方法。
  14. 一种计算机可读存储介质,所述存储介质中的指令由设备的处理器执行时,使得所述设备能够执行如权利要求1至8任一项所述的消息传输方法。
  15. 一种消息传输装置,包括:数据包接收模块及指令消息合成模块;
    数据包接收模块,设置为依据预设的用户数据报协议UDP,接收单元数据包,其中,所述单元数据包为网络应用依据发送单元生成,所述发送单元为所述网络应用通过拆分原始指令消息得到;
    指令消息合成模块,设置为依据所述单元数据包合成所述原始指令消息。
  16. 一种设备,包括:处理器和存储器;
    所述存储器中存储有至少一条指令,所述指令由所述处理器执行,使得所述设备执行如权利要求9至11任一项所述的消息传输方法。
  17. 一种计算机可读存储介质,所述存储介质中的指令由设备的处理器执行时,使得所述设备能够执行如权利要求9至11任一项所述的消息传输方法。
PCT/CN2019/116527 2018-12-13 2019-11-08 一种消息传输方法、装置、设备及介质 WO2020119347A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811526715.5A CN109379386A (zh) 2018-12-13 2018-12-13 一种消息传输方法、装置、设备及介质
CN201811526715.5 2018-12-13

Publications (1)

Publication Number Publication Date
WO2020119347A1 true WO2020119347A1 (zh) 2020-06-18

Family

ID=65373687

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116527 WO2020119347A1 (zh) 2018-12-13 2019-11-08 一种消息传输方法、装置、设备及介质

Country Status (2)

Country Link
CN (1) CN109379386A (zh)
WO (1) WO2020119347A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109379386A (zh) * 2018-12-13 2019-02-22 广州市百果园信息技术有限公司 一种消息传输方法、装置、设备及介质
CN110031722B (zh) * 2019-04-03 2021-08-31 郑州轨道交通信息技术研究院 一种实时故障报告粘连的处理方法及其装置
CN112398744A (zh) * 2019-08-16 2021-02-23 阿里巴巴集团控股有限公司 网络通信方法、装置及电子设备
CN111901252A (zh) * 2020-06-16 2020-11-06 北京瀚诺半导体科技有限公司 一种网络管理消息的传输方法及系统
CN112162875A (zh) * 2020-10-12 2021-01-01 上交所技术有限责任公司 一种交易系统内部高可靠消息传输方法
CN115550466A (zh) * 2022-11-30 2022-12-30 海的电子科技(苏州)有限公司 点屏数据通信方法、点屏系统和储存介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070273923A1 (en) * 2006-05-29 2007-11-29 Canon Kabushiki Kaisha Information processing apparatus, print controlling method, program, and computer-readable storage medium
CN101202604A (zh) * 2007-08-14 2008-06-18 深圳市同洲电子股份有限公司 一种网络数据的发送与接收方法、系统及设备
CN102025651A (zh) * 2010-06-04 2011-04-20 西本新干线股份有限公司 应用于企业服务总线的事件驱动方法
CN103414692A (zh) * 2013-07-15 2013-11-27 北京控制工程研究所 一种基于优先级的高实时航天器数据传输方法
CN103796182A (zh) * 2014-02-28 2014-05-14 杭州东信北邮信息技术有限公司 一种消息发送系统和方法
CN109379386A (zh) * 2018-12-13 2019-02-22 广州市百果园信息技术有限公司 一种消息传输方法、装置、设备及介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436978A (zh) * 2007-11-15 2009-05-20 盛乐信息技术(上海)有限公司 使用udp协议进行可靠数据传输的方法
CN101854286B (zh) * 2009-04-01 2012-09-05 北京大学 基于用户数据报协议的数据流发送、接收方法及装置
CN102137027B (zh) * 2011-05-03 2013-07-31 厦门市美亚柏科信息股份有限公司 数据的可靠传输方法和装置
CN103259771B (zh) * 2012-02-20 2018-01-23 腾讯科技(深圳)有限公司 一种网络应用的互动方法及装置
US9992126B1 (en) * 2014-11-07 2018-06-05 Speedy Packets, Inc. Packet coding based network communication
CN105791154B (zh) * 2014-12-26 2019-05-24 浙江大华技术股份有限公司 一种基于udp的数据传输方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070273923A1 (en) * 2006-05-29 2007-11-29 Canon Kabushiki Kaisha Information processing apparatus, print controlling method, program, and computer-readable storage medium
CN101202604A (zh) * 2007-08-14 2008-06-18 深圳市同洲电子股份有限公司 一种网络数据的发送与接收方法、系统及设备
CN102025651A (zh) * 2010-06-04 2011-04-20 西本新干线股份有限公司 应用于企业服务总线的事件驱动方法
CN103414692A (zh) * 2013-07-15 2013-11-27 北京控制工程研究所 一种基于优先级的高实时航天器数据传输方法
CN103796182A (zh) * 2014-02-28 2014-05-14 杭州东信北邮信息技术有限公司 一种消息发送系统和方法
CN109379386A (zh) * 2018-12-13 2019-02-22 广州市百果园信息技术有限公司 一种消息传输方法、装置、设备及介质

Also Published As

Publication number Publication date
CN109379386A (zh) 2019-02-22

Similar Documents

Publication Publication Date Title
WO2020119347A1 (zh) 一种消息传输方法、装置、设备及介质
US10715282B2 (en) Method and related device for improving TCP transmission efficiency using delayed ACK
WO2018121294A1 (zh) 一种报文传输方法、终端、网络设备及通信系统
CN106612284B (zh) 一种流数据的传输方法和装置
US10798199B2 (en) Network traffic accelerator
US20230083441A1 (en) Managing subpacket transmission and reception for advanced interactive services
WO2018082615A1 (zh) 一种发送报文的方法、装置、芯片及终端
WO2009021417A1 (fr) Procédé, système et dispositif de transmission et de réception de données de réseau
EP3322145A1 (en) Method, server side and system for computing bandwidth of network transmission of streaming media
CN110830460B (zh) 一种连接建立方法、装置、电子设备及存储介质
CN106304203A (zh) 数据传输方法及装置
KR102046792B1 (ko) 송신 노드로부터 목적지 노드로의 데이터 전송 방법
CN105162706B (zh) 组播传输方法、装置及系统
US20230071243A1 (en) Conserving network resources during transmission of packets of interactive services
WO2020147453A1 (zh) 数据传输方法及相关装置
WO2019128964A1 (zh) 一种实现丢包检测的方法、装置和系统
EP3235210A1 (en) Methods and first network node for managing a stream control transmission protocol association
WO2017097201A1 (zh) 一种数据传输方法、发送装置及接收装置
EP2355416A1 (en) Communication apparatus and communication method
WO2023179538A1 (zh) 数据传输方法、装置、电子设备和存储介质
WO2023078222A1 (zh) 数据传输方法、装置、设备和介质
EP3672189B1 (en) Data transmission method, device and system
CN113301398B (zh) 信息处理方法及系统、服务端设备、客户端设备
CN115348336A (zh) 异构数据流的通用传输架构
CN113300971A (zh) 数据处理系统及方法

Legal Events

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

Ref document number: 19896024

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19896024

Country of ref document: EP

Kind code of ref document: A1