WO2013163908A1 - Data packet transmission method and device - Google Patents

Data packet transmission method and device Download PDF

Info

Publication number
WO2013163908A1
WO2013163908A1 PCT/CN2013/072567 CN2013072567W WO2013163908A1 WO 2013163908 A1 WO2013163908 A1 WO 2013163908A1 CN 2013072567 W CN2013072567 W CN 2013072567W WO 2013163908 A1 WO2013163908 A1 WO 2013163908A1
Authority
WO
WIPO (PCT)
Prior art keywords
request message
transmission speed
data packet
server
response
Prior art date
Application number
PCT/CN2013/072567
Other languages
French (fr)
Chinese (zh)
Inventor
殷佳欣
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2013163908A1 publication Critical patent/WO2013163908A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/24Negotiation of communication capabilities

Definitions

  • the present invention relates to communications technologies, and in particular, to a data packet transmission method and device. Background technique
  • the Constrained Application Protocol is a lightweight and compact communication protocol proposed by the Internet Engineering Task Force (IETF) CoRe (Constrained RESTful Environment) working group.
  • the application scenario is transmitted in a restricted environment.
  • the restricted environment mainly includes two aspects: restricted network and restricted node.
  • a restricted network usually refers to a network with low bandwidth and high packet loss rate or unstable environment.
  • a restricted node usually refers to a central processing unit (CPU) with limited processing capacity or low memory.
  • the BLOCK transmission mode In the CoAP protocol, when a large resource needs to be transmitted, the BLOCK transmission mode is used. This transmission method slices large resources and then transmits the slices one by one.
  • the traditional BLOCK transmission method uses the one-to-one method. Each time a client sends a request, it must wait for the server (Server) to return a response (ACK) before proceeding to the next packet request. Otherwise wait, retransmit after timeout. This type of transmission wastes a lot of time on waiting and network delay, and is not an efficient transmission method.
  • Embodiments of the present invention provide a method and apparatus for transmitting data packets to improve transmission efficiency.
  • An embodiment of the present invention provides a data packet transmission method, where the data packet transmission method is based on a CoAP protocol, and includes:
  • the terminal sends a first request message to the first node, where the first request message carries the first request transmission speed information, and the first node is a server or an intermediate node;
  • An embodiment of the present invention provides a method for transmitting a data packet, where the data packet transmission method is based on a CoAP protocol, and includes:
  • the server receives the request message sent by the second node, where the request message carries the request transmission speed information, and the second node is a terminal or an intermediate node;
  • the server generates a response corresponding to the request message according to the feedback transmission speed information, and sends a response corresponding to the request message to the second node.
  • An embodiment of the present invention provides a method for transmitting a data packet, where the data packet transmission method is based on a CoAP protocol, and includes:
  • the intermediate node receives the first request message sent by the terminal, where the first request message carries the first request transmission speed information
  • the intermediate node Determining, by the intermediate node, whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the first request transmission speed information as the requested transmission speed information of the relay, if No, generating a request transmission speed information indicating that the intermediate node can accept the transmission speed as the transit; And the intermediate node replaces the requested transmission speed information of the relay with the first request transmission speed information in the first request message, and forwards, to the server, a request message for relaying that carries the requested transmission speed information of the relay.
  • An embodiment of the present invention provides a terminal, including:
  • a request message sending unit configured to send a first request message to the first node, where the first request message carries first request transmission speed information, where the first node is a server or an intermediate node;
  • a response processing unit configured to receive a response sent by the first node, and obtain first feedback transmission speed information in a response of the first request message, so that the request message sending unit is configured according to the first feedback transmission speed
  • the transmission speed indicated by the information is sent to the first node, where the first feedback transmission speed information is used to indicate a transmission speed that the first node can accept, and the second request message carries The second request transmits speed information.
  • An embodiment of the present invention provides a server, including:
  • a first request receiving unit configured to receive a request message sent by the second node, where the request message carries request transmission speed information, the second node is a terminal or an intermediate node, and the first determining unit is configured to determine Whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server, and if yes, using the requested transmission speed information as feedback transmission speed information, and if not, generating to indicate that the server can receive Transmission speed as feedback transmission speed information;
  • a first response unit configured to generate a response corresponding to the request message according to the feedback transmission speed information, and send a response corresponding to the request message to the second node.
  • An embodiment of the present invention provides an intermediate node, including:
  • a first proxy receiving unit configured to receive a first request message sent by the terminal, where the first request message carries first request transmission speed information
  • a second determining unit configured to determine whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the first request transmission speed information as a request transmission speed of the relay Information, if not, generating request transmission speed information indicating that the intermediate node can accept the transmission speed as the transit;
  • An embodiment of the present invention provides a data packet transmission method, where the data packet transmission method is based on a CoAP protocol, and includes:
  • the terminal sends a communication request message generated by the terminal to the server, where the communication request message carries the first data packet request indication information or the first response interval indication information, where the first data packet request indication information indicates at least two Data packet information obtained by the server, the first response interval indication information is used to indicate that the server responds after receiving at least two data packets;
  • An embodiment of the present invention provides a method for transmitting a data packet, where the data packet transmission method is based on a CoAP protocol, and includes:
  • the server receives the communication request message sent by the terminal, where the request message carries the data packet request indication information or the response interval indication information, where the data packet request indication information is specifically at least two data packet information acquired by the server.
  • the response interval indication information is used to indicate that the server responds after receiving at least two data packets;
  • the server parses the communication request message, obtains the indication information in the request message, and returns a response to the terminal according to the indication information.
  • An embodiment of the present invention provides a terminal, including:
  • a first requesting unit configured to send, to the server, a communication request message generated by the terminal, where the communication request message carries first data packet request indication information or first response interval indication information, the first data packet
  • the request indication information indicates at least two pieces of data packet information acquired by the server, where the first response interval indication information is used to indicate that the server responds after receiving at least two data packets;
  • a response receiving unit configured to receive a response sent by the server corresponding to the communication request message.
  • An embodiment of the present invention provides a server, including:
  • a second request receiving unit configured to receive a communication request message sent by the terminal, where the request message carries data packet request indication information or response interval indication information, where the data packet request indication information is specifically at least two directions Decoding the packet information obtained by the server, where the response interval indication information is used to indicate that the server responds after receiving at least two data packets;
  • a second response unit configured to parse the communication request message, obtain indication information in the request message, and return a response to the terminal according to the indication information.
  • the terminal sends the first request message to the first node. Receiving a response corresponding to the first request message sent by the first node, acquiring first feedback transmission speed information in the response of the first request message, and sending the second request to the first node according to the transmission speed indicated by the first feedback transmission speed information Message.
  • the transmission speed can be requested from the server or the intermediate node, and the intermediate node and the server can also modify the request transmission speed information according to the transmission speed that can be accepted by itself, and feedback to the terminal, the terminal and the intermediate node.
  • the server implements speed negotiation, which can ensure that each node in the transmission path maintains the highest transmission efficiency, realizes fast data transmission, and improves transmission efficiency.
  • the terminal sends a communication request message generated by the terminal to the server, where the communication request message carries the first data packet request indication information or the first response interval indication information, and the first data packet
  • the request indication information indicates at least two pieces of data packet information acquired by the server, and the first response interval indication information is used to indicate that the server responds after receiving at least two data packets.
  • FIG. 1 is a flowchart of a method for transmitting a first data packet according to an embodiment of the present invention
  • FIG. 2 is a signaling diagram of a method for transmitting a data packet according to an embodiment of the present invention
  • FIG. 3 is a signaling diagram of another method for transmitting a data packet according to an embodiment of the present invention
  • FIG. 4 is a second type of data packet transmission according to an embodiment of the present invention
  • FIG. 5 is a flowchart of a method for transmitting a third data packet according to an embodiment of the present invention
  • FIG. 6 is a flowchart of a method for transmitting a fourth data packet according to an embodiment of the present invention
  • FIG. 7b is a schematic structural diagram of a second terminal according to an embodiment of the present disclosure
  • FIG. 8 is a schematic structural diagram of a third terminal according to an embodiment of the present disclosure.
  • FIG. 8b is a schematic structural diagram of a fourth terminal according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of a first server according to an embodiment of the present disclosure.
  • FIG. 9b is a schematic structural diagram of a second server according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a first intermediate node according to an embodiment of the present invention.
  • FIG. 10b is a schematic structural diagram of a second intermediate node according to an embodiment of the present invention.
  • FIG. 11 is a flowchart of a method for transmitting a data packet according to an embodiment of the present invention.
  • FIG. 12 is a flowchart of another method for transmitting a data packet according to an embodiment of the present invention
  • FIG. 13 is a signaling diagram of still another method for transmitting a data packet according to an embodiment of the present invention
  • FIG. 14 is a schematic structural diagram of a fifth terminal according to an embodiment of the present disclosure.
  • FIG. 15 is a schematic structural diagram of a third server according to an embodiment of the present disclosure.
  • FIG. 16 is a flowchart of a transmission process according to an embodiment of the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • the terminal in the embodiment of the present invention can be used as a terminal or as an intermediate node for various terminal devices, such as mobile phones, computers, PDAs, notebook computers, remote controllers, household appliances, various instruments, sensors, and the like.
  • the server of the embodiment of the present invention may be various computer devices having processors.
  • FIG. 1 is a flowchart of a method for transmitting a first data packet according to an embodiment of the present invention.
  • the data transmission process between the terminal and the server in the network of FIG. 1 can also be applied to a data transmission process in which a multi-hop environment in which at least one intermediate node is set as a proxy between the terminal and the server is applied.
  • the method for transmitting a data packet specifically includes: Step C10: The terminal sends a first request message to the first node, where the first request message carries the first request transmission speed information, where the first node is a server or an intermediate node; Step C20, the terminal receives Receiving, by the first node, the first feedback transmission speed information in the response of the first request message, and sending the second request to the first node according to the transmission speed indicated by the first feedback transmission speed information The message, where the first feedback transmission speed information is used to indicate a transmission speed that the first node can accept, and the second request message carries the second request transmission speed information.
  • the first node in this embodiment is a server or an intermediate node, and the terminal can directly communicate with the server, or can perform data forwarding through the intermediate node to implement communication with the server.
  • the first request message REQ or the second request message REQ sent by the terminal may include a GET request message and a PUT/POST request message, the GET request message is used to request data from the server, and the PUT/POST request message is used to push data to the server.
  • the message body of the request message of the CoAP protocol usually includes three parts: Header, Option, and Payload, where the Header part indicates the type of the message, the message id, the number of options, and the like.
  • the Option section is the other extensible metadata part of the message.
  • Payload is the payload part of the message.
  • the CoAP protocol indicates that the message is part of the BLOCK transmission by having two Options BL0CK1 and BL0CK2 in the Option section.
  • the BL0CK2 Option is used to make the server carry data in the response ACK.
  • the data is pushed to the service through the BL0CK1 Option.
  • the first node in this embodiment is a server.
  • the terminal directly sends the first request message or the second request message to the server, where the first request message carries the first request transmission speed information, and the setting manner of the first request transmission speed information may specifically be:
  • a new Option is added in part.
  • the Option name can be SendSpeed, which is used to indicate the requested transmission speed.
  • the transmission speed can be expressed by absolute speed, for example, 1 packet/s.
  • the SendSpeed Option is only valid during the BLOCK transmission.
  • the server When the server receives the first request message, parsing the first request message, obtaining the first transmission speed information in the first request message, and determining whether the transmission speed indicated by the parsed first request transmission speed information is The transmission speed that can be accepted by itself, if yes, the first request transmission speed information is used as feedback transmission speed information, and if not, generating feedback transmission speed information indicating the transmission speed that the server can receive, and according to the feedback transmission speed information Generate a response and send the response to the terminal.
  • the server may obtain the parameter information of the server itself, and determine the currently acceptable transmission speed according to the parameter information of the self. For example, the server may determine according to the idle time of the central processing unit. It can also be determined by the memory margin, and can also be determined by the bandwidth occupation information or the remaining storage space. Different servers can select different methods of their own capability metrics according to their own capabilities, which is not limited to this embodiment.
  • the server may generate a response according to the feedback transmission speed information, and may add a new Option in the Option part of the response, and the Option name may be a SendSpeed, which is used to indicate a transmission speed acceptable to the server, and the transmission speed may also be absolute. Speed to indicate.
  • the terminal receives the response sent by the server, parses the response, and obtains feedback transmission speed information in the response. If the transmission speed indicated by the feedback transmission speed information is the same as the transmission speed indicated by the first request transmission speed information in the first request message sent to the server, indicating that the server can accept the transmission speed of the request, the terminal will send the server to the server. The transmission speed is adjusted to the transmission speed indicated by the feedback transmission speed information.
  • the server cannot accept the transmission speed of the request, and the feedback transmission
  • the transmission speed indicated by the speed information is a transmission speed acceptable to the server, and the terminal adjusts the transmission speed to the server to the transmission speed indicated by the feedback transmission speed information.
  • the terminal sends a second request message to the server by using the adjusted transmission speed, where the second request message carries the second request transmission speed information.
  • the transmission speed indicated by the second request transmission speed information may be greater than the transmission speed of the first request message request.
  • the transmission speed indicated by the second request transmission speed information may be equal to or slightly larger than the transmission speed of the first request message request. Since the transfer speed that the server can accept varies with the processing of the server itself, even if the server cannot accept the transmission speed of the first request message request, the request may be equal to or slightly larger than the first request in the second request message. The transmission speed of the message request, in order to adjust the transmission speed of the terminal in time when the server can accept the transmission speed, so as to fully utilize the processing capability of the server.
  • Embodiment 2 The first node in this embodiment is an intermediate node.
  • the first request message sent by the terminal is forwarded to the server through the intermediate node, and the response sent by the server is sent to the terminal through the intermediate node.
  • the terminal sends a first request message, where the first request message carries the first request transmission speed information, and the setting manner of the first request transmission speed information is specifically the same as the foregoing embodiment.
  • the intermediate node receives the first request message, parsing the first request message, acquiring the first request transmission speed information in the first request message, and determining whether the transmission speed indicated by the first request transmission speed information is the intermediate node
  • the acceptable transmission speed if yes, the first request transmission speed information is used as the requested transmission speed information of the relay, and if not, the request transmission speed information for indicating the transmission speed of the transmission speed that the intermediate node can receive is generated, and the relay is transmitted.
  • the request transmission speed information replaces the first request transmission speed information in the first request message to generate a relay request message, and sends a relay request message to the server.
  • the server receives the request message sent by the intermediate node, parses the request message, obtains the transit speed information in the relay request message, and determines whether the transmission speed indicated by the parsed transit request transmission speed information is acceptable to the server. a transmission speed, if yes, using the relayed request transmission speed information as feedback transmission speed information, and if not, generating feedback transmission speed information indicating a transmission speed that the server can receive, and generating a response according to the feedback transmission speed information, The response is sent to the intermediate node.
  • the intermediate node receives the response sent by the server, and can directly forward the response to the terminal, or parse the response, obtain the feedback transmission speed information in the response, and determine whether the transmission speed indicated by the feedback transmission speed information is an acceptable transmission by the intermediate node.
  • Speed if yes, the feedback transmission speed information is used as the feedback transmission speed information of the relay, and if not, the feedback transmission speed information for indicating the transmission speed of the transmission speed that the intermediate node can receive is generated, and the feedback transmission speed information of the relay is replaced by the response.
  • the feedback transmission speed information generates a relay response, and forwards the relay response to the terminal.
  • the terminal receives the response sent by the intermediate node, parses the response, and obtains the feedback transmission speed information of the relay in the response. If the transmission speed indicated by the relay feedback transmission speed information is the same as the transmission speed indicated by the request transmission speed information in the first request message, indicating that the server and the intermediate node can accept the transmission speed of the request, the terminal adjusts the transmission speed to the feedback. The transmission speed indicated by the transmission speed information.
  • the server or medium If the transmission speed indicated by the feedback transmission speed information is different from the transmission speed indicated by the request transmission speed information in the first request message, the server or medium The inter-node cannot accept the transmission speed of the request, and the transmission speed indicated by the feedback transmission transmission speed information is a transmission speed that the server or the intermediate node can accept, and the terminal adjusts the transmission speed to the transmission indicated by the feedback transmission transmission speed information. speed.
  • the terminal sends the second request message by using the adjusted sending speed, where the second request message carries the second request transmission speed information.
  • the manner in which the intermediate node determines the transmission speed that the intermediate node can accept and the manner in which the new request transmission speed information is set can be the same as that in the first embodiment, and details are not described herein again.
  • the process of negotiating the transmission speed between the terminal, the plurality of intermediate nodes, and the server is similar to the foregoing process, and details are not described herein.
  • the terminal sends a first request message to the first node.
  • the transmission speed can be requested from the server or the intermediate node, and the intermediate node and the server can also modify the request transmission speed information according to the transmission speed that can be accepted by itself, and feedback to the terminal, the terminal and the intermediate node.
  • the server implements speed negotiation, which can ensure that each node in the transmission path maintains the highest transmission efficiency, realizes fast data transmission, and improves transmission efficiency.
  • the terminal before the sending, by the terminal, the second request message to the first node according to the transmission speed indicated by the first feedback transmission speed information, the terminal may further include the following steps:
  • the terminal increases exponentially the transmission speed indicated by the first request transmission speed information, and generates The second request transmission speed information indicating an exponentially increasing transmission speed, generating the second request message according to the second request transmission speed information; if the first feedback transmission speed information indicates a transmission speed less than the Transmitting, by the terminal, a transmission speed indicated by the transmission speed information, the terminal linearly increasing the transmission speed indicated by the first request transmission speed information, and generating the second request transmission speed information to indicate a linearly increasing transmission speed And generating, according to the second request transmission speed information, the second request message.
  • the embodiment provides a method for generating second request transmission speed information, wherein if the transmission speed indicated by the feedback transmission speed information is equal to the transmission speed indicated by the first request transmission speed information, the server and the intermediate node can accept the request.
  • the transmission speed then a higher request transmission speed can be requested by the second request message, and the first request is transmitted as described in this embodiment.
  • the server or the intermediate node cannot accept the transmission speed of the request, but may carry a slightly higher transmission speed in the second request message.
  • the terminal may also consider the range of transmission speed allowed by its own capability and bandwidth.
  • the transmission speed of the request is usually not greater than the maximum transmission speed allowed by the terminal itself.
  • the first request message and the second request message are GET request messages, and the GET request message further carries the requested data packet information.
  • the terminal may further include the following steps:
  • the data packet in the response is obtained, the data packet is processed accordingly, and the data packet reception log is updated.
  • the data packet information of the request carried in the GET request message is specifically used to indicate the data packet requested by the terminal to the server.
  • the server receives the GET request message, the server carries the corresponding data packet in the response.
  • the terminal processes the data packet in the response accordingly, and updates the data packet reception log to record the reception status of the data packet.
  • the first request message is a PUT/POST first request message
  • the PUT/POST first request message further carries a data packet.
  • the terminal may further include the following steps: updating the data packet sending log.
  • the PUT/POST request message carries a data packet for the terminal to push the data packet to the server.
  • the server returns a response to the terminal to indicate that the server has received the data packet.
  • the terminal sends a log according to the response update packet to send the data packet. Send the situation for recording.
  • the packet receiving log and the data packet sending log may be recorded in the same log. By recording the receiving status and the sending status of the data packet, the unreceived data packet or the unsuccessful data packet may be re-requested according to the log. , improve the targeting and scheduling of the terminal's request transmission.
  • the method for transmitting the data packet may further include the following steps: if the terminal sends the first request message to the first node within a preset time, the first node does not receive the sending Responding to resending the first request message to the first node.
  • the terminal does not receive a response corresponding to the GET request message within a preset time period of sending the GET request message, and the terminal resends the GET request message to request the unreceived data packet. . If the first request message is a PUT/POST request message, the terminal does not receive a response corresponding to the PUT/POST request message within a preset time period of sending the PUT/POST request message, and the terminal resends the PUT/POST request message. To resend unresponsive packets.
  • Example 1 Example 1:
  • FIG. 2a is a signaling diagram of a method for transmitting a data packet according to an embodiment of the present invention.
  • the terminal sends a GET request message REO to the server at a certain sending speed.
  • the GET request message carries the request transmission speed information and the requested data packet information, and the sending speed is, for example, 1 packet/s, and the request transmission is performed.
  • the transmission speed indicated by the speed information SendSpeed is, for example, 2 packets/s, and the block ID of the requested data packet is 1.
  • the server receives the GET request message, parses the GET request message, and learns that the transmission speed indicated by the request transmission speed information SendSpeed is 2 packets/s, and the server determines that 2 packets/s is the currently acceptable transmission speed, and generates an indication for indicating The transmission speed is 2 packets/s feedback transmission speed information SendSpeed, and a response ACK is generated according to the feedback transmission speed information SendSpeed and the block ID 1 is sent to the terminal.
  • the terminal receives the response, parses the response, processes the packet with the BlockID of 1 carried in the response, and updates the packet receiving log. At the same time, the terminal can know that 2 packets/s is a transmission speed acceptable to the server, and then adjusts the requested transmission speed to 4 packets/s, and generates a GET request message for requesting a packet with a BlockID of 2 and a BlockID of 3, respectively. Both GET request messages carry a request transmission speed information SendSpeed which is useful to indicate a transmission speed of 4 packets/s. The terminal sends the above two GET request messages to the server at a rate of 2 packets/s.
  • the server When the server receives the GET request message for requesting the data packet of BlocklD 2, the GET request message is parsed, and the transmission speed indicated by the request transmission speed information SendSpeed is 4 packets/s, and the server determines the transmission that is currently acceptable to the server.
  • the speed is 2 packets/s
  • a feedback transmission speed information SendSpeed indicating that the transmission speed is 2 packets/s is generated, and a response carrying a packet with BlocklD 2 is generated, and the response carries a useful value to indicate that the transmission speed is 2 packets.
  • feedback transmission speed information SendSpeed The server sends the response to the terminal.
  • the server When the server receives the GET request message for requesting the data packet of BlocklD to 3, the GET request message is parsed, and the transmission speed indicated by the request transmission speed information SendSpeed is 4 packets/s, and the server determines the transmission that is currently acceptable to the server.
  • the speed is 2 packets/s
  • the feedback transmission speed information SendSpeed is generated to indicate the transmission speed is 2 packets/s
  • the response carrying the data packet carrying the Block1D is 3
  • the response carries the information to indicate that the transmission speed is 2 packets.
  • feedback transmission speed information SendSpeed The server sends the response to the terminal.
  • the terminal sequentially receives two responses sent by the server, and processes the data packets of BlocklD 2 and Block 1D respectively carried in the two responses, and updates the data packet reception.
  • the terminal can know that 4 packets/s is the transmission speed that the server cannot accept, and 2 packets/s is the transmission speed that the server can accept.
  • the transmission speed of the request is adjusted to 3 packets/s, and respectively generated for requesting BlocklD to be 4 A GET request message with a packet of BlocklD of 5, both of which carry a request transmission speed information SendSpeed indicating a transmission speed of 3 packets/s.
  • the terminal sends the above two GET request messages to the server at a rate of 2 packets/s.
  • the server When the server receives the GET request message for requesting the data packet with the Block1D of 4, the GET request message is parsed, and the transmission speed indicated by the request transmission speed information SendSpeed is 3 packets/s, and the server determines the transmission that is currently acceptable to the server.
  • the speed is 2 packets/s
  • a feedback transmission speed information SendSpeed indicating that the transmission speed is 2 packets/s is generated, and a response carrying a packet with BlocklD of 4 is generated, and the response carries a useful value to indicate that the transmission speed is 2 packets.
  • feedback transmission speed information SendSpeed The server sends the response to the terminal.
  • the server When the server receives the GET request message for requesting the data packet of BlocklD 5, the GET request message is parsed, and the transmission speed indicated by the request transmission speed information SendSpeed is 3 packets/s, and the server determines that it can accept 3 packets at present. /s transmission speed, then generated A response carrying a packet with a BlocklD of 5 is generated with the feedback transmission speed information SendSpeed indicating that the transmission speed is 3 packets/s, and the response carries a feedback transmission speed information SendSpeed indicating that the transmission speed is 3 packets/s. The server sends the response to the terminal.
  • the terminal sequentially receives two responses sent by the server, and processes the data packets of BlocklD 4 and BlocklD 5 respectively carried in the two responses, and updates the data packet receiving message. Since the transmission speed indicated by the SendSpeed speed information in the response of the packet carrying the BlocklD of 5 is 3 packets/s, indicating that the server is freed from a certain other task, the terminal can continue to request a higher transmission speed. . However, due to the limitation of the terminal's own capabilities, 5 packets / s is the highest transmission speed allowed by the terminal, and the transmission rate of 5 packets / s is requested in the new request message. Thus, within the range allowed by the terminal and server capabilities, the transmission speed will gradually approach the transmission speed acceptable to the weaker nodes.
  • the process of negotiating the transmission speed between the terminal and the server is similar to the process of processing the GET request message, and details are not described herein.
  • the terminal may send multiple GET request messages to the server at a certain transmission speed, and when the server receives the GET request message, the request in each GET request message is received.
  • the transmission speed information generates feedback transmission speed information, and sends the feedback transmission speed information to the terminal in response to speed negotiation with the terminal.
  • the terminal adjusts the request transmission speed information in the next GET request according to the feedback transmission speed information. That is, before the terminal receives the response sent by the server, the request transmission speed information carried in the GET request message sent to the server may be the same, and the response received by the terminal may be a response corresponding to a previously sent request message.
  • the terminal sends a GET request to the server to adjust the requested transmission speed information in the next GET request according to the feedback transmission speed information carried in the response received by the newly received server.
  • FIG. 3 is a signaling diagram of another method for transmitting a data packet according to an embodiment of the present invention.
  • the format of the request message and the response in this example is the same as the above example, and details are not described herein again. In this example, only the transmission speed negotiation process is described.
  • the terminal sends a GET request message to the intermediate node at a certain transmission speed, and the GET request message carries the transmission speed indicated by the request transmission speed information SendSpeed as 1 packet/s.
  • the intermediate node receives the GET request message, parses the GET request message, and learns that the transmission speed indicated by the request transmission speed information SendSpeed is 1 packet/s, and 1 packet/s is the transmission speed that is currently acceptable by itself, and the GET request message is sent. Forward directly to the server.
  • the server receives the GET request message, parses the GET request message, and knows that the transmission speed indicated by the request transmission speed information SendSpeed is 1 packet/s, and the 1 packet/s is the transmission speed that is currently acceptable by itself, and the generation is useful to indicate
  • the response is a response of the transmission speed information SendSpeed of 1 packet/s, and the response is sent to the intermediate node.
  • the intermediate node receives the response, parses the response, and knows that the transmission speed indicated by the feedback transmission speed information SendSpeed is 1 packet/s, and 1 packet/s is the transmission speed that is currently acceptable, and the response is directly forwarded to the terminal.
  • the terminal sends a GET request message to the intermediate node at a certain transmission speed, and the GET request message carries the requested transmission speed information, and the transmission speed indicated by SendSpeed is 4 packets/s.
  • the intermediate node receives the GET request message, parses the GET request message, and knows that the transmission speed indicated by the request transmission speed information SendSpeed is 4 packets/s, and the 4 packets/s is the transmission speed that is not acceptable at present, and the 3 packets/s is At the current acceptable transmission speed, a request transmission speed information SendSpeed indicating a transmission speed of 3 packets/s is generated, and the original request transmission speed information SendSpeed in the GET request message is replaced.
  • the intermediate node sends the GET request message to the server.
  • the server receives the GET request message, parses the GET request message, and knows that the transmission speed indicated by the request transmission speed information SendSpeed is 3 packets/s, 3 packets/s is the transmission speed that is not acceptable at present, and 2 packets/s is current. At a transmission speed that is acceptable for itself, a response carrying feedback transmission speed information SendSpeed indicating a transmission speed of 2 packets/s is generated, and the response is transmitted to the intermediate node.
  • the intermediate node receives the response, parses the response, and knows that the transmission speed indicated by the feedback transmission speed information SendSpeed is 2 packets/s, and 2 packets/s is the transmission speed that is currently acceptable, and the response is directly forwarded to the terminal.
  • the negotiation process of the transmission speed between the terminal, the intermediate node, and the server is similar to the process of processing the GET request message, and details are not described herein.
  • FIG. 4 is a flowchart of a method for transmitting a second type of data packet according to an embodiment of the present invention.
  • the data transmission process between the terminal and the server in the network may also be applied to a data transmission process in which a multi-hop environment in which at least one intermediate node is provided as a proxy terminal between the terminal and the server.
  • the method for transmitting a data packet provided in this embodiment may be implemented by using a server.
  • the method for transmitting a data packet provided by this embodiment may be implemented in cooperation with a transmission speed negotiation method applied to the terminal side according to any embodiment of the present invention. Process, this will not go into details.
  • Step S10 The server receives the request message sent by the second node, where the request message carries the request transmission speed information, and the second node is a terminal or an intermediate node;
  • Step S20 The server determines whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server, and if yes, uses the requested transmission speed information as feedback transmission speed information, and if not, generates The transmission speed information indicating the transmission speed that the server can receive is used as the feedback transmission speed information;
  • Step S30 The server generates a response corresponding to the request message according to the feedback transmission speed information, and sends a response corresponding to the request message to the second node.
  • the server receives the request message sent by the second node. Determining whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server, and if so, requesting the transmission speed information as the feedback transmission speed information, and if not, generating a feedback transmission speed indicating the transmission speed that the server can receive information. A response corresponding to the request message is generated based on the feedback transmission speed information, and a response corresponding to the request message is transmitted to the second node.
  • the request message received by the server carries the requested transmission speed information, and the server can know the transmission speed requested by the terminal or the transmission speed that the intermediate node can accept, and the server can also according to the transmission speed that can be accepted by the server.
  • the request transmission speed information is modified, and feedback is sent to the terminal, and the terminal negotiates with the intermediate node or the server to ensure that each node in the transmission path maintains the highest transmission efficiency, realizes fast data transmission, and improves transmission efficiency. .
  • FIG. 5 is a flowchart of a method for transmitting a third data packet according to an embodiment of the present invention.
  • the server may further include the following steps: before the server determines whether the transmission speed indicated by the request transmission speed information is an acceptable transmission speed.
  • Step S40: Obtaining, by the server, parameter information of the server, and determining, according to the parameter information, a transmission speed that the server can accept, where the parameter information includes at least the following And a central processor idle time information of the server, a memory remaining amount information of the server, and bandwidth occupation information of the server.
  • the central processing unit idle time information, the memory remaining information, and the bandwidth occupation information of the server are all factors that can affect the transmission capability of the server.
  • the transmission speed acceptable to the server can be determined, which can be improved.
  • the rationality and accuracy of the transmission speed determination is
  • the request message is a GET request message
  • the GET request message further carries the requested data packet information.
  • the server in step S30 generates a response corresponding to the request message according to the feedback transmission speed information, which may specifically include the following steps:
  • the server generates a response corresponding to the request message according to the data packet corresponding to the requested data packet information, and adds the feedback transmission speed information to the response.
  • the request message is a PUT/POST request message
  • the PUT/POST request message further carries a data packet.
  • the server in step S30 generates a response corresponding to the request message according to the feedback transmission speed information, which may specifically include the following steps: the server generates an indication to receive the PUT/POST request message. The response of the data packet is added to the response.
  • the second node is a terminal
  • the request message is a first request message, where the first request message carries first request transmission speed information, and the response is the first request message.
  • the request message is a transit request message, and the relay request message carries the requested transmission speed information, and the response is the transit request message. the response to.
  • FIG. 6 is a flowchart of a fourth method for transmitting a data packet according to an embodiment of the present invention. As shown in Figure 6, there is a data transmission process in which a multi-hop environment with at least one intermediate node as a proxy is set.
  • the transmission speed negotiation method on the end side and the server side is implemented in conjunction with the specific implementation process, which is not described here.
  • Step N10 The intermediate node receives a first request message sent by the terminal, where the first The request message carries the first request transmission speed information;
  • Step N20 The intermediate node determines whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the first request transmission speed information as a request transmission speed of the relay Information, if not, generating request transmission speed information indicating that the intermediate node can accept the transmission speed as the transit;
  • Step N30 The intermediate node replaces the transit request transmission speed information with the first request transmission speed information in the first request message, and forwards, to the server, the relay that carries the transit request transmission speed information. Request message.
  • Step N10 to Step N30 is a processing procedure of the request message sent by the intermediate node to the terminal to the server.
  • the intermediate node receives the first request message sent by the terminal, where the first request message carries the first request transmission speed information. Determining whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if so, using the first request transmission speed information as the requested transmission speed information of the relay, and if not, generating an indication that the intermediate node can Transmitted request transmission speed information of the accepted transmission speed.
  • the relayed request transmission speed information is replaced with the first request transmission speed information in the first request message, and the relayed request message carrying the relayed request transmission speed information is forwarded to the server.
  • the intermediate node can identify the request transmission speed information in the request message or the feedback transmission speed information in the response, and cooperate with the terminal and the server to implement the negotiation of the transmission speed, so as to ensure that each node in the transmission path maintains the highest transmission efficiency and realizes the data. Fast transmission and improved transmission efficiency.
  • the method for transmitting the data packet may further include the following steps: Step N40: The intermediate node receives a response that is sent by the server and is corresponding to the request message of the relay, where The response of the request message carries feedback transmission speed information;
  • Step N50 The intermediate node determines whether the transmission speed indicated by the feedback transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the feedback transmission speed information as the feedback transmission speed information of the relay, if not And generating feedback transmission speed information for indicating the transfer speed of the transmission speed acceptable to the intermediate node;
  • Step N60 The intermediate node replaces the feedback transmission speed information of the relay with the feedback transmission speed information in the response, and forwards the feedback transmission speed carrying the relay to the terminal. The response of the transit of the information.
  • Step N40 to Step N60 is a process of processing the feedback sent by the intermediate node to the server to the terminal.
  • the intermediate node has the resolving capability, and can obtain the request transmission speed information in the request message or the feedback transmission speed information in the response, and adjust the above information according to its own capabilities.
  • FIG. 7 is a schematic structural diagram of a first terminal according to an embodiment of the present invention.
  • the terminal 81 provided in this embodiment may be applied to the terminal 81 provided by any embodiment of the present invention.
  • the terminal 81 provided in this embodiment specifically includes a request message sending unit 11 and a response processing unit 12.
  • the request message sending unit 11 is configured to send a first request message to the first node 82, where the first request message carries the first request transmission speed information
  • the first node 82 is a server or an intermediate node.
  • the response processing unit 12 is configured to receive the response sent by the first node 82, and obtain the first feedback transmission speed information in the response of the first request message, so that the request message sending unit 11 is configured according to the first feedback. And transmitting, by the transmission speed information, a second request message to the first node 82, where the first feedback transmission speed information is used to indicate a transmission speed that the first node 82 can accept, the second request
  • the message carries the second request transmission speed information.
  • the request message sending unit 11 sends a first request message to the first node 82
  • the response processing unit 12 receives the response sent by the first node 82, and obtains the response in the first request message.
  • the first feedback transmission speed information is such that the request message transmitting unit 11 transmits a second request message to the first node 82 according to the transmission speed indicated by the first feedback transmission speed information.
  • the transmission speed can be requested from the server or the intermediate node, and the intermediate node and the server can also modify the request transmission speed information according to the transmission speed that can be accepted by itself, and feedback to the terminal 81, and the terminal 81 and Speed negotiation between the intermediate node or the server ensures that each node in the transmission path maintains the highest transmission efficiency, realizes fast data transmission, and improves transmission efficiency.
  • FIG. 7 is a schematic structural diagram of a second terminal according to an embodiment of the present invention, including a memory 701, and a processor 601.
  • the memory 701 is used to store the units described in FIG. 7a
  • the processor 601 is connected to the memory 701, and each unit in the running memory 701 performs the corresponding function of each unit in the memory 701.
  • the functions of the units in the memory 701 in FIG. 7b are the same as those of the units in FIG. 7a.
  • the embodiments of the present invention are not described in detail herein.
  • FIG. 8 is a schematic structural diagram of a third terminal according to an embodiment of the present invention.
  • the response processing unit 12 may be further configured to: if the transmission speed indicated by the first feedback transmission speed information is equal to the transmission speed indicated by the first request transmission speed information, And exponentially increasing the transmission speed indicated by the first request transmission speed information, generating the second request transmission speed information to indicate an exponentially increasing transmission speed, and generating the first information according to the second request transmission speed information.
  • the second request message is generated according to the second request transmission speed information with the second request transmission speed information indicating a linearly increasing transmission speed.
  • the first request message is a GET request message
  • the GET request message further carries the requested data packet information.
  • the terminal 81 may further include a first processing unit 13 for acquiring a data packet in the response, processing the data packet accordingly, and updating the data packet receiving log.
  • the first request message is a PUT/POST first request message
  • the PUT/POST first request message further carries a data packet
  • the terminal 81 may further include a second processing unit 14, and the second processing unit 14 is configured to update the data packet transmission log.
  • the packet receiving log and the data packet sending log may be recorded in the same log. By recording the receiving status and the sending status of the data packet, the unreceived data packet or the unsuccessful data packet may be re-requested according to the log. The targeting and scheduling of the request transmission by the terminal 81 are improved.
  • the terminal 81 may further include a re-request unit 15 for not receiving the first time within a preset time after sending the first request message to the first node 82.
  • the response sent by the node 82 resends the first request message to the first node 82.
  • FIG. 8 is a schematic structural diagram of a fourth terminal according to an embodiment of the present invention, including a memory 702, and a processor 602.
  • the memory 702 is used to store the units described in FIG. 8a
  • the processor 602 is connected to the memory 702, and each unit in the running memory 702 performs the corresponding function of each unit in the memory 702.
  • the functions of the units in the memory 702 in FIG. 8b are the same as those of the units in FIG. 8a.
  • the embodiments of the present invention are not described in detail herein.
  • FIG. 9 is a schematic structural diagram of a first server according to an embodiment of the present invention. As shown in FIG. 9a, the server 83 provided in this embodiment may specifically implement the application provided by any embodiment of the present invention.
  • the server 83 provided in this embodiment specifically includes a first request receiving unit 21, a first determining unit 22, and a first response unit 23.
  • the first request receiving unit 21 is configured to receive the request message sent by the second node 84, where the request message carries the requested transmission speed information, and the second node 84 is a terminal or an intermediate node.
  • the first determining unit 22 is configured to determine whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server 83, and if yes, use the requested transmission speed information as feedback transmission speed information, and if not, A transmission speed indicating that the server 83 can receive is generated as feedback transmission speed information.
  • the first response unit 23 is configured to generate a response corresponding to the request message according to the feedback transmission speed information, and send a response corresponding to the request message to the second node 84.
  • the first request receiving unit 21 receives the request message sent by the second node 84, and the first determining unit 22 determines whether the transmission speed indicated by the request transmission speed information is a transmission acceptable to the server 83.
  • Speed if yes, using the requested transmission speed information as feedback transmission speed information, and if not, generating feedback transmission speed information indicating a transmission speed that the server 83 can receive, the first response unit 23 according to the feedback
  • the transmission speed information generates a response corresponding to the request message, and transmits a response corresponding to the request message to the second node 84.
  • the request message received by the server 83 carries the requested transmission speed information, and the server 83 can know the transmission speed requested by the terminal or the transmission speed that the intermediate node can accept, and the server 83 can also accept according to itself.
  • the transmission speed is modified by the request transmission speed information, and feedback is sent to the terminal, and the terminal negotiates with the intermediate node or the server 83 to ensure that each node in the transmission path maintains the highest transmission efficiency and realizes fast data transmission. Improve transmission efficiency.
  • the server may further include a transmission speed determining unit, where the transmission speed determining unit acquires parameter information of the server, and determines, according to the parameter information, a transmission speed that the server can accept, where The parameter information includes at least one of the following: central processor idle time information of the server, memory remaining amount information of the server, and bandwidth occupation information of the server.
  • the request message is a GET request message, and the GET request message further carries the requested data packet information.
  • the first response unit is further configured to generate a response corresponding to the request message according to the data packet corresponding to the requested data packet information, and add the feedback transmission speed information to the response.
  • the request message is a PUT/POST request message
  • the PUT/POST request message further carries a data packet
  • the first response unit is further configured to generate a response to indicate receipt of the data packet in the PUT/POST request message, and add the feedback transmission speed information to the response.
  • FIG. 9b is a schematic structural diagram of a second server according to an embodiment of the present invention, including a memory 703, and a processor 603.
  • the memory 703 is used to store the units described in FIG. 9a
  • the processor 603 is connected to the memory 703, and the units in the memory 703 execute the respective functions of the units in the memory 703.
  • the functions of the units in the memory 703 in Fig. 9b are the same as those of the units in Fig. 9a, and the embodiments of the present invention will not be described in detail herein.
  • FIG. 10a is a schematic structural diagram of a first intermediate node according to an embodiment of the present invention. As shown in FIG. 10a, the intermediate node 85 provided in this embodiment may implement various steps of the method for transmitting data packets applied to the intermediate node according to any embodiment of the present invention, and details are not described herein.
  • the intermediate node 85 includes a first proxy receiving unit 31, a second judging unit 32, and a first proxy transmitting unit 33.
  • the first proxy receiving unit 31 is configured to receive the first request message sent by the terminal 81, where the first request message carries the first request transmission speed information.
  • the second determining unit 32 is configured to determine whether the transmission speed indicated by the first request transmission speed information is a transmission speed that the intermediate node 85 can accept, and if yes, transmit the first request transmission speed information as a request for transiting The speed information, if not, generates request transmission speed information indicating that the intermediate node 85 can accept the transmission speed as the relay.
  • the first proxy sending unit 33 is configured to replace the transited request transmission speed information with the first request transmission speed information in the first request message, and forward the request transmission speed information carrying the transit to the server 83. Transit request message.
  • the first proxy receiving unit 31 receives the first request message sent by the terminal 81, and the second determining unit 32 determines whether the transmission speed indicated by the first request transmission speed information is the intermediate node 85.
  • the acceptable transmission speed if yes, the first request transmission speed information is used as the requested transmission speed information of the relay, and if not, the request transmission speed for instructing the transmission of the transmission speed acceptable to the intermediate node 85 is generated.
  • Information first The proxy sending unit 33 replaces the transited request transmission speed information with the first request transmission speed information in the first request message, and forwards the relay request message carrying the relayed request transmission speed information to the server 83.
  • the intermediate node can identify the request transmission speed information in the request message or the feedback transmission speed information in the response, and cooperate with the terminal and the server to implement the negotiation of the transmission speed, so as to ensure that each node in the transmission path maintains the highest transmission efficiency and realizes the data. Fast transmission and improved transmission efficiency.
  • the intermediate node may further include a second proxy receiving unit, a third determining unit, and a second proxy sending unit.
  • the second proxy receiving unit is configured to receive a response that is sent by the server and is corresponding to the request message of the relay, where the response corresponding to the relayed request message carries feedback transmission speed information.
  • the third determining unit is configured to determine whether the transmission speed indicated by the feedback transmission speed information is a transmission speed that the intermediate node can accept, and if yes, use the feedback transmission speed information as the feedback transmission speed information of the relay, and if not, Then, feedback transmission speed information is generated to indicate the transfer speed of the transmission speed that the intermediate node can accept.
  • the second proxy transmits a feedback transmission speed information for replacing the relay to replace the feedback transmission speed information in the response, and forwards a response of the relay carrying the relayed feedback transmission speed information to the terminal.
  • FIG. 10b is a schematic structural diagram of a second intermediate node according to an embodiment of the present invention, including a memory 704, and a processor 604.
  • the memory 704 is used to store the units described in FIG. 10a
  • the processor 604 is coupled to the memory 704, and the units operating the memory 704 perform the respective functions of the units in the memory 704.
  • the functions of the units in the memory 704 in FIG. 10b are the same as those of the units in FIG. 10a, and the embodiments of the present invention are not described in detail herein.
  • each unit included is only divided according to functional logic, but is not limited to the above division, as long as the corresponding function can be realized; in addition, the specific names of the functional units are only for convenience. They are distinguished from each other and are not intended to limit the scope of protection of the present invention.
  • the operations performed by the terminal, the intermediate node, and the server in the foregoing method for implementing the data packet transmission, and the functions of the functional units of the terminal, the server, and the intermediate node in the device map may be operated by the processor of the terminal, the server, and the intermediate node. carry out,
  • FIG. 11 is a flowchart of a method for transmitting a data packet according to an embodiment of the present invention.
  • the data transmission process between the terminal and the server in the network of FIG. 11 can also be applied to a data transmission process in which a multi-hop environment in which at least one intermediate node is set as a proxy terminal between the terminal and the server.
  • the method for transmitting a data packet provided by this embodiment specifically includes:
  • Step A10 The terminal sends a communication request message generated by the terminal to the server, where the communication request message carries the first data packet request indication information or the first response interval indication information, and the first data packet request indication information And indicating at least two pieces of data packet information obtained by the server, where the first response interval indication information is used to indicate that the server responds after receiving at least two data packets;
  • Step A20 The terminal receives a response sent by the server and corresponding to the communication request message.
  • the first data packet request indication information or the first response interval indication information may be set according to the current network condition.
  • the first packet request indication information and the first response interval indication information are specifically directed to different communication request messages.
  • the communication request message is a GET communication request message
  • the GET communication request message carries data packet request indication information, where the data packet request indication information is used to indicate information of a data packet requested by the server at a time, the number of the data packet is at least Two.
  • the communication request message is a PUT/POST communication request message
  • the PUT/POST communication request message carries the response interval indication information, where the response interval indication information is used to indicate that the server returns after receiving the corresponding number of data packets of the response interval indication information. In response, the number is also at least two.
  • the terminal sends a communication request message generated by the terminal to the server, where the communication request message carries the first data packet request indication information or the first response interval indication information, and the first data packet request
  • the indication information indicates at least two pieces of packet information acquired to the server, and the first response interval indication information is used to instruct the server to respond after receiving at least two data packets.
  • the intermediate node In a multi-hop environment in which at least one intermediate node is provided as a proxy between the terminal and the server, the intermediate node only forwards the data exchanged between the terminal and the server.
  • the communication request message is a first GET communication request message;
  • the law further includes:
  • Step A30 The terminal determines, according to the first data packet receiving log, the first network packet loss rate.
  • Step A10 The terminal sends the communication request message generated by the terminal to the server, where the terminal includes: the terminal according to the first network packet loss Generating the first data packet request indication information, and generating the first GET communication request message, where the first GET communication request message carries the first data packet request indication information, if the first network packet loss.
  • the first packet request indication information indicates at least two packet information acquired to the server; the first GET communication request message is sent to the server, so that the server is configured according to the server.
  • the first data packet request indication information transmits a response carrying a data packet corresponding to the first data packet request indication information.
  • the first GET communication request message carries the first data packet request indication information
  • the setting manner of the first data packet request indication information may be: adding a new Option in the Option part of the first GET communication request message, where
  • the Option name can be ACKGap, which is used to indicate the number of packets requested at one time.
  • the communication request message also carries the BlockID of the requested data packet.
  • the first network packet loss rate can reflect the current network situation, and the first data packet reception log can be set in the terminal to record the data packet reception status.
  • the terminal may determine the first network packet loss rate according to the first data packet receiving log. When the packet loss rate of the first network is less than the first preset threshold, the current network status is good, and the first GET communication request message is generated according to the first network packet loss rate.
  • the first data packet request indication information or the value corresponding to the first response interval indication information may be set to a smaller value. , such as 1.
  • the server sends a response carrying the data packet of the request, or the first PUT/POST communication request message carries the first response interval indication information with a value of 1, The server feeds back a response to the terminal after receiving a data packet according to the first response interval indication information. If the current network status is good, the first data packet request indication information or the value corresponding to the first response interval indication information may be set to a larger value, such as 5.
  • the server sends five responses carrying the data packets of the request, and each response carries one data packet.
  • the first PUT/POST communication request message carries the first response interval indication information with a value of 5, and the server receives the information according to the first response interval indication information. A response is fed back to the terminal after five packets.
  • the correspondence between the network packet loss rate and the data packet request indication information or the response interval indication information value may be established according to the transmission condition of the collected network, so as to fully utilize the network resources and ensure efficient multiplexing of the signals.
  • the network packet loss rate and the data packet request indication information or the response interval indication information value may also be inversely related to reduce the difficulty of setting the data packet request indication information or the response interval indication information.
  • the method for transmitting the data packet may further include the following steps: Step A40: The terminal determines a packet loss rate of the second network according to the second data packet receiving log. Step A50: Generating the second packet request indication information by using the second network packet loss rate;
  • the packet loss rate of the second network is smaller than the first preset threshold, the number of data packets acquired by the second data request indication information to the server is greater than the direction indicated by the first data packet request indication information.
  • the number of data packets acquired by the server; or, if the second network packet loss rate is greater than the second preset domain value, the number of data packets obtained by the second data request indication information to the server is less than
  • the first data packet request indication information indicates the number of data packets acquired by the server;
  • Step A60 The terminal generates a second GET communication request message, where the second GET communication request message carries the second data packet request indication information;
  • Step A70 The terminal sends a second GET communication request message to the server, so that the server sends, according to the second data packet request indication information, a data packet that carries the information corresponding to the second data packet request indication information. the response to.
  • the second data packet receiving log and the first data packet receiving log may be the same log, and the second network packet loss rate may reflect the current network condition, and if the second network packet loss rate is still less than the first preset threshold , indicating that the current network condition continues to be good, the number of packets that can be requested from the server is greater than the number of packets that were requested last time. If the second network packet loss rate is greater than the second preset threshold, and the second preset threshold is greater than the first preset threshold, the current network condition is deteriorated, and the number of data packets that can be requested from the server is smaller than the previous time. The number of requested packets.
  • the communication request message is a first PUT/POST communication request message; the method further includes the following steps:
  • the terminal determines, according to the first data packet sending log, a third network packet loss rate.
  • the terminal sends the communication request message generated by the terminal to the server, which may specifically include The following steps:
  • the terminal generates the response interval indication information according to the third network packet loss rate, generates the first PUT/POST communication request message according to the first response interval indication information, and sends the first message to the server.
  • a PUT/POST communication request message if the third network packet loss rate is less than a first preset threshold, the first response interval indication information is used to indicate that the server responds after receiving at least two data packets; And causing the server to return a response after receiving the number of data packets indicated by the first response interval indication information.
  • the first PUT/POST communication request message carries the first response interval indication information
  • the setting manner of the first response interval indication information may be: adding a new Option in the Option part of the first PUT/POST communication request message.
  • the Option name may be specifically ACKGap, which is used to indicate that the server returns a response after receiving the data packet corresponding to the ACKGap value.
  • the third network packet loss rate can reflect the current network situation, and the first data packet transmission log can be set in the terminal to record the data packet transmission.
  • the terminal may determine the third network packet loss rate according to the first data packet sending log. When the packet loss rate of the third network is less than the first preset threshold, it may be stated that the current network condition is good, and the first PUT/POST communication request message is generated according to the third network packet loss rate.
  • the method for transmitting the data packet may further include the following steps:
  • the terminal determines, according to the second data packet sending log, a packet loss rate of the fourth network.
  • the terminal generates the second response interval indication information according to the fourth network packet loss rate.
  • the number of the second response interval indication information indication is greater than the number indicated by the first response interval indication information; or, if the fourth network is lost
  • the packet rate is greater than the second preset field value, and the quantity indicated by the second response interval indication information is smaller than the number indicated by the first response interval indication information;
  • the terminal generates a second PUT/POST communication request message according to the second response interval indication information, and sends the second PUT/POST communication request message to the server, so that the server receives the The second response interval indicates the number of packets indicated by the information and returns a response.
  • the second data packet sending log and the first data packet sending log may be the same, and the fourth network packet loss rate may reflect the current network condition, and if the fourth network packet loss rate is still less than the first A preset threshold indicates that the current network condition continues to be good, and the response interval that can be requested from the server is greater than the response interval of the previous request. If the packet loss rate of the fourth network is greater than the second preset threshold, and the second preset threshold is greater than the first preset threshold, the current network condition is deteriorated, and the response interval that can be requested from the server is smaller than the previous request. Response interval.
  • the terminal in the foregoing step according to the first network packet loss rate, generates the first data packet request indication information, which may specifically include the following steps:
  • the terminal generates the first data packet request indication information according to an inverse ratio of the first network packet loss ratio.
  • the terminal in the foregoing step generates the first response interval indication information according to the third network packet loss rate, and specifically includes the following steps:
  • the terminal generates the first response interval indication information according to an inverse ratio of the third network packet loss rate.
  • FIG. 12 is a flowchart of another method for transmitting a data packet according to an embodiment of the present invention.
  • the data transmission process between the terminal and the server in the network of FIG. 12 can also be applied to a data transmission process in which a multi-hop environment in which at least one intermediate node is set as a proxy end between the terminal and the server is used.
  • the method for transmitting a data packet provided by this embodiment can be performed by a server.
  • the specific implementation process of the negotiation provided in this embodiment is not described here.
  • Step B10 The server receives the communication request message sent by the terminal, where the request message carries the data packet request indication information or the response interval indication information, where the data packet request indication information is specifically at least two acquired by the server. Data packet information, the response interval indication information is used to indicate that the server responds after receiving at least two data packets;
  • Step B20 The server parses the communication request message, obtains the indication information in the request message, and returns a response to the terminal according to the indication information.
  • the server receives the communication request message sent by the terminal, where the request message carries the data packet request indication information or the response interval indication information, where the data packet request indication information is at least Two data packet information obtained by the server, the response interval indication information is used to indicate that the server responds after receiving at least two data packets, parsing the communication request message, and acquiring the request message.
  • the request message carries the data packet request indication information or the response interval indication information in the communication request message, so that the server returns a response according to the indication information, and the response interval between the terminal and the server is realized.
  • the negotiation of capabilities effectively utilizes network bandwidth and improves transmission efficiency.
  • the communication request message is a GET communication request message
  • the GET communication request message carries data packet request indication information.
  • the server obtains the indication information in the request message, and returns a response to the terminal according to the indication information, which may include the following steps:
  • the server Obtaining, by the server, the data packet request indication information in the GET communication request message, indicating at least two data packet information acquired by the server, and generating at least two responses according to the data packet corresponding to the data packet information acquired by the server. Sending the at least two responses to the terminal, where each of the responses carries one data packet.
  • the request message is a PUT/POST communication request message
  • the PUT/POST communication request message carries response interval indication information and a data packet.
  • the server obtains the indication information in the request message, and returns a response to the terminal according to the indication information, which may include the following steps:
  • the server acquires the response interval indication information in the PUT/POST communication request message, and after receiving the data packet corresponding to the response interval indication information, sends the response to the terminal.
  • the terminal pushes the data packet to the server.
  • the server may not receive the data packet sent by the terminal.
  • the processing may be performed by: the request message is a PUT/POST communication request message, and the PUT/POST communication request message carries response interval indication information and a data packet.
  • the server obtains the indication information in the request message, and returns a response to the terminal according to the indication information, which may include the following steps:
  • the server starts a timer when returning a response to the terminal last time, and performs timing of a preset time
  • the server sends a data packet reception success response to the terminal when receiving the data packet corresponding to the response interval indication information before the end of the preset time; or when the preset time is over, When receiving the response interval indication information corresponding to the number of data packets, The terminal sends a packet reception failure response.
  • the successful response may specifically carry information of a successfully received data packet.
  • the failure response is specifically used to indicate that the data packet is not received within the preset time.
  • the terminal After receiving the failure response, the terminal resends the data packet not received by the server according to the data packet sending situation and the successful response situation.
  • the packet can be sent to the server along with other packets in the next PUT/POST communication request message.
  • the response is returned to the terminal, which can avoid the delay of response feedback caused by poor network conditions. Time.
  • the response specifically carries the received data packet.
  • the number of received data packets can be multiple, and the terminal can know the transmission status of the data packet according to the response.
  • the preset time may be specifically set according to network conditions, or the product of Round-Trip Time (RTT) and ACKGap may be used as the preset time.
  • FIG. 13 is a signaling diagram of still another method for transmitting a data packet according to an embodiment of the present invention.
  • the communication request message sent by the terminal to the server is a PUT/POST communication request message
  • the process of the response interval negotiation between the terminal and the server is described in detail.
  • the terminal generates the response interval indication information ACKGap according to the network packet loss rate.
  • the value of the ACKGa may be inversely proportional to the network packet loss rate, and sends a PUT/POST communication request message to the server.
  • the PUT/POST communication request message carries the response interval indication information ACKGap.
  • the packet the number of packets indicated by ACKGap is 1, and the Block1D of the packet is 1.
  • the server receives the PUT/POST communication request message, parses the PUT/POST communication request message, obtains the response interval indication information ACKGap in the PUT/POST communication request message, and knows that the value of ACKGap is 1, and then determines that the BlocklD is received. After the data packet of 1, a response is sent to the terminal to indicate that the packet whose BlocklD is 1 has been received.
  • the terminal receives the response and learns that the packet with BlocklD 1 has been successfully received by the server.
  • the terminal generates the response interval indication information ACKGap according to the network packet loss rate, and the number of the data packets indicated by the ACKGap is 2.
  • the two PUT/POST communication request messages are generated and sent to the server respectively, where the PUT/POST communication request message carries the
  • the response interval indication information ACKGa and Block1D are data packets of 2
  • the other PUT/POST communication request message carries the data packet with the response interval indication information ACKGap and BlocklD being 3.
  • the server sequentially receives the above two PUT/POST communication request messages, respectively parses the two PUT/POST communication request messages, and obtains the sound in the PUT/POST communication request message.
  • the interval indication information ACKGap is obtained, the value of the ACKGap is 2, and after determining that the data packet of Block1D is 2 and Block1D is 3, the terminal is sent to indicate that the Block1D is 2 and the Block1D is 3.
  • the response of the package After the interval indication information ACKGap is obtained, the value of the ACKGap is 2, and after determining that the data packet of Block1D is 2 and Block1D is 3, the terminal is sent to indicate that the Block1D is 2 and the Block1D is 3.
  • the terminal receives the response and learns that the packet with BlocklD 2 and BlocklD 3 has been successfully received by the server.
  • the terminal generates response interval indication information ACKGap according to the network packet loss rate, and the number of data packets indicated by ACKGa is 3, and generates three PUT/POST communication request messages, which are respectively sent to the server, where the first PUT/POST communication request message is carried.
  • the data packet with the response interval indication information ACKGap and BlocklD being 4, the second PUT/POST communication request message carrying the data packet with the response interval indication information ACKGap and BlocklD being 5, and the third PUT/POST communication request message
  • the data packet with the response interval indication information ACKGap and BlocklD being 6 is carried.
  • the server sequentially receives the PUT/POST communication request message carrying Block1D as 4 data packets and carries the Block1D as 6 data packets, respectively parses the two PUT/POST communication request messages, and obtains the response in the PUT/POST communication request message.
  • the interval indication information ACKGap knowing that the value of ACKGap is 3, but the server has not received the third PUT/POST communication request message when the preset time exceeds the preset time, and sends a message to the terminal to indicate that the BlocklD has been received as 4 and BlocklD.
  • the response for the 6 packets The response for the 6 packets.
  • the terminal receives the response and learns that the packet with Block1D of 4 and BlocklD of 6 has been successfully received by the server, but the server does not receive the packet with Block1D of 5.
  • the terminal generates response interval indication information ACKGap according to the network packet loss rate, and the number of data packets indicated by ACKGa is 2, and two PUT/POST communication request messages are generated and sent to the server respectively, where a PUT/POST communication request message carries the The data packet with the response interval indication information ACKGap and BlocklD being 5 is retransmitted for the data packet with BlocklD of 5, and the other PUT/POST communication request message carries the data packet with the response interval indication information ACKGap and BlocklD of 7.
  • FIG. 14 is a schematic structural diagram of a fifth terminal according to an embodiment of the present invention.
  • the terminal 87 provided in this embodiment may implement various steps of the method for negotiating the response interval capability of the terminal 87 provided by any embodiment of the present invention, and details are not described herein.
  • the terminal 87 provided in this embodiment specifically includes a request unit 41 and a response receiving unit 42.
  • the requesting unit 41 is configured to send, to the server 88, the communication request message generated by the terminal, where the communication request message carries the first data packet request indication information or the first response interval indication message.
  • the first data packet request indication information indicates at least two data packet information acquired by the server 88, and the first response interval indication information is used to indicate that the server 88 responds after receiving at least two data packets.
  • the response receiving unit 42 is configured to receive a response sent by the server 88 corresponding to the communication request message.
  • the requesting unit 41 sends a communication request message generated by the terminal to the server 88, where the communication request message carries the first data packet request indication information or the first response interval indication information.
  • the first data packet request indication information indicates at least two data packet information acquired by the server 88, and the first response interval indication information is used to indicate that the server 88 responds after receiving at least two data packets.
  • the response receiving unit 42 receives a response sent by the server 88 corresponding to the communication request message.
  • the terminal 87 implements the negotiation of the response interval capability of the terminal 87 and the server 88 by carrying the data packet request indication information or the response interval indication information in the communication request message, effectively utilizing the network bandwidth, and improving the transmission efficiency.
  • the communication request message is a first GET communication request message; correspondingly, the terminal further includes a first packet loss rate determining unit, where the first packet loss rate determining unit is configured to receive according to the first data packet. Determining, by the log, a packet loss rate of the first network; the first requesting unit is further configured to: generate, by the terminal, the first data packet request indication information according to the first network packet loss rate, and generate the first GET communication request a message that the first GET communication request message carries the first data packet request indication information, and if the first network packet loss rate is less than a first preset threshold, the first data packet request indication information indicates at least 2 Data packet information obtained from the server; sending the first GET communication request message to the server, so that the server sends an indication with the first data packet according to the first data packet request indication information The response of the packet corresponding to the message.
  • the terminal may further include a second packet loss rate determining unit and a second request unit.
  • the second packet loss rate determining unit is configured to determine a second network packet loss rate according to the second data packet receiving log.
  • the second requesting unit is configured to generate the second data packet request indication information according to the second network packet loss rate, where the second network packet loss rate is less than the first preset threshold, the second data
  • the number of data packets acquired by the request indication information to the server is greater than the number of data packets acquired by the server indicated by the first data packet request indication information; or, if the second network packet loss rate is greater than the second a preset field value, the number of data packets acquired by the second data request indication information to the server is smaller than the number of data packets obtained by the first data packet request indication information and sent to the server,
  • Two GET communication request message the second GET communication request The request message carries the second data packet request indication information, and sends a second GET communication request message to the server, so that the server sends and carries the second data
  • the communication request message is a first PUT/POST communication request message.
  • the terminal further includes a third packet loss rate determining unit, where the third packet loss rate determining unit is configured to determine a third network packet loss rate according to the first data packet sending log.
  • the first requesting unit is further configured to generate the response interval indication information according to the third network packet loss rate, and generate the first PUT/POST communication request message according to the first response interval indication information, to the The server sends the first PUT/POST communication request message, if the third network packet loss rate is less than the first preset threshold, the first response interval indication information is used to indicate that the server receives at least two Responding to the data packet; so that the server returns to the port after receiving the number of data packets indicated by the first response interval indication information.
  • the terminal may further include a fourth packet loss rate determining unit and a third request unit.
  • the fourth packet loss rate determining unit is configured to determine a fourth network packet loss rate according to the second data packet sending log.
  • the third requesting unit is configured to generate the second response interval indication information according to the fourth network packet loss rate, where the second network packet loss rate is less than the first preset threshold, the second response interval The number of the indication information indication is greater than the number indicated by the first response interval indication information; or, if the fourth network packet loss rate is greater than the second preset domain value, the second response interval indication information indicates that the number is smaller than the number a response indicating the number of indications, the terminal generating a second PUT/POST communication request message according to the second response interval indication information, and sending the second PUT/POST communication request message to the server; The server returns a response after receiving the number of data packets indicated by the second response interval indication information.
  • FIG. 15 is a schematic structural diagram of a third server according to an embodiment of the present invention.
  • the server 88 provided in this embodiment may implement various steps of the method for negotiating the response interval capability applied to the server 88 side according to any embodiment of the present invention, and details are not described herein.
  • the server 88 provided in this embodiment specifically includes a second request receiving unit 51 and a second response unit 52.
  • the second request receiving unit 51 is configured to receive the communication request message sent by the terminal 87, where the request message carries the data packet request indication information or the response interval indication information, where the data packet request indication information is specifically at least two directions.
  • the packet information obtained by the server, the response interval indication information is used to indicate that the server responds after receiving at least two data packets.
  • the second response unit 52 is configured to parse the communication request message, and obtain the request cancellation.
  • the indication information in the information returns a response to the terminal 87 according to the indication information.
  • the second request receiving unit 51 receives the communication request message sent by the terminal 87, where the request message carries the data packet request indication information or the response interval indication information, and the data packet request indication information Specifically, it is at least two pieces of data packet information obtained by the server, where the response interval indication information is used to indicate that the server responds after receiving at least two data packets.
  • the second response unit 52 parses the communication request message, obtains the indication information in the request message, returns a response to the terminal 87 according to the indication information, and the terminal 87 carries the data packet request indication by transmitting the communication request message.
  • the information or response interval indication information is such that the server 88 returns a response according to the indication information, realizing the negotiation of the response interval capability of the terminal 87 and the server 88, effectively utilizing the network bandwidth, and improving the transmission efficiency.
  • the communication request message is a GET communication request message
  • the GET communication request message carries data packet request indication information.
  • the second response unit is further configured to: the server obtains the data packet request indication information in the GET communication request message, and indicates at least two data packet information acquired by the server, according to the data packet information acquired by the server.
  • the corresponding data packet generates at least two responses, and the at least two responses are sent to the terminal, where each of the responses carries one data packet.
  • the request message is a PUT/POST communication request message
  • the PUT/POST communication request message carries response interval indication information and a data packet.
  • the second response unit is further configured to acquire the response interval indication information in the PUT/POST communication request message, and send the location to the terminal after receiving the data packet corresponding to the response interval indication information. Respond to the response.
  • the request message is a PUT/POST communication request message
  • the PUT/POST communication request message carries response interval indication information and a data packet.
  • the second response unit is further configured to: when the server returns a response to the terminal, start a timer to perform a preset time, before the preset time ends, when the When the response interval indication information corresponds to the quantity of data packets, sending a data packet reception success response to the terminal; or when the preset time expires, the corresponding number of data packets of the response interval indication information are still not received, The terminal sends a packet reception failure response.
  • FIG. 16 is a flowchart of a transmission process according to an embodiment of the present invention.
  • the terminal can perform the negotiation of the transmission speed and the negotiation of the response interval capability simultaneously with the server, that is, the communication request message sent by the terminal carries the requested transmission speed information SendSpeed and carries the data packet.
  • the processing of the data packet by the terminal can be specifically divided into three processes: a receiving process, a scheduling process, and a sending process.
  • the sending process includes: The terminal checks whether the queue of the to-be-sent packet queue has a data packet to be sent, and then performs a sending operation, and feeds the sending time and number to the data packet to send and receive logs.
  • the receiving process includes: parsing the parsed after each response is received by the terminal
  • SendSpeed and ACKGap are handed over to the development of the transmission planning unit, and the tracking of the received and received logs of the received packets through the log tracking unit will find out the data packets that have been lost, the RTT of the current network, and the packet loss rate.
  • the log tracking unit hands these parameters together to the development delivery planning unit, which formulates the delivery plan, such as the package to be sent and which parameters are carried in the package.
  • the terminal after starting a BLOCK transmission, the terminal will generate a request plan for all data packets that need to be requested, and continuously send a communication request message according to the transmission speed determined by the request plan and negotiation, and track each packet for timeout loss. If it is missing, insert it at the front of the queue and send it at the current speed. Losing or not does not affect the speed increase and decrease.
  • the only thing that can affect the transmission speed is the processing power of the nodes at both ends. That is to say, in a network with a high packet loss rate, the receiver receives less packets than the sender, and the server will be able to accept higher transmission speeds when the terminal capacity is sufficient.
  • the server can be stateless as much as possible.
  • the server can also increase channel utilization by saving a BlocklD list of partial packets.
  • the server can save the BlocklD list of the packet received from the last response, and obtain ACKGap from the received PUT/POST communication request message, and determine whether it is necessary or not. Feedback immediately or continue to wait.
  • the server In the case where there is a packet loss, since the terminal continuously retransmits the packet that has not been responded to, the server only needs to count the response after receiving the packet of the corresponding number of ACKGap.
  • the server When the server processes the GET communication request message, the GET request sent by the terminal contains more Requests for packets, and include a SendSpeed, the server can temporarily save the BlockID list of these requested packets, and return them to the terminal in response according to SendSpeed in order.
  • the server only needs to maintain simple state data to complete the processing of redundant responses in the channel, so that the response and request messages are greatly concentrated, thereby efficiently utilizing bandwidth.
  • any node does not support the above-mentioned transmission speed negotiation capability or the interval response capability processing method.
  • a SendSpeed Option is added to the request message to indicate a higher transmission speed. If the server can accept the speed, it will have the same SendSpeed in the response. However, if the server is not willing to negotiate speed, it is only willing to perform the traditional BLOCK transmission mode, or the server does not recognize the SendSpeed Option, it only needs to carry SendSpeed in the response. After receiving the response, the terminal will know that the speed negotiation operation cannot be performed on the current path, thus starting the traditional BLOCK transmission mode.
  • the server For interval response negotiation, if the server cannot support or does not recognize the ACKGap Option, or it cannot parse multiple BLOCK Option. It simply responds to each packet or responds to the packet represented by the first BLOCK Option, and the terminal can fall back to legacy mode without any changes.
  • the method and device for transmitting data packets provided by the embodiments of the present invention solve the problem of low efficiency when using BLOCK packet transmission for large resources when performing communication based on the CoAP protocol in a restricted environment, and the embodiment of the present invention Two aspects to improve this process.
  • One way is to use a transmission speed negotiation method.
  • the method negotiates an optimal data transmission speed between nodes on the link during transmission to ensure that each node on the link can work within the allowable range.
  • the capability bottleneck node is processed on the link.
  • efficient transfer of methods on known paths Ensure that the resources to be transmitted can be sent to the receiver as fast as possible, or ensure that resources are obtained from the remote end as quickly as possible.
  • This transmission speed negotiation method is only related to the processing capability of each node on the link, and is independent of the network state.
  • This node processing capability may be measured by multiple metrics such as CPU idle time, remaining memory, or multiple methods.
  • After the node obtains the processing capability it parses the message that needs to be processed or the message that needs to be transferred in the SendSpeed Option, and selects according to its own capabilities. Choose to accept the speed or adjust the speed. When the selection is accepted, the intermediate node remains the original
  • the SendSpeed value is forwarded unchanged, and the server has the same SendSpeed Option in the response.
  • the intermediate node replaces the original SendSpeed with an acceptable value in the forwarded packet, and the server replaces the original SendSpeed with an acceptable value in the response.
  • the terminal performs the corresponding speed-up or deceleration operation.
  • This method ensures that the resources of each node are fully utilized during the transmission process to transfer data as quickly as possible.
  • the terminal transmits the data packet at a relatively high speed, and the speed continues to rise.
  • the terminal transmission speed does not exceed the processing capability of the bottleneck node, and unnecessary retransmission is guaranteed.
  • Another way is to use an interval response negotiation method.
  • This method mainly senses the network packet loss rate, and adjusts the response interval according to the packet loss rate. When the packet loss rate is high, each packet needs to be responded. When the packet loss rate is low, multiple packets can be sent at a time before responding.
  • this method allows the channel to use more payload to transmit data. The number of times the response is reduced is used to increase channel utilization. In a relatively stable network, because the network has high credibility and the response interval is increasing, the channel is full of actual data, and the communication efficiency is high. In an unstable network with high packet loss rate, the method will eventually require a response to each packet to ensure that each packet is successfully transmitted before subsequent packet transmission. Avoid unnecessary retransmissions.
  • the embodiment of the present invention provides a method for speed negotiation in a multi-hop network, so that the method provided in the embodiment of the invention can be applied to a scenario involving transmission of multiple intermediate nodes.
  • the embodiment of the present invention also provides a processing manner for a node that does not support negotiation. It can be guaranteed to return to the traditional one-on-one BLOCK transmission scheme for the way that speed negotiation or response interval is not supported.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Provided are a data packet transmission method and device. The method comprises: a terminal sending a first request message to a first node, the first request message carrying first request transmission speed information, the first node being a server or an intermediate node; and the terminal receiving a response sent by the first node, obtaining feedback transmission speed information in the response of the first request message, and sending a second request message to the first node according to the transmission speed indicated by the feedback transmission speed information, the feedback transmission speed information being used for indicating the transmission speed which can be accepted by the first node, and the second request message carrying the second request transmission speed information. The data packet transmission method and device provided in the embodiments of the present invention achieve quick data transmission and increase the transmission efficiency.

Description

数据包的传输方法和设备 本申请要求于 2012年 5月 4 日提交中国专利局、 申请号为  Data packet transmission method and device The application request is submitted to the Chinese Patent Office on May 4, 2012, and the application number is
201210137429. 6 , 发明名称为 "数据包的传输方法和设备", 的中国专利申 请的优先权, 其全部内容通过引用结合在本申请中。 The priority of the Chinese patent application is hereby incorporated by reference.
技术领域 本发明实施例涉及通信技术, 尤其涉及一种数据包的传输方法和设备。 背景技术 The present invention relates to communications technologies, and in particular, to a data packet transmission method and device. Background technique
受限应用协议( Constrained Application Protocol,简称 CoAP )是 Internet 工程任务组 (Internet Engineering Task Force , 简称 IETF ) 的 CoRE ( Constrained RESTful Environment ) 工作组提出的一种轻量级和紧凑的通 信协议, 主要的应用场景是在受限环境中进行传输。 受限环境主要包括受 限网络和受限节点两个方面。 受限网络通常是指带宽低且丟包率高或者环 境不稳定的网络, 受限节点通常是指中央处理器 (Central Processing Unit, 简称 CPU )处理能力有限或者内存少的节点。  The Constrained Application Protocol (CoAP) is a lightweight and compact communication protocol proposed by the Internet Engineering Task Force (IETF) CoRe (Constrained RESTful Environment) working group. The application scenario is transmitted in a restricted environment. The restricted environment mainly includes two aspects: restricted network and restricted node. A restricted network usually refers to a network with low bandwidth and high packet loss rate or unstable environment. A restricted node usually refers to a central processing unit (CPU) with limited processing capacity or low memory.
在 CoAP协议中, 当需要发送大资源时釆用 BLOCK的传输方式, 这 种传输方式将大资源切片, 再将这些片逐个发送。 传统的 BLOCK传输方 式釆用一来一回的方式, 每次终端(Client )发送一个请求都必须等待服务 器( Server )返回一个响应( ACK )以后才进行下一个包的请求。 否则等待, 超时后进行重传。 这种传输方式大量时间浪费在等待和网络延迟上, 并不 是一种高效的传输方式。  In the CoAP protocol, when a large resource needs to be transmitted, the BLOCK transmission mode is used. This transmission method slices large resources and then transmits the slices one by one. The traditional BLOCK transmission method uses the one-to-one method. Each time a client sends a request, it must wait for the server (Server) to return a response (ACK) before proceeding to the next packet request. Otherwise wait, retransmit after timeout. This type of transmission wastes a lot of time on waiting and network delay, and is not an efficient transmission method.
在实际的使用环境中, 通过 CoAP协议传输的资源往往是不断发生变 化的, 对于过慢的传输速度来讲, 如果在緩慢的传输过程中资源已经发生 了变化, 那么对于接受方或者请求方来讲, 这样的数据可能已经没有什么 意义了。 有的资源具有很强的时效性, 如果不能在尽量短的时间内传输完 毕, 等资源传输结束, 可能已经过期了。 在现有受限环境中的 CoAP协议 的 BLOCK传输速度慢的前提下, 寻找一种能使其加速的方法就显得非常 重要了。 发明内容 本发明提实施例供一种数据包的传输方法和设备, 以提高传输效率。 本发明实施例提供一种数据包的传输方法, 所述数据包的传输方法基 于 CoAP协议, 包括: In the actual use environment, the resources transmitted through the CoAP protocol are constantly changing. For the slow transmission speed, if the resources have changed during the slow transmission, then the receiver or the requester Speaking, such data may not be meaningful anymore. Some resources have strong timeliness. If the transmission cannot be completed in the shortest possible time, the resource transmission may end, and may have expired. Under the premise that the BLOCK transmission speed of the CoAP protocol in the existing restricted environment is slow, it is very important to find a method that can accelerate it. SUMMARY OF THE INVENTION Embodiments of the present invention provide a method and apparatus for transmitting data packets to improve transmission efficiency. An embodiment of the present invention provides a data packet transmission method, where the data packet transmission method is based on a CoAP protocol, and includes:
终端向第一节点发送第一请求消息, 其中, 所述第一请求消息中携带 有第一请求传输速度信息, 所述第一节点为服务器或中间节点;  The terminal sends a first request message to the first node, where the first request message carries the first request transmission speed information, and the first node is a server or an intermediate node;
所述终端接收所述第一节点发送的响应, 获取所述第一请求消息的响 应中的第一反馈传输速度信息 , 根据所述第一反馈传输速度信息指示的传 输速度向所述第一节点发送第二请求消息, 其中, 所述第一反馈传输速度 信息用以指示所述第一节点能够接受的传输速度, 所述第二请求消息中携 带有第二请求传输速度信息。  Receiving, by the terminal, the response sent by the first node, acquiring first feedback transmission speed information in the response of the first request message, and transmitting, according to the transmission speed indicated by the first feedback transmission speed information, to the first node Sending a second request message, where the first feedback transmission speed information is used to indicate a transmission speed that the first node can accept, and the second request message carries second request transmission speed information.
本发明实施例提供一种数据包的传输方法, 所述数据包的传输方法基 于 CoAP协议, 包括:  An embodiment of the present invention provides a method for transmitting a data packet, where the data packet transmission method is based on a CoAP protocol, and includes:
服务器接收第二节点发送的请求消息, 其中, 所述请求消息中携带有 请求传输速度信息, 所述第二节点为终端或中间节点;  The server receives the request message sent by the second node, where the request message carries the request transmission speed information, and the second node is a terminal or an intermediate node;
所述服务器判断所述请求传输速度信息指示的传输速度是否为所述服 务器能够接受的传输速度, 若是, 则将所述请求传输速度信息作为反馈传 输速度信息, 若否, 则生成用以指示所述服务器能够接收的传输速度作为 反馈传输速度信息;  Determining, by the server, whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server, and if yes, using the requested transmission speed information as feedback transmission speed information, and if not, generating Describe the transmission speed that the server can receive as the feedback transmission speed information;
所述服务器根据所述反馈传输速度信息生成对应于所述请求消息的响 应, 向所述第二节点发送对应于所述请求消息的响应。  The server generates a response corresponding to the request message according to the feedback transmission speed information, and sends a response corresponding to the request message to the second node.
本发明实施例提供一种数据包的传输方法, 所述数据包的传输方法基 于 CoAP协议, 包括:  An embodiment of the present invention provides a method for transmitting a data packet, where the data packet transmission method is based on a CoAP protocol, and includes:
中间节点接收终端发送的第一请求消息, 其中, 所述第一请求消息中 携带有第一请求传输速度信息;  The intermediate node receives the first request message sent by the terminal, where the first request message carries the first request transmission speed information;
所述中间节点判断所述第一请求传输速度信息指示的传输速度是否为 所述中间节点能够接受的传输速度, 若是, 则将所述第一请求传输速度信 息作为中转的请求传输速度信息, 若否, 则生成用以指示所述中间节点能 够接受的传输速度作为中转的请求传输速度信息; 所述中间节点将所述中转的请求传输速度信息替换所述第一请求消息 中的第一请求传输速度信息, 向所述服务器转发携带有所述中转的请求传 输速度信息的中转的请求消息。 Determining, by the intermediate node, whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the first request transmission speed information as the requested transmission speed information of the relay, if No, generating a request transmission speed information indicating that the intermediate node can accept the transmission speed as the transit; And the intermediate node replaces the requested transmission speed information of the relay with the first request transmission speed information in the first request message, and forwards, to the server, a request message for relaying that carries the requested transmission speed information of the relay.
本发明实施例提供一种终端, 包括:  An embodiment of the present invention provides a terminal, including:
请求消息发送单元, 用于向第一节点发送第一请求消息, 其中, 所述 第一请求消息中携带有第一请求传输速度信息, 所述第一节点为服务器或 中间节点;  a request message sending unit, configured to send a first request message to the first node, where the first request message carries first request transmission speed information, where the first node is a server or an intermediate node;
响应处理单元, 用于接收所述第一节点发送的响应, 获取所述第一请 求消息的响应中的第一反馈传输速度信息, 以使所述请求消息发送单元根 据所述第一反馈传输速度信息指示的传输速度向所述第一节点发送第二请 求消息, 其中, 所述第一反馈传输速度信息用以指示所述第一节点能够接 受的传输速度, 所述第二请求消息中携带有第二请求传输速度信息。  a response processing unit, configured to receive a response sent by the first node, and obtain first feedback transmission speed information in a response of the first request message, so that the request message sending unit is configured according to the first feedback transmission speed The transmission speed indicated by the information is sent to the first node, where the first feedback transmission speed information is used to indicate a transmission speed that the first node can accept, and the second request message carries The second request transmits speed information.
本发明实施例提供一种服务器, 包括:  An embodiment of the present invention provides a server, including:
第一请求接收单元, 用于接收第二节点发送的请求消息, 其中, 所述 请求消息中携带有请求传输速度信息, 所述第二节点为终端或中间节点; 第一判断单元, 用于判断所述请求传输速度信息指示的传输速度是否 为所述服务器能够接受的传输速度, 若是, 则将所述请求传输速度信息作 为反馈传输速度信息, 若否, 则生成用以指示所述服务器能够接收的传输 速度作为反馈传输速度信息;  a first request receiving unit, configured to receive a request message sent by the second node, where the request message carries request transmission speed information, the second node is a terminal or an intermediate node, and the first determining unit is configured to determine Whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server, and if yes, using the requested transmission speed information as feedback transmission speed information, and if not, generating to indicate that the server can receive Transmission speed as feedback transmission speed information;
第一响应单元, 用于根据所述反馈传输速度信息生成对应于所述请求 消息的响应, 向所述第二节点发送对应于所述请求消息的响应。  And a first response unit, configured to generate a response corresponding to the request message according to the feedback transmission speed information, and send a response corresponding to the request message to the second node.
本发明实施例提供一种中间节点, 包括:  An embodiment of the present invention provides an intermediate node, including:
第一代理接收单元, 用于接收终端发送的第一请求消息, 其中, 所述 第一请求消息中携带有第一请求传输速度信息;  a first proxy receiving unit, configured to receive a first request message sent by the terminal, where the first request message carries first request transmission speed information;
第二判断单元, 用于判断所述第一请求传输速度信息指示的传输速度 是否为所述中间节点能够接受的传输速度, 若是, 则将所述第一请求传输 速度信息作为中转的请求传输速度信息, 若否, 则生成用以指示所述中间 节点能够接受的传输速度作为中转的请求传输速度信息;  a second determining unit, configured to determine whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the first request transmission speed information as a request transmission speed of the relay Information, if not, generating request transmission speed information indicating that the intermediate node can accept the transmission speed as the transit;
第一代理发送单元, 用于将所述中转的请求传输速度信息替换所述第 一请求消息中的第一请求传输速度信息, 向所述服务器转发携带有所述中 转的请求传输速度信息的中转的请求消息。 本发明实施例提供一种数据包的传输方法, 所述数据包的传输方法基 于 CoAP协议, 包括: a first proxy sending unit, configured to replace the transited request transmission speed information with the first request transmission speed information in the first request message, and forward the relay carrying the requested transmission speed information to the server Request message. An embodiment of the present invention provides a data packet transmission method, where the data packet transmission method is based on a CoAP protocol, and includes:
终端向服务器发送所述终端生成的通信请求消息, 其中, 所述通信请 求消息中携带有第一数据包请求指示信息或第一响应间隔指示信息, 所述 第一数据包请求指示信息指示至少两个向所述服务器获取的数据包信息, 所述第一响应间隔指示信息用以指示所述服务器在收到至少两个数据包后 口向应;  The terminal sends a communication request message generated by the terminal to the server, where the communication request message carries the first data packet request indication information or the first response interval indication information, where the first data packet request indication information indicates at least two Data packet information obtained by the server, the first response interval indication information is used to indicate that the server responds after receiving at least two data packets;
所述终端接收所述服务器发送的对应于所述通信请求消息的响应。 本发明实施例提供一种数据包的传输方法, 所述数据包的传输方法基 于 CoAP协议, 包括:  The terminal receives a response sent by the server corresponding to the communication request message. An embodiment of the present invention provides a method for transmitting a data packet, where the data packet transmission method is based on a CoAP protocol, and includes:
服务器接收终端发送的通信请求消息, 其中, 所述请求消息中携带有 数据包请求指示信息或响应间隔指示信息, 所述数据包请求指示信息具体 为至少两个向所述服务器获取的数据包信息, 所述响应间隔指示信息用以 指示所述服务器在收到至少两个数据包后响应;  The server receives the communication request message sent by the terminal, where the request message carries the data packet request indication information or the response interval indication information, where the data packet request indication information is specifically at least two data packet information acquired by the server. The response interval indication information is used to indicate that the server responds after receiving at least two data packets;
所述服务器对所述通信请求消息进行解析, 获取所述请求消息中的指 示信息, 根据所述指示信息向所述终端返回响应。  The server parses the communication request message, obtains the indication information in the request message, and returns a response to the terminal according to the indication information.
本发明实施例提供一种终端, 包括:  An embodiment of the present invention provides a terminal, including:
第一请求单元, 用于向服务器发送所述终端生成的通信请求消息, 其 中, 所述通信请求消息中携带有第一数据包请求指示信息或第一响应间隔 指示信息, 所述第一数据包请求指示信息指示至少两个向所述服务器获取 的数据包信息, 所述第一响应间隔指示信息用以指示所述服务器在收到至 少两个数据包后响应;  a first requesting unit, configured to send, to the server, a communication request message generated by the terminal, where the communication request message carries first data packet request indication information or first response interval indication information, the first data packet The request indication information indicates at least two pieces of data packet information acquired by the server, where the first response interval indication information is used to indicate that the server responds after receiving at least two data packets;
响应接收单元, 用于接收所述服务器发送的对应于所述通信请求消息 的响应。  And a response receiving unit, configured to receive a response sent by the server corresponding to the communication request message.
本发明实施例提供一种服务器, 包括:  An embodiment of the present invention provides a server, including:
第二请求接收单元, 用于接收终端发送的通信请求消息, 其中, 所述 请求消息中携带有数据包请求指示信息或响应间隔指示信息, 所述数据包 请求指示信息具体为至少两个向所述服务器获取的数据包信息, 所述响应 间隔指示信息用以指示所述 Λ良务器在收到至少两个数据包后响应;  a second request receiving unit, configured to receive a communication request message sent by the terminal, where the request message carries data packet request indication information or response interval indication information, where the data packet request indication information is specifically at least two directions Decoding the packet information obtained by the server, where the response interval indication information is used to indicate that the server responds after receiving at least two data packets;
第二响应单元, 用于对所述通信请求消息进行解析, 获取所述请求消 息中的指示信息, 根据所述指示信息向所述终端返回响应。 由上述技术方案可知, 本发明实施例提供的数据包的传输方法, 终端 向第一节点发送第一请求消息。 接收第一节点发送的对应于第一请求消息 的响应, 获取第一请求消息的响应中的第一反馈传输速度信息, 根据第一 反馈传输速度信息指示的传输速度向第一节点发送第二请求消息。 通过请 求传输速度信息的设置, 可以向服务器或中间节点请求传输速度, 中间节 点和服务器也可以根据自身能够接受的传输速度对该请求传输速度信息进 行修改, 并向终端进行反馈, 终端与中间节点或服务器实现速度协商, 可 以保证传输路径中的各个节点保持最高的传输效率, 实现了数据的快速传 输, 提高了传输效率。 And a second response unit, configured to parse the communication request message, obtain indication information in the request message, and return a response to the terminal according to the indication information. According to the foregoing technical solution, the method for transmitting a data packet provided by the embodiment of the present invention, the terminal sends the first request message to the first node. Receiving a response corresponding to the first request message sent by the first node, acquiring first feedback transmission speed information in the response of the first request message, and sending the second request to the first node according to the transmission speed indicated by the first feedback transmission speed information Message. By requesting the setting of the transmission speed information, the transmission speed can be requested from the server or the intermediate node, and the intermediate node and the server can also modify the request transmission speed information according to the transmission speed that can be accepted by itself, and feedback to the terminal, the terminal and the intermediate node. Or the server implements speed negotiation, which can ensure that each node in the transmission path maintains the highest transmission efficiency, realizes fast data transmission, and improves transmission efficiency.
本发明实施例提供的数据包的传输方法, 终端向服务器发送终端生成 的通信请求消息, 其中, 通信请求消息中携带有第一数据包请求指示信息 或第一响应间隔指示信息, 第一数据包请求指示信息指示至少两个向服务 器获取的数据包信息, 第一响应间隔指示信息用以指示服务器在收到至少 两个数据包后响应。 终端通过在通信请求消息中携带数据包请求指示信息 或响应间隔指示信息, 实现了终端与服务器的响应间隔能力的协商, 有效 利用了网络带宽, 提高了传输效率。 附图说明  In the data packet transmission method provided by the embodiment of the present invention, the terminal sends a communication request message generated by the terminal to the server, where the communication request message carries the first data packet request indication information or the first response interval indication information, and the first data packet The request indication information indicates at least two pieces of data packet information acquired by the server, and the first response interval indication information is used to indicate that the server responds after receiving at least two data packets. By carrying the data packet request indication information or the response interval indication information in the communication request message, the terminal realizes the negotiation of the response interval capability between the terminal and the server, effectively utilizes the network bandwidth, and improves the transmission efficiency. DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对 实施例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.
图 1为本发明实施例提供的第一种数据包的传输方法流程图; 图 2a为本发明实施例提供的一种数据包的传输方法的信令图; 图 2b为本发明实施例提供的另一种数据包的传输方法的信令图 图 3为本发明实施例提供的另一种数据包的传输方法的信令图; 图 4为本发明实施例提供的第二种数据包的传输方法流程图; 图 5为本发明实施例提供的第三种数据包的传输方法流程图; 图 6为本发明实施例提供的第四种数据包的传输方法流程图; 图 7a为本发明实施例提供的第一种终端结构示意图; 图 7b为本发明实施例提供的第二种终端结构示意图; 1 is a flowchart of a method for transmitting a first data packet according to an embodiment of the present invention; FIG. 2 is a signaling diagram of a method for transmitting a data packet according to an embodiment of the present invention; FIG. 3 is a signaling diagram of another method for transmitting a data packet according to an embodiment of the present invention; FIG. 4 is a second type of data packet transmission according to an embodiment of the present invention; FIG. 5 is a flowchart of a method for transmitting a third data packet according to an embodiment of the present invention; FIG. 6 is a flowchart of a method for transmitting a fourth data packet according to an embodiment of the present invention; A schematic diagram of the first terminal structure provided by the example; FIG. 7b is a schematic structural diagram of a second terminal according to an embodiment of the present disclosure;
图 8a为本发明实施例提供的第三种终端结构示意图;  FIG. 8 is a schematic structural diagram of a third terminal according to an embodiment of the present disclosure;
图 8b为本发明实施例提供的第四种终端结构示意图;  FIG. 8b is a schematic structural diagram of a fourth terminal according to an embodiment of the present disclosure;
图 9a为本发明实施例提供的第一种服务器结构示意图;  FIG. 9 is a schematic structural diagram of a first server according to an embodiment of the present disclosure;
图 9b为本发明实施例提供的第二种服务器结构示意图  FIG. 9b is a schematic structural diagram of a second server according to an embodiment of the present invention;
图 10 a为本发明实施例提供的第一种中间节点结构示意图;  FIG. 10 is a schematic structural diagram of a first intermediate node according to an embodiment of the present invention;
图 10 b为本发明实施例提供的第二种中间节点结构示意图  FIG. 10b is a schematic structural diagram of a second intermediate node according to an embodiment of the present invention;
图 11为本发明实施例提供的一种数据包的传输方法流程图;  FIG. 11 is a flowchart of a method for transmitting a data packet according to an embodiment of the present invention;
图 12为本发明实施例提供的另一种数据包的传输方法流程图; 图 13为本发明实施例提供的再一种数据包的传输方法的信令图;  FIG. 12 is a flowchart of another method for transmitting a data packet according to an embodiment of the present invention; FIG. 13 is a signaling diagram of still another method for transmitting a data packet according to an embodiment of the present invention;
图 14为本发明实施例提供的第五种终端结构示意图;  FIG. 14 is a schematic structural diagram of a fifth terminal according to an embodiment of the present disclosure;
图 15为本发明实施例提供的第三种服务器结构示意图;  FIG. 15 is a schematic structural diagram of a third server according to an embodiment of the present disclosure;
图 16为本发明实施例提供的传输处理流程图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。  FIG. 16 is a flowchart of a transmission process according to an embodiment of the present invention. The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. The embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例中的终端可以各种终端设备, 如手机, 计算机, PDA, 笔记本电脑, 远程控制器, 家用电器, 各种仪器仪表、 传感器等都可以作 为终端, 也可以作为中间节点。 此外, 本发明实施例的服务器可以为具有 处理器的各种计算机设备。  The terminal in the embodiment of the present invention can be used as a terminal or as an intermediate node for various terminal devices, such as mobile phones, computers, PDAs, notebook computers, remote controllers, household appliances, various instruments, sensors, and the like. Furthermore, the server of the embodiment of the present invention may be various computer devices having processors.
图 1 为本发明实施例提供的第一种数据包的传输方法流程图。 如图 1 的网络中终端与服务器之间的数据传输过程, 还可以应用于终端和服务器 之间设置有至少一个中间节点作为代理端的多跳环境的数据传输过程。 本 本实施例提供的数据包的传输方法具体包括: 步骤 C10、 终端向第一节点发送第一请求消息, 其中, 所述第一请求 消息中携带有第一请求传输速度信息, 所述第一节点为服务器或中间节点; 步骤 C20、 所述终端接收所述第一节点发送的响应, 获取所述第一请 求消息的响应中的第一反馈传输速度信息, 根据所述第一反馈传输速度信 息指示的传输速度向所述第一节点发送第二请求消息, 其中, 所述第一反 馈传输速度信息用以指示所述第一节点能够接受的传输速度, 所述第二请 求消息中携带有第二请求传输速度信息。 FIG. 1 is a flowchart of a method for transmitting a first data packet according to an embodiment of the present invention. The data transmission process between the terminal and the server in the network of FIG. 1 can also be applied to a data transmission process in which a multi-hop environment in which at least one intermediate node is set as a proxy between the terminal and the server is applied. The method for transmitting a data packet provided by this embodiment specifically includes: Step C10: The terminal sends a first request message to the first node, where the first request message carries the first request transmission speed information, where the first node is a server or an intermediate node; Step C20, the terminal receives Receiving, by the first node, the first feedback transmission speed information in the response of the first request message, and sending the second request to the first node according to the transmission speed indicated by the first feedback transmission speed information The message, where the first feedback transmission speed information is used to indicate a transmission speed that the first node can accept, and the second request message carries the second request transmission speed information.
本实施例中的第一节点为服务器或中间节点, 终端可以直接与服务器 进行通信, 也可以通过中间节点进行数据转发实现与服务器的通信。 终端 发送的第一请求消息 REQ或第二请求消息 REQ可以包括 GET请求消息和 PUT/POST请求消息, GET请求消息用于从服务器请求数据, PUT/POST 请求消息用于向服务器推送数据。 CoAP协议的请求消息的消息体通常包括 Header、 Option和 Payload三个部分, 其中 Header部分说明该消息的类型、 消息 id、 Option数量等。 Option部分是消息的其他可扩展的元数据部分。  The first node in this embodiment is a server or an intermediate node, and the terminal can directly communicate with the server, or can perform data forwarding through the intermediate node to implement communication with the server. The first request message REQ or the second request message REQ sent by the terminal may include a GET request message and a PUT/POST request message, the GET request message is used to request data from the server, and the PUT/POST request message is used to push data to the server. The message body of the request message of the CoAP protocol usually includes three parts: Header, Option, and Payload, where the Header part indicates the type of the message, the message id, the number of options, and the like. The Option section is the other extensible metadata part of the message.
Payload是该消息的净荷部分。 CoAP协议通过在 Option部分带有 BL0CK1 和 BL0CK2两个 Option来表示该消息是 BLOCK传输的一部分。 在一般的 GET请求消息中,使用 BL0CK2 Option让服务器在响应 ACK中带有数据, 在一般的 PUT/POST请求消息中, 通过 BL0CK1 Option把数据推送到服务 Payload is the payload part of the message. The CoAP protocol indicates that the message is part of the BLOCK transmission by having two Options BL0CK1 and BL0CK2 in the Option section. In the general GET request message, the BL0CK2 Option is used to make the server carry data in the response ACK. In the general PUT/POST request message, the data is pushed to the service through the BL0CK1 Option.
本实施例中的第一节点为服务器。 终端直接向服务器发送第一请求消 息或第二请求消息, 该第一请求消息中携带有第一请求传输速度信息, 第 一请求传输速度信息的设置方式具体可以为: 在第一请求消息的 Option部 分添加新的 Option, 该 Option名称具体可以为 SendSpeed, 用以表示请求 的传输速度,该传输速度可以用绝对速度来表示,例如, 1包 /s。该 SendSpeed Option只在 BLOCK传输的过程中有效。 The first node in this embodiment is a server. The terminal directly sends the first request message or the second request message to the server, where the first request message carries the first request transmission speed information, and the setting manner of the first request transmission speed information may specifically be: A new Option is added in part. The Option name can be SendSpeed, which is used to indicate the requested transmission speed. The transmission speed can be expressed by absolute speed, for example, 1 packet/s. The SendSpeed Option is only valid during the BLOCK transmission.
当服务器接收到该第一请求消息时, 对该第一请求消息进行解析, 获 取第一请求消息中的第一传输速度信息, 判断该解析得到的第一请求传输 速度信息指示的传输速度是否为自身能够接受的传输速度, 若是, 则将第 一请求传输速度信息作为反馈传输速度信息, 若否, 则生成用以指示服务 器能够接收的传输速度的反馈传输速度信息, 并根据该反馈传输速度信息 生成响应, 向终端发送该响应。 When the server receives the first request message, parsing the first request message, obtaining the first transmission speed information in the first request message, and determining whether the transmission speed indicated by the parsed first request transmission speed information is The transmission speed that can be accepted by itself, if yes, the first request transmission speed information is used as feedback transmission speed information, and if not, generating feedback transmission speed information indicating the transmission speed that the server can receive, and according to the feedback transmission speed information Generate a response and send the response to the terminal.
服务器在判断自身是否能够接收第一请求传输速度信息指示的传输速 度时, 可以获取服务器自身参数信息, 根据自身参数信息确定当前能够接 受的传输速度, 例如, 服务器可以根据中央处理器空闲时间来确定, 也可 以通过内存余量来确定, 还可以通过带宽占用信息或剩余存储空间来确定 , 不同的服务器可以根据自身的能力不同选择不同的自身能力度量的方法, 不以本实施例为限。  When the server determines whether it can receive the transmission speed indicated by the first request transmission speed information, the server may obtain the parameter information of the server itself, and determine the currently acceptable transmission speed according to the parameter information of the self. For example, the server may determine according to the idle time of the central processing unit. It can also be determined by the memory margin, and can also be determined by the bandwidth occupation information or the remaining storage space. Different servers can select different methods of their own capability metrics according to their own capabilities, which is not limited to this embodiment.
服务器根据反馈传输速度信息生成响应具体可以为, 在响应的 Option 部分添加新的 Option, 该 Option名称具体可以为 SendSpeed, 用以表示月良 务器可以接受的传输速度, 该传输速度也可以用绝对速度来表示。  The server may generate a response according to the feedback transmission speed information, and may add a new Option in the Option part of the response, and the Option name may be a SendSpeed, which is used to indicate a transmission speed acceptable to the server, and the transmission speed may also be absolute. Speed to indicate.
终端接收服务器发送的响应, 对该响应进行解析, 获取响应中的反馈 传输速度信息。 若该反馈传输速度信息指示的传输速度与之前在向服务器 发送的第一请求消息中的第一请求传输速度信息指示的传输速度相同, 说 明服务器可以接受该请求的传输速度, 则终端将向服务器的传输速度调整 到该反馈传输速度信息指示的传输速度。 若该反馈传输速度信息指示的传 输速度与之前在向服务器发送的第一请求消息中的第一请求传输速度信息 指示的传输速度不相同, 说明服务器不能接受该请求的传输速度, 且该反 馈传输速度信息指示的传输速度为服务器能够接受的传输速度, 则终端将 向服务器的传输速度调整到该反馈传输速度信息指示的传输速度。 终端使 用调整后的传输速度向服务器发送第二请求消息, 第二请求消息中携带有 第二请求传输速度信息。  The terminal receives the response sent by the server, parses the response, and obtains feedback transmission speed information in the response. If the transmission speed indicated by the feedback transmission speed information is the same as the transmission speed indicated by the first request transmission speed information in the first request message sent to the server, indicating that the server can accept the transmission speed of the request, the terminal will send the server to the server. The transmission speed is adjusted to the transmission speed indicated by the feedback transmission speed information. If the transmission speed indicated by the feedback transmission speed information is different from the transmission speed indicated by the first request transmission speed information in the first request message sent to the server, the server cannot accept the transmission speed of the request, and the feedback transmission The transmission speed indicated by the speed information is a transmission speed acceptable to the server, and the terminal adjusts the transmission speed to the server to the transmission speed indicated by the feedback transmission speed information. The terminal sends a second request message to the server by using the adjusted transmission speed, where the second request message carries the second request transmission speed information.
当服务器可以接受第一请求消息请求的传输速度时, 该第二请求传输 速度信息所指示的传输速度可以大于第一请求消息请求的传输速度。 当服 务器不能接受第一请求消息请求的传输速度时, 该第二请求传输速度信息 所指示的传输速度可以等于或略大于第一请求消息请求的传输速度。 由于 服务器可以接受的传输速度随着服务器自身的处理情况不断变化, 因此, 即使在服务器不能接受第一请求消息请求的传输速度时, 也可以在第二请 求消息中请求等于或略大于第一请求消息请求的传输速度, 以在服务器能 够接受该传输速度时, 及时调整终端的传输速度, 以充分利用服务器的处 理能力。  When the server can accept the transmission speed of the first request message request, the transmission speed indicated by the second request transmission speed information may be greater than the transmission speed of the first request message request. When the server cannot accept the transmission speed of the first request message request, the transmission speed indicated by the second request transmission speed information may be equal to or slightly larger than the transmission speed of the first request message request. Since the transfer speed that the server can accept varies with the processing of the server itself, even if the server cannot accept the transmission speed of the first request message request, the request may be equal to or slightly larger than the first request in the second request message. The transmission speed of the message request, in order to adjust the transmission speed of the terminal in time when the server can accept the transmission speed, so as to fully utilize the processing capability of the server.
实施方式二: 本实施例中的第一节点为中间节点。 终端发送的第一请求消息通过中 间节点转发给服务器, 服务器发送的响应通过中间节点发送给终端。 以终 端和服务器之间设置有一个中间节点为例: Embodiment 2: The first node in this embodiment is an intermediate node. The first request message sent by the terminal is forwarded to the server through the intermediate node, and the response sent by the server is sent to the terminal through the intermediate node. Take an intermediate node between the terminal and the server as an example:
终端发送第一请求消息, 该第一请求消息中携带有第一请求传输速度 信息, 第一请求传输速度信息的设置方式具体与上述实施方式相同。 当中 间节点接收到该第一请求消息时, 对第一请求消息进行解析, 获取第一请 求消息中的第一请求传输速度信息, 判断第一请求传输速度信息指示的传 输速度是否为该中间节点能够接受的传输速度, 若是, 则将第一请求传输 速度信息作为中转的请求传输速度信息, 若否, 则生成用以指示中间节点 能够接收的传输速度的中转的请求传输速度信息, 将中转的请求传输速度 信息替换第一请求消息中的第一请求传输速度信息生成中转的请求消息, 向服务器发送中转的请求消息。  The terminal sends a first request message, where the first request message carries the first request transmission speed information, and the setting manner of the first request transmission speed information is specifically the same as the foregoing embodiment. When the intermediate node receives the first request message, parsing the first request message, acquiring the first request transmission speed information in the first request message, and determining whether the transmission speed indicated by the first request transmission speed information is the intermediate node The acceptable transmission speed, if yes, the first request transmission speed information is used as the requested transmission speed information of the relay, and if not, the request transmission speed information for indicating the transmission speed of the transmission speed that the intermediate node can receive is generated, and the relay is transmitted. The request transmission speed information replaces the first request transmission speed information in the first request message to generate a relay request message, and sends a relay request message to the server.
服务器接收中间节点发送的请求消息, 对该请求消息进行解析, 获取 中转的请求消息中的中转的传输速度信息, 判断该解析得到的中转的请求 传输速度信息指示的传输速度是否为服务器能够接受的传输速度, 若是, 则将该中转的请求传输速度信息作为反馈传输速度信息, 若否, 则生成用 以指示服务器能够接收的传输速度的反馈传输速度信息, 并根据该反馈传 输速度信息生成响应, 向中间节点发送该响应。  The server receives the request message sent by the intermediate node, parses the request message, obtains the transit speed information in the relay request message, and determines whether the transmission speed indicated by the parsed transit request transmission speed information is acceptable to the server. a transmission speed, if yes, using the relayed request transmission speed information as feedback transmission speed information, and if not, generating feedback transmission speed information indicating a transmission speed that the server can receive, and generating a response according to the feedback transmission speed information, The response is sent to the intermediate node.
中间节点接收服务器发送的响应, 可以直接将该响应转发给终端, 也 可以对响应进行解析, 获取响应中的反馈传输速度信息, 判断反馈传输速 度信息指示的传输速度是否为中间节点能够接受的传输速度, 若是, 则将 反馈传输速度信息作为中转的反馈传输速度信息, 若否, 则生成用以指示 中间节点能够接收的传输速度的中转的反馈传输速度信息, 将中转的反馈 传输速度信息替换响应中的反馈传输速度信息生成中转的响应, 向终端转 发中转的响应。  The intermediate node receives the response sent by the server, and can directly forward the response to the terminal, or parse the response, obtain the feedback transmission speed information in the response, and determine whether the transmission speed indicated by the feedback transmission speed information is an acceptable transmission by the intermediate node. Speed, if yes, the feedback transmission speed information is used as the feedback transmission speed information of the relay, and if not, the feedback transmission speed information for indicating the transmission speed of the transmission speed that the intermediate node can receive is generated, and the feedback transmission speed information of the relay is replaced by the response. The feedback transmission speed information generates a relay response, and forwards the relay response to the terminal.
终端接收中间节点发送的响应, 对该响应进行解析, 获取响应中的中 转的反馈传输速度信息。 若该中转反馈传输速度信息指示的传输速度与第 一请求消息中请求传输速度信息指示的传输速度相同, 说明服务器以及中 间节点均可以接受该请求的传输速度, 则终端将发送速度调整到该反馈传 输速度信息指示的传输速度。 若该反馈传输速度信息指示的传输速度与第 一请求消息中请求传输速度信息指示的传输速度不相同, 说明服务器或中 间节点不能接受该请求的传输速度, 且该中转的反馈传输速度信息指示的 传输速度为服务器或中间节点能够接受的传输速度, 则终端将发送速度调 整到该中转的反馈传输速度信息指示的传输速度。 终端使用调整后的发送 速度发送第二请求消息, 第二请求消息中携带有第二请求传输速度信息。 The terminal receives the response sent by the intermediate node, parses the response, and obtains the feedback transmission speed information of the relay in the response. If the transmission speed indicated by the relay feedback transmission speed information is the same as the transmission speed indicated by the request transmission speed information in the first request message, indicating that the server and the intermediate node can accept the transmission speed of the request, the terminal adjusts the transmission speed to the feedback. The transmission speed indicated by the transmission speed information. If the transmission speed indicated by the feedback transmission speed information is different from the transmission speed indicated by the request transmission speed information in the first request message, the server or medium The inter-node cannot accept the transmission speed of the request, and the transmission speed indicated by the feedback transmission transmission speed information is a transmission speed that the server or the intermediate node can accept, and the terminal adjusts the transmission speed to the transmission indicated by the feedback transmission transmission speed information. speed. The terminal sends the second request message by using the adjusted sending speed, where the second request message carries the second request transmission speed information.
在本实施方式中, 中间节点确定自身能够接受的传输速度的方式具体 以及新的请求传输速度信息的设置方式可以与实施方式一中的实现方式相 同, 此不再赘述。 当终端和服务器之间设置有多个中间节点时, 终端、 多 个中间节点以及服务器之间的传输速度协商过程与上述过程类似, 此不再 赘述。 本实施例提供的数据包的传输方法, 终端向第一节点发送第一请求 消息。 接收第一节点发送的对应于第一请求消息的响应, 获取第一请求消 息的响应中的第一反馈传输速度信息, 根据第一反馈传输速度信息指示的 传输速度向第一节点发送第二请求消息。 通过请求传输速度信息的设置, 可以向服务器或中间节点请求传输速度, 中间节点和服务器也可以根据自 身能够接受的传输速度对该请求传输速度信息进行修改, 并向终端进行反 馈, 终端与中间节点或服务器实现速度协商, 可以保证传输路径中的各个 节点保持最高的传输效率, 实现了数据的快速传输, 提高了传输效率。  In this embodiment, the manner in which the intermediate node determines the transmission speed that the intermediate node can accept and the manner in which the new request transmission speed information is set can be the same as that in the first embodiment, and details are not described herein again. When a plurality of intermediate nodes are set between the terminal and the server, the process of negotiating the transmission speed between the terminal, the plurality of intermediate nodes, and the server is similar to the foregoing process, and details are not described herein. In the method for transmitting a data packet provided by this embodiment, the terminal sends a first request message to the first node. Receiving a response corresponding to the first request message sent by the first node, acquiring first feedback transmission speed information in the response of the first request message, and sending the second request to the first node according to the transmission speed indicated by the first feedback transmission speed information Message. By requesting the setting of the transmission speed information, the transmission speed can be requested from the server or the intermediate node, and the intermediate node and the server can also modify the request transmission speed information according to the transmission speed that can be accepted by itself, and feedback to the terminal, the terminal and the intermediate node. Or the server implements speed negotiation, which can ensure that each node in the transmission path maintains the highest transmission efficiency, realizes fast data transmission, and improves transmission efficiency.
在本实施例中, 步骤 C20中的, 所述终端根据所述第一反馈传输速度 信息指示的传输速度向所述第一节点发送第二请求消息之前, 具体还可以 包括如下步骤:  In this embodiment, before the sending, by the terminal, the second request message to the first node according to the transmission speed indicated by the first feedback transmission speed information, the terminal may further include the following steps:
若所述第一反馈传输速度信息指示的传输速度等于所述第一请求传输 速度信息指示的传输速度, 所述终端则将所述第一请求传输速度信息指示 的传输速度指数增长, 生成用以指示指数增长后的传输速度的所述第二请 求传输速度信息, 根据所述第二请求传输速度信息生成所述第二请求消息; 若所述第一反馈传输速度信息指示的传输速度小于所述第一请求传输 速度信息指示的传输速度, 所述终端则将所述第一请求传输速度信息指示 的传输速度线性增长, 生成用以指示线性增长后的传输速度的所述第二请 求传输速度信息, 根据所述第二请求传输速度信息生成所述第二请求消息。  And if the transmission speed indicated by the first feedback transmission speed information is equal to the transmission speed indicated by the first request transmission speed information, the terminal increases exponentially the transmission speed indicated by the first request transmission speed information, and generates The second request transmission speed information indicating an exponentially increasing transmission speed, generating the second request message according to the second request transmission speed information; if the first feedback transmission speed information indicates a transmission speed less than the Transmitting, by the terminal, a transmission speed indicated by the transmission speed information, the terminal linearly increasing the transmission speed indicated by the first request transmission speed information, and generating the second request transmission speed information to indicate a linearly increasing transmission speed And generating, according to the second request transmission speed information, the second request message.
本实施例提供了一种生成第二请求传输速度信息的方法, 其中, 若反 馈传输速度信息指示的传输速度等于第一请求传输速度信息指示的传输速 度, 说明服务器和中间节点均能接受该请求的传输速度, 则可以通过第二 请求消息请求一个更高的请求传输速度, 如本实施例所述的将第一请求传 输速度信息指示的传输速度指数增长, 可以通过指数函数来实现, 指数函 数例如为 y=exp(e),通过指数增长可以提高传输速度的增长速度, 以快速地 逼近服务器或中间节点能够接受的传输速度。 也可以将第一请求传输速度 信息指示的传输速度翻倍作为第二请求传输速度, 不以本实施例为限。 若 反馈传输速度信息指示的传输速度小于第一请求传输速度信息指示的传输 速度, 说明服务器或中间节点不能接受该请求的传输速度, 但是, 可以在 第二请求消息中携带一个稍高的传输速度, 如本实施例所述的将第一请求 传输速度信息指示的传输速度线性增长, 可以通过比例函数来实现, 比例 函数例如为 y=kx, k为正数。 以保持速度增长的可能性, 在服务器或中间 节点存在空闲的处理资源时, 可以接受该请求的传输速度, 以充分利用服 务器和中间节点的传输能力。 The embodiment provides a method for generating second request transmission speed information, wherein if the transmission speed indicated by the feedback transmission speed information is equal to the transmission speed indicated by the first request transmission speed information, the server and the intermediate node can accept the request. The transmission speed, then a higher request transmission speed can be requested by the second request message, and the first request is transmitted as described in this embodiment. The exponential growth of the transmission speed indicated by the transmission speed information can be realized by an exponential function, for example, y=exp(e), and the exponential growth can increase the growth speed of the transmission speed to quickly approach the server or the intermediate node to accept. transfer speed. It is also possible to double the transmission speed indicated by the first request transmission speed information as the second request transmission speed, which is not limited to the embodiment. If the transmission speed indicated by the feedback transmission speed information is smaller than the transmission speed indicated by the first request transmission speed information, the server or the intermediate node cannot accept the transmission speed of the request, but may carry a slightly higher transmission speed in the second request message. The linear transmission of the transmission speed indicated by the first request transmission speed information as described in this embodiment may be implemented by a proportional function, for example, y=kx, and k is a positive number. In order to maintain the possibility of speed increase, when there is idle processing resource in the server or intermediate node, the transmission speed of the request can be accepted to fully utilize the transmission capacity of the server and the intermediate node.
终端在提高请求的传输速度的过程中, 还可以考虑自身的能力和带宽 所允许的传输速度的范围, 该请求的传输速度通常不大于终端自身允许的 最高传输速度。  In the process of increasing the transmission speed of the request, the terminal may also consider the range of transmission speed allowed by its own capability and bandwidth. The transmission speed of the request is usually not greater than the maximum transmission speed allowed by the terminal itself.
在本实施例中, 所述第一请求消息和所述第二请求消息为 GET请求消 息, 所述 GET请求消息中还携带有请求的数据包信息。 相应地, 步骤 C20 中的, 所述终端接收所述第一节点发送的响应之后, 具体还可以包括如下 步骤:  In this embodiment, the first request message and the second request message are GET request messages, and the GET request message further carries the requested data packet information. Correspondingly, after receiving the response sent by the first node, the terminal may further include the following steps:
获取响应中的数据包, 对所述数据包进行相应地处理, 并更新数据包 接收日志。  The data packet in the response is obtained, the data packet is processed accordingly, and the data packet reception log is updated.
GET请求消息中携带有的请求的数据包信息具体用以指示终端向服务 器请求的数据包, 则服务器在接收到该 GET请求消息时, 在响应中携带有 相应的数据包。 终端对响应中的数据包进行相应地处理, 并更新数据包接 收日志, 以对数据包的接收情况进行记录。  The data packet information of the request carried in the GET request message is specifically used to indicate the data packet requested by the terminal to the server. When the server receives the GET request message, the server carries the corresponding data packet in the response. The terminal processes the data packet in the response accordingly, and updates the data packet reception log to record the reception status of the data packet.
在本实施例中, 所述第一请求消息为 PUT/POST第一请求消息, 所述 PUT/POST第一请求消息中还携带有数据包。 相应地, 步骤 C20中的, 所 述终端接收所述第一节点发送的响应之后, 具体还可以包括如下步骤: 更新数据包发送日志。  In this embodiment, the first request message is a PUT/POST first request message, and the PUT/POST first request message further carries a data packet. Correspondingly, after receiving the response sent by the first node, the terminal may further include the following steps: updating the data packet sending log.
PUT/POST请求消息携带有的数据包为终端向服务器推送的数据包,服 务器在接收到 PUT/POST请求消息时, 向终端返回响应, 以指示服务器已 经接收到该数据包。 终端根据响应更新数据包发送日志, 以对数据包的发 送情况进行记录。 The PUT/POST request message carries a data packet for the terminal to push the data packet to the server. When receiving the PUT/POST request message, the server returns a response to the terminal to indicate that the server has received the data packet. The terminal sends a log according to the response update packet to send the data packet. Send the situation for recording.
数据包接收日志和数据包发送日志具体可以记录在同一日志中, 通过 对数据包的接收情况和发送情况进行记录, 可以根据该日志对未接收到的 数据包或未发送成功的数据包重新请求, 提高了终端的请求发送的针对性 和调度性。  The packet receiving log and the data packet sending log may be recorded in the same log. By recording the receiving status and the sending status of the data packet, the unreceived data packet or the unsuccessful data packet may be re-requested according to the log. , improve the targeting and scheduling of the terminal's request transmission.
在本实施例中, 该数据包的传输方法具体还可以包括如下步骤: 所述终端若在向所述第一节点发送第一请求消息后预设时间内, 未接 收到所述第一节点发送的响应, 则向所述第一节点重新发送所述第一请求 消息。  In this embodiment, the method for transmitting the data packet may further include the following steps: if the terminal sends the first request message to the first node within a preset time, the first node does not receive the sending Responding to resending the first request message to the first node.
若该第一请求消息为 GET请求消息,终端在发送该 GET请求消息预设 时间内 ,未收到对应于该 GET请求消息的响应 ,则终端重新发送 GET请求 消息以请求未收到的数据包。 若该第一请求消息为 PUT/POST请求消息, 终端在发送该 PUT/POST请求消息预设时间内,未收到对应于该 PUT/POST 请求消息的响应 , 则终端重新发送 PUT/POST请求消息以重新发送未响应 的数据包。 示例一:  If the first request message is a GET request message, the terminal does not receive a response corresponding to the GET request message within a preset time period of sending the GET request message, and the terminal resends the GET request message to request the unreceived data packet. . If the first request message is a PUT/POST request message, the terminal does not receive a response corresponding to the PUT/POST request message within a preset time period of sending the PUT/POST request message, and the terminal resends the PUT/POST request message. To resend unresponsive packets. Example 1:
图 2a为本发明实施例提供的一种数据包的传输方法的信令图。如图 2a 所示,终端以一定的发送速度向服务器发送 GET请求消息 REO, GET请求 消息中携带有请求传输速度信息和请求的数据包信息,该发送速度例如为 1 包 /s , 该请求传输速度信息 SendSpeed指示的传输速度例如为 2包 /s , 请求 的数据包的 BlockID为 1。  2a is a signaling diagram of a method for transmitting a data packet according to an embodiment of the present invention. As shown in FIG. 2a, the terminal sends a GET request message REO to the server at a certain sending speed. The GET request message carries the request transmission speed information and the requested data packet information, and the sending speed is, for example, 1 packet/s, and the request transmission is performed. The transmission speed indicated by the speed information SendSpeed is, for example, 2 packets/s, and the block ID of the requested data packet is 1.
服务器接收到该 GET请求消息,对 GET请求消息进行解析,获知请求 传输速度信息 SendSpeed指示的传输速度为 2包 /s , 服务器判断 2包 /s为当 前可以接受的传输速度, 则生成用以指示传输速度为 2 包 /s的反馈传输速 度信息 SendSpeed, 并根据该反馈传输速度信息 SendSpeed和 BlockID为 1 的数据包生成响应 ACK, 并发送给终端。  The server receives the GET request message, parses the GET request message, and learns that the transmission speed indicated by the request transmission speed information SendSpeed is 2 packets/s, and the server determines that 2 packets/s is the currently acceptable transmission speed, and generates an indication for indicating The transmission speed is 2 packets/s feedback transmission speed information SendSpeed, and a response ACK is generated according to the feedback transmission speed information SendSpeed and the block ID 1 is sent to the terminal.
终端接收到该响应, 对响应进行解析, 对响应中携带的 BlockID 为 1 的数据包进行相应地处理, 并更新数据包接收日志。 同时终端可以获知 2 包 /s为服务器可以接受的传输速度, 则将请求的传输速度调整到 4包 /s , 并 分别生成用于请求 BlockID为 2和 BlockID为 3的数据包的 GET请求消息, 两个 GET请求消息中均携带有用以指示传输速度为 4包 /S的请求传输速度 信息 SendSpeed。 终端将上述两个 GET请求消息以 2包 /s的速度发送给服 务器。 The terminal receives the response, parses the response, processes the packet with the BlockID of 1 carried in the response, and updates the packet receiving log. At the same time, the terminal can know that 2 packets/s is a transmission speed acceptable to the server, and then adjusts the requested transmission speed to 4 packets/s, and generates a GET request message for requesting a packet with a BlockID of 2 and a BlockID of 3, respectively. Both GET request messages carry a request transmission speed information SendSpeed which is useful to indicate a transmission speed of 4 packets/s. The terminal sends the above two GET request messages to the server at a rate of 2 packets/s.
服务器接收到用于请求 BlocklD为 2的数据包的 GET请求消息时, 对 该 GET请求消息进行解析, 获知请求传输速度信息 SendSpeed指示的传输 速度为 4包 /s, 服务器判断当前自身能够接受的传输速度为 2包 /s, 则生成 用以指示该传输速度为 2包 /s的反馈传输速度信息 SendSpeed,生成携带有 BlocklD为 2的数据包的响应, 响应中携带有用以指示传输速度为 2包 /s的 反馈传输速度信息 SendSpeed。 服务器将该响应发送给终端。  When the server receives the GET request message for requesting the data packet of BlocklD 2, the GET request message is parsed, and the transmission speed indicated by the request transmission speed information SendSpeed is 4 packets/s, and the server determines the transmission that is currently acceptable to the server. When the speed is 2 packets/s, a feedback transmission speed information SendSpeed indicating that the transmission speed is 2 packets/s is generated, and a response carrying a packet with BlocklD 2 is generated, and the response carries a useful value to indicate that the transmission speed is 2 packets. /s feedback transmission speed information SendSpeed. The server sends the response to the terminal.
服务器接收到用于请求 BlocklD为 3的数据包的 GET请求消息时, 对 该 GET请求消息进行解析, 获知请求传输速度信息 SendSpeed指示的传输 速度为 4包 /s, 服务器判断当前自身能够接受的传输速度为 2包 /s, 则生成 用以指示该传输速度为 2包 /s的反馈传输速度信息 SendSpeed,生成携带有 BlocklD为 3的数据包的响应, 响应中携带有用以指示传输速度为 2包 /s的 反馈传输速度信息 SendSpeed。 服务器将该响应发送给终端。  When the server receives the GET request message for requesting the data packet of BlocklD to 3, the GET request message is parsed, and the transmission speed indicated by the request transmission speed information SendSpeed is 4 packets/s, and the server determines the transmission that is currently acceptable to the server. The speed is 2 packets/s, and the feedback transmission speed information SendSpeed is generated to indicate the transmission speed is 2 packets/s, and the response carrying the data packet carrying the Block1D is 3, and the response carries the information to indicate that the transmission speed is 2 packets. /s feedback transmission speed information SendSpeed. The server sends the response to the terminal.
终端依次接收服务器发送的两个响应, 对两个响应中分别携带的 BlocklD为 2和 BlocklD为 3的数据包进行相应地处理,并更新数据包接收 曰志。 同时终端可以获知 4包 /s 为服务器不能接受的传输速度, 2包 /s为服 务器可以接受的传输速度, 则将请求的传输速度调整到 3包 /s, 并分别生成 用于请求 BlocklD为 4和 BlocklD为 5的数据包的 GET请求消息,两个 GET 请求消息中均携带有用以指示传输速度为 3 包 /s 的请求传输速度信息 SendSpeed。 终端将上述两个 GET请求消息以 2包 /s的速度发送给服务器。  The terminal sequentially receives two responses sent by the server, and processes the data packets of BlocklD 2 and Block 1D respectively carried in the two responses, and updates the data packet reception. At the same time, the terminal can know that 4 packets/s is the transmission speed that the server cannot accept, and 2 packets/s is the transmission speed that the server can accept. Then the transmission speed of the request is adjusted to 3 packets/s, and respectively generated for requesting BlocklD to be 4 A GET request message with a packet of BlocklD of 5, both of which carry a request transmission speed information SendSpeed indicating a transmission speed of 3 packets/s. The terminal sends the above two GET request messages to the server at a rate of 2 packets/s.
服务器接收到用于请求 BlocklD为 4的数据包的 GET请求消息时, 对 该 GET请求消息进行解析, 获知请求传输速度信息 SendSpeed指示的传输 速度为 3包 /s, 服务器判断当前自身能够接受的传输速度为 2包 /s, 则生成 用以指示该传输速度为 2包 /s的反馈传输速度信息 SendSpeed,生成携带有 BlocklD为 4的数据包的响应, 响应中携带有用以指示传输速度为 2包 /s的 反馈传输速度信息 SendSpeed。 服务器将该响应发送给终端。  When the server receives the GET request message for requesting the data packet with the Block1D of 4, the GET request message is parsed, and the transmission speed indicated by the request transmission speed information SendSpeed is 3 packets/s, and the server determines the transmission that is currently acceptable to the server. When the speed is 2 packets/s, a feedback transmission speed information SendSpeed indicating that the transmission speed is 2 packets/s is generated, and a response carrying a packet with BlocklD of 4 is generated, and the response carries a useful value to indicate that the transmission speed is 2 packets. /s feedback transmission speed information SendSpeed. The server sends the response to the terminal.
服务器接收到用于请求 BlocklD为 5的数据包的 GET请求消息时, 对 该 GET请求消息进行解析, 获知请求传输速度信息 SendSpeed指示的传输 速度为 3包 /s, 服务器判断当前自身能够接受 3包 /s的传输速度, 则生成用 以指示该传输速度为 3 包 /s 的反馈传输速度信息 SendSpeed, 生成携带有 BlocklD为 5的数据包的响应, 响应中携带有用以指示传输速度为 3包 /s的 反馈传输速度信息 SendSpeed。 服务器将该响应发送给终端。 When the server receives the GET request message for requesting the data packet of BlocklD 5, the GET request message is parsed, and the transmission speed indicated by the request transmission speed information SendSpeed is 3 packets/s, and the server determines that it can accept 3 packets at present. /s transmission speed, then generated A response carrying a packet with a BlocklD of 5 is generated with the feedback transmission speed information SendSpeed indicating that the transmission speed is 3 packets/s, and the response carries a feedback transmission speed information SendSpeed indicating that the transmission speed is 3 packets/s. The server sends the response to the terminal.
终端依次接收服务器发送的两个响应, 对两个响应中分别携带的 BlocklD为 4和 BlocklD为 5的数据包进行相应地处理,并更新数据包接收 曰志。 由于携带有 BlocklD 为 5 的数据包的响应中的反馈传输速度信息 SendSpeed指示的传输速度为 3包 /s, 说明服务器从某一项其他任务中解放 出来, 则终端可以继续请求更高的传输速度。 但由于终端自身能力的限制, 5包 /s是终端允许的最高传输速度, 则新的请求消息中请求 5包 /s的传输速 度。 这样在终端和服务器能力允许的范围内, 传输速度会逐渐逼近两者中 能力较弱的节点可以接受的传输速度。  The terminal sequentially receives two responses sent by the server, and processes the data packets of BlocklD 4 and BlocklD 5 respectively carried in the two responses, and updates the data packet receiving message. Since the transmission speed indicated by the SendSpeed speed information in the response of the packet carrying the BlocklD of 5 is 3 packets/s, indicating that the server is freed from a certain other task, the terminal can continue to request a higher transmission speed. . However, due to the limitation of the terminal's own capabilities, 5 packets / s is the highest transmission speed allowed by the terminal, and the transmission rate of 5 packets / s is requested in the new request message. Thus, within the range allowed by the terminal and server capabilities, the transmission speed will gradually approach the transmission speed acceptable to the weaker nodes.
终端向服务器发送 PUT/POST请求消息时, 终端与服务器的传输速度 的协商过程与对 GET请求消息的处理过程类似, 此不再赘述。  When the terminal sends a PUT/POST request message to the server, the process of negotiating the transmission speed between the terminal and the server is similar to the process of processing the GET request message, and details are not described herein.
值得注意的是, 如图 2b所示, 在实际的实现过程中, 终端可以一定的 传输速度向服务器发送多个 GET请求消息,服务器接收到 GET请求消息时, 针对每一个 GET请求消息中的请求传输速度信息都会生成反馈传输速度信 息, 并通过响应将该反馈传输速度信息发送给终端, 以实现与终端的速度 协商。 终端在收到服务器返回的响应后, 再根据反馈传输速度信息调整下 一次 GET请求中的请求传输速度信息。 即, 终端在接收到服务器发送的响 应之前, 向服务器发送的 GET请求消息中携带的请求传输速度信息都可以 相同, 而终端接收到的响应可能是对应于之前发送的某一个请求消息的响 应。 而终端在收到服务器发送的响应之后, 向服务器发送的 GET请求是根 据最新接收到的服务器返回的响应中携带的反馈传输速度信息调整下一次 的 GET请求中的请求传输速度信息。  It should be noted that, as shown in FIG. 2b, in an actual implementation process, the terminal may send multiple GET request messages to the server at a certain transmission speed, and when the server receives the GET request message, the request in each GET request message is received. The transmission speed information generates feedback transmission speed information, and sends the feedback transmission speed information to the terminal in response to speed negotiation with the terminal. After receiving the response returned by the server, the terminal adjusts the request transmission speed information in the next GET request according to the feedback transmission speed information. That is, before the terminal receives the response sent by the server, the request transmission speed information carried in the GET request message sent to the server may be the same, and the response received by the terminal may be a response corresponding to a previously sent request message. After receiving the response sent by the server, the terminal sends a GET request to the server to adjust the requested transmission speed information in the next GET request according to the feedback transmission speed information carried in the response received by the newly received server.
示例二:  Example two:
图 3为本发明实施例提供的另一种数据包的传输方法的信令图。如图 3 所示, 该示例中请求消息以及响应的格式与上述示例相同, 此不再赘述, 本示例中仅对传输速度协商过程做描述。  FIG. 3 is a signaling diagram of another method for transmitting a data packet according to an embodiment of the present invention. As shown in FIG. 3, the format of the request message and the response in this example is the same as the above example, and details are not described herein again. In this example, only the transmission speed negotiation process is described.
在一种传输速度协商过程中, 终端以一定的发送速度向中间节点发送 GET请求消息, GET请求消息中携带有请求传输速度信息 SendSpeed指示 的传输速度为 1包 /s。 中间节点接收到该 GET请求消息,对 GET请求消息进行解析,获知请 求传输速度信息 SendSpeed指示的传输速度为 1包 /s, 1包 /s为当前自身可 以接受的传输速度, 则将 GET请求消息直接转发给服务器。 In a transmission speed negotiation process, the terminal sends a GET request message to the intermediate node at a certain transmission speed, and the GET request message carries the transmission speed indicated by the request transmission speed information SendSpeed as 1 packet/s. The intermediate node receives the GET request message, parses the GET request message, and learns that the transmission speed indicated by the request transmission speed information SendSpeed is 1 packet/s, and 1 packet/s is the transmission speed that is currently acceptable by itself, and the GET request message is sent. Forward directly to the server.
服务器接收到该 GET请求消息,对 GET请求消息进行解析,获知请求 传输速度信息 SendSpeed指示的传输速度为 1包 /s, 1包 /s为当前自身可以 接受的传输速度, 则生成携带有用以指示传输速度为 1 包 /s的反馈传输速 度信息 SendSpeed的响应, 将该响应发送给中间节点。  The server receives the GET request message, parses the GET request message, and knows that the transmission speed indicated by the request transmission speed information SendSpeed is 1 packet/s, and the 1 packet/s is the transmission speed that is currently acceptable by itself, and the generation is useful to indicate The response is a response of the transmission speed information SendSpeed of 1 packet/s, and the response is sent to the intermediate node.
中间节点接收该响应, 对响应进行解析, 获知反馈传输速度信息 SendSpeed指示的传输速度为 1 包 /s, 1 包 /s为当前自身可以接受的传输速 度, 则将响应直接转发给终端。  The intermediate node receives the response, parses the response, and knows that the transmission speed indicated by the feedback transmission speed information SendSpeed is 1 packet/s, and 1 packet/s is the transmission speed that is currently acceptable, and the response is directly forwarded to the terminal.
在另一种传输速度协商过程中, 终端以一定的发送速度向中间节点发 送 GET请求消息, GET请求消息中携带有请求传输速度信息 SendSpeed指 示的传输速度为 4包 /s。  In another transmission speed negotiation process, the terminal sends a GET request message to the intermediate node at a certain transmission speed, and the GET request message carries the requested transmission speed information, and the transmission speed indicated by SendSpeed is 4 packets/s.
中间节点接收到该 GET请求消息,对 GET请求消息进行解析,获知请 求传输速度信息 SendSpeed指示的传输速度为 4包 /s, 4包 /s为当前自身不 能接受的传输速度, 3包 /s为当前自身可以接受的传输速度, 则生成用以指 示传输速度为 3 包 /s的中转的请求传输速度信息 SendSpeed, 并替换 GET 请求消息中原来的请求传输速度信息 SendSpeed。 中间节点将该 GET请求 消息发送给服务器。  The intermediate node receives the GET request message, parses the GET request message, and knows that the transmission speed indicated by the request transmission speed information SendSpeed is 4 packets/s, and the 4 packets/s is the transmission speed that is not acceptable at present, and the 3 packets/s is At the current acceptable transmission speed, a request transmission speed information SendSpeed indicating a transmission speed of 3 packets/s is generated, and the original request transmission speed information SendSpeed in the GET request message is replaced. The intermediate node sends the GET request message to the server.
服务器接收到该 GET请求消息,对 GET请求消息进行解析,获知请求 传输速度信息 SendSpeed指示的传输速度为 3包 /s, 3包 /s为当前自身不能 接受的传输速度, 2包 /s为当前自身可以接受的传输速度, 则生成携带有用 以指示传输速度为 2包 /s的反馈传输速度信息 SendSpeed的响应,将该响应 发送给中间节点。  The server receives the GET request message, parses the GET request message, and knows that the transmission speed indicated by the request transmission speed information SendSpeed is 3 packets/s, 3 packets/s is the transmission speed that is not acceptable at present, and 2 packets/s is current. At a transmission speed that is acceptable for itself, a response carrying feedback transmission speed information SendSpeed indicating a transmission speed of 2 packets/s is generated, and the response is transmitted to the intermediate node.
中间节点接收该响应, 对响应进行解析, 获知反馈传输速度信息 SendSpeed指示的传输速度为 2包 /s, 2包 /s为当前自身可以接受的传输速 度, 则将响应直接转发给终端。  The intermediate node receives the response, parses the response, and knows that the transmission speed indicated by the feedback transmission speed information SendSpeed is 2 packets/s, and 2 packets/s is the transmission speed that is currently acceptable, and the response is directly forwarded to the terminal.
终端通过中间节点向服务器发送 PUT/POST请求消息时, 终端、 中间 节点和服务器之间的传输速度的协商过程与对 GET请求消息的处理过程类 似, 此不再赘述。  When the terminal sends a PUT/POST request message to the server through the intermediate node, the negotiation process of the transmission speed between the terminal, the intermediate node, and the server is similar to the process of processing the GET request message, and details are not described herein.
图 4 为本发明实施例提供的第二种数据包的传输方法流程图。 如图 4 的网络中终端与服务器之间的数据传输过程, 还可以应用于终端和服务器 之间设置有至少一个中间节点作为代理端的多跳环境的数据传输过程。 本 实施例提供的数据包的传输方法可以通过服务器来执行, 本实施例提供的 数据包的传输方法可以与本发明任意实施例提供的应用于终端侧的传输速 度协商方法配合实现, 其具体实现过程, 此不再赘述。 FIG. 4 is a flowchart of a method for transmitting a second type of data packet according to an embodiment of the present invention. Figure 4 The data transmission process between the terminal and the server in the network may also be applied to a data transmission process in which a multi-hop environment in which at least one intermediate node is provided as a proxy terminal between the terminal and the server. The method for transmitting a data packet provided in this embodiment may be implemented by using a server. The method for transmitting a data packet provided by this embodiment may be implemented in cooperation with a transmission speed negotiation method applied to the terminal side according to any embodiment of the present invention. Process, this will not go into details.
本实施例提供的数据包的传输方法具体包括:  The method for transmitting a data packet provided in this embodiment specifically includes:
步骤 S10、 服务器接收第二节点发送的请求消息, 其中, 所述请求消息 中携带有请求传输速度信息, 所述第二节点为终端或中间节点;  Step S10: The server receives the request message sent by the second node, where the request message carries the request transmission speed information, and the second node is a terminal or an intermediate node;
步骤 S20、所述服务器判断所述请求传输速度信息指示的传输速度是否 为所述服务器能够接受的传输速度, 若是, 则将所述请求传输速度信息作 为反馈传输速度信息, 若否, 则生成用以指示所述服务器能够接收的传输 速度作为反馈传输速度信息;  Step S20: The server determines whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server, and if yes, uses the requested transmission speed information as feedback transmission speed information, and if not, generates The transmission speed information indicating the transmission speed that the server can receive is used as the feedback transmission speed information;
步骤 S30、所述服务器根据所述反馈传输速度信息生成对应于所述请求 消息的响应, 向所述第二节点发送对应于所述请求消息的响应。  Step S30: The server generates a response corresponding to the request message according to the feedback transmission speed information, and sends a response corresponding to the request message to the second node.
本实施例提供的数据包的传输方法, 服务器接收第二节点发送的请求 消息。 判断请求传输速度信息指示的传输速度是否为服务器能够接受的传 输速度, 若是, 则将请求传输速度信息作为反馈传输速度信息, 若否, 则 生成用以指示服务器能够接收的传输速度的反馈传输速度信息。 根据反馈 传输速度信息生成对应于请求消息的响应, 向第二节点发送对应于请求消 息的响应。 通过请求传输速度信息的设置, 服务器接收到的请求消息中携 带有该请求传输速度信息, 服务器可以获知终端请求的传输速度或中间节 点可以接受的传输速度, 服务器也可以根据自身能够接受的传输速度对该 请求传输速度信息进行修改, 并向终端进行反馈, 终端与中间节点或服务 器实现速度协商, 可以保证传输路径中的各个节点保持最高的传输效率, 实现了数据的快速传输, 提高了传输效率。  In the method for transmitting a data packet provided by this embodiment, the server receives the request message sent by the second node. Determining whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server, and if so, requesting the transmission speed information as the feedback transmission speed information, and if not, generating a feedback transmission speed indicating the transmission speed that the server can receive information. A response corresponding to the request message is generated based on the feedback transmission speed information, and a response corresponding to the request message is transmitted to the second node. By requesting the setting of the transmission speed information, the request message received by the server carries the requested transmission speed information, and the server can know the transmission speed requested by the terminal or the transmission speed that the intermediate node can accept, and the server can also according to the transmission speed that can be accepted by the server. The request transmission speed information is modified, and feedback is sent to the terminal, and the terminal negotiates with the intermediate node or the server to ensure that each node in the transmission path maintains the highest transmission efficiency, realizes fast data transmission, and improves transmission efficiency. .
图 5 为本发明实施例提供的第三种数据包的传输方法流程图。 如图 5 所示, 在本实施例中, 步骤 S20 , 所述服务器判断所述请求传输速度信息指 示的传输速度是否为能够接受的传输速度之前, 具体还可以包括如下步骤: 步骤 S40、所述服务器获取所述服务器的参数信息,根据所述参数信息 确定所述服务器能够接受的传输速度, 其中, 所述参数信息包括以下至少 一种: 所述服务器的中央处理器空闲时间信息、 所述服务器的内存余量信 息和所述服务器的带宽占用信息。 FIG. 5 is a flowchart of a method for transmitting a third data packet according to an embodiment of the present invention. As shown in FIG. 5, in this embodiment, in step S20, the server may further include the following steps: before the server determines whether the transmission speed indicated by the request transmission speed information is an acceptable transmission speed. Step S40: Obtaining, by the server, parameter information of the server, and determining, according to the parameter information, a transmission speed that the server can accept, where the parameter information includes at least the following And a central processor idle time information of the server, a memory remaining amount information of the server, and bandwidth occupation information of the server.
服务器的中央处理器空闲时间信息、 内存余量信息和带宽占用信息均 为可以影响服务器传输能力的因素, 通过对上述参数信息中的至少一种进 行综合来确定服务器能够接受的传输速度, 可以提高传输速度确定的合理 性和准确性。  The central processing unit idle time information, the memory remaining information, and the bandwidth occupation information of the server are all factors that can affect the transmission capability of the server. By synthesizing at least one of the above parameter information, the transmission speed acceptable to the server can be determined, which can be improved. The rationality and accuracy of the transmission speed determination.
在本实施例中,所述请求消息为 GET请求消息,所述 GET请求消息中 还携带有请求的数据包信息。 相应地, 步骤 S30 中的所述服务器根据所述 反馈传输速度信息生成对应于所述请求消息的响应, 具体可以包括如下步 骤:  In this embodiment, the request message is a GET request message, and the GET request message further carries the requested data packet information. Correspondingly, the server in step S30 generates a response corresponding to the request message according to the feedback transmission speed information, which may specifically include the following steps:
所述服务器根据所述请求的数据包信息对应的数据包生成对应于所述 请求消息的响应, 将所述反馈传输速度信息添加到所述响应中。  And the server generates a response corresponding to the request message according to the data packet corresponding to the requested data packet information, and adds the feedback transmission speed information to the response.
在本实施例中,所述请求消息为 PUT/POST请求消息,所述 PUT/POST 请求消息中还携带有数据包。 相应地, 步骤 S30 中所述服务器根据所述反 馈传输速度信息生成对应于所述请求消息的响应, 具体可以包括如下步骤: 所述服务器生成用以指示收到所述 PUT/POST请求消息中的数据包的 响应, 将所述反馈传输速度信息添加到所述响应中。  In this embodiment, the request message is a PUT/POST request message, and the PUT/POST request message further carries a data packet. Correspondingly, the server in step S30 generates a response corresponding to the request message according to the feedback transmission speed information, which may specifically include the following steps: the server generates an indication to receive the PUT/POST request message. The response of the data packet is added to the response.
在本实施例中, 所述第二节点为终端, 所述请求消息为第一请求消息, 所述第一请求消息中携带有第一请求传输速度信息, 所述响应为所述第一 请求消息的响应; 或当所述第二节点为中间节点, 所述请求消息为中转的 请求消息, 所述中转的请求消息中携带有中转的请求传输速度信息, 所述 响应为所述中转的请求消息的响应。  In this embodiment, the second node is a terminal, and the request message is a first request message, where the first request message carries first request transmission speed information, and the response is the first request message. The request message is a transit request message, and the relay request message carries the requested transmission speed information, and the response is the transit request message. the response to.
图 6 为本发明实施例提供的第四种数据包的传输方法流程图。 如图 6 间设置有至少一个中间节点作为代理端的多跳环境的数据传输过程。 本实  FIG. 6 is a flowchart of a fourth method for transmitting a data packet according to an embodiment of the present invention. As shown in Figure 6, there is a data transmission process in which a multi-hop environment with at least one intermediate node as a proxy is set. Real
端侧和服务器侧的传输速度协商方法配合实现, 其具体实现过程, 此不再 赘述。 The transmission speed negotiation method on the end side and the server side is implemented in conjunction with the specific implementation process, which is not described here.
本实施例提供的一种数据包的传输方法具体包括:  A method for transmitting a data packet provided by this embodiment specifically includes:
步骤 N10、 中间节点接收终端发送的第一请求消息, 其中, 所述第一 请求消息中携带有第一请求传输速度信息; Step N10: The intermediate node receives a first request message sent by the terminal, where the first The request message carries the first request transmission speed information;
步骤 N20、 所述中间节点判断所述第一请求传输速度信息指示的传输 速度是否为所述中间节点能够接受的传输速度, 若是, 则将所述第一请求 传输速度信息作为中转的请求传输速度信息, 若否, 则生成用以指示所述 中间节点能够接受的传输速度作为中转的请求传输速度信息;  Step N20: The intermediate node determines whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the first request transmission speed information as a request transmission speed of the relay Information, if not, generating request transmission speed information indicating that the intermediate node can accept the transmission speed as the transit;
步骤 N30、 所述中间节点将所述中转的请求传输速度信息替换所述第 一请求消息中的第一请求传输速度信息, 向所述服务器转发携带有所述中 转的请求传输速度信息的中转的请求消息。  Step N30: The intermediate node replaces the transit request transmission speed information with the first request transmission speed information in the first request message, and forwards, to the server, the relay that carries the transit request transmission speed information. Request message.
步骤 N10到步骤 N30为中间节点对终端向服务器发送的请求消息的处 理过程。  Step N10 to Step N30 is a processing procedure of the request message sent by the intermediate node to the terminal to the server.
本实施例提供的数据包的传输方法, 中间节点接收终端发送的第一请 求消息, 其中, 第一请求消息中携带有第一请求传输速度信息。 判断第一 请求传输速度信息指示的传输速度是否为中间节点能够接受的传输速度, 若是, 则将第一请求传输速度信息作为中转的请求传输速度信息, 若否, 则生成用以指示中间节点能够接受的传输速度的中转的请求传输速度信 息。 将中转的请求传输速度信息替换第一请求消息中的第一请求传输速度 信息, 向服务器转发携带有中转的请求传输速度信息的中转的请求消息。 中间节点可以识别请求消息中的请求传输速度信息或响应中的反馈传输速 度信息, 并配合终端和服务器实现传输速度的协商, 可以保证传输路径中 的各个节点保持最高的传输效率, 实现了数据的快速传输, 提高了传输效 率。  In the data packet transmission method provided by this embodiment, the intermediate node receives the first request message sent by the terminal, where the first request message carries the first request transmission speed information. Determining whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if so, using the first request transmission speed information as the requested transmission speed information of the relay, and if not, generating an indication that the intermediate node can Transmitted request transmission speed information of the accepted transmission speed. The relayed request transmission speed information is replaced with the first request transmission speed information in the first request message, and the relayed request message carrying the relayed request transmission speed information is forwarded to the server. The intermediate node can identify the request transmission speed information in the request message or the feedback transmission speed information in the response, and cooperate with the terminal and the server to implement the negotiation of the transmission speed, so as to ensure that each node in the transmission path maintains the highest transmission efficiency and realizes the data. Fast transmission and improved transmission efficiency.
在本实施例中, 该数据包的传输方法进一步还可以包括如下步骤: 步骤 N40、 所述中间节点接收所述服务器发送的对应于所述中转的请 求消息的响应, 其中, 对应于所述中转的请求消息的响应中携带有反馈传 输速度信息;  In this embodiment, the method for transmitting the data packet may further include the following steps: Step N40: The intermediate node receives a response that is sent by the server and is corresponding to the request message of the relay, where The response of the request message carries feedback transmission speed information;
步骤 N50、 所述中间节点判断所述反馈传输速度信息指示的传输速度 是否为所述中间节点能够接受的传输速度, 若是, 则将所述反馈传输速度 信息作为中转的反馈传输速度信息, 若否, 则生成用以指示所述中间节点 能够接受的传输速度的中转的反馈传输速度信息;  Step N50: The intermediate node determines whether the transmission speed indicated by the feedback transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the feedback transmission speed information as the feedback transmission speed information of the relay, if not And generating feedback transmission speed information for indicating the transfer speed of the transmission speed acceptable to the intermediate node;
步骤 N60、 所述中间节点将所述中转的反馈传输速度信息替换所述响 应中的反馈传输速度信息 , 向所述终端转发携带有所述中转的反馈传输速 度信息的中转的响应。 Step N60: The intermediate node replaces the feedback transmission speed information of the relay with the feedback transmission speed information in the response, and forwards the feedback transmission speed carrying the relay to the terminal. The response of the transit of the information.
步骤 N40到步骤 N60为中间节点对服务器向终端发送的反馈的处理过 程。 中间节点具有解析能力, 可以获取请求消息中的请求传输速度信息或 响应中的反馈传输速度信息, 并根据自身能力对上述信息进行调整。  Step N40 to Step N60 is a process of processing the feedback sent by the intermediate node to the server to the terminal. The intermediate node has the resolving capability, and can obtain the request transmission speed information in the request message or the feedback transmission speed information in the response, and adjust the above information according to its own capabilities.
在本实施例中, 当终端和服务器之间设置有多个中间节点时, 该中间 节点之间的交互过程与上述过程类似, 此不再赘述。  In this embodiment, when a plurality of intermediate nodes are disposed between the terminal and the server, the interaction process between the intermediate nodes is similar to the foregoing process, and details are not described herein.
图 7a为本发明实施例提供的第一种终端结构示意图。如图 7a所示,本 实施例提供的终端 81具体可以实现本发明任意实施例提供的应用于终端 81 本实施例提供的终端 81具体包括请求消息发送单元 11和响应处理单 元 12。请求消息发送单元 11用于向第一节点 82发送第一请求消息, 其中, 所述第一请求消息中携带有第一请求传输速度信息, 所述第一节点 82为服 务器或中间节点。 响应处理单元 12用于接收所述第一节点 82发送的响应, 获取所述第一请求消息的响应中的第一反馈传输速度信息, 以使所述请求 消息发送单元 11根据所述第一反馈传输速度信息指示的传输速度向所述第 一节点 82发送第二请求消息, 其中, 所述第一反馈传输速度信息用以指示 所述第一节点 82能够接受的传输速度, 所述第二请求消息中携带有第二请 求传输速度信息。  FIG. 7 is a schematic structural diagram of a first terminal according to an embodiment of the present invention. As shown in FIG. 7a, the terminal 81 provided in this embodiment may be applied to the terminal 81 provided by any embodiment of the present invention. The terminal 81 provided in this embodiment specifically includes a request message sending unit 11 and a response processing unit 12. The request message sending unit 11 is configured to send a first request message to the first node 82, where the first request message carries the first request transmission speed information, and the first node 82 is a server or an intermediate node. The response processing unit 12 is configured to receive the response sent by the first node 82, and obtain the first feedback transmission speed information in the response of the first request message, so that the request message sending unit 11 is configured according to the first feedback. And transmitting, by the transmission speed information, a second request message to the first node 82, where the first feedback transmission speed information is used to indicate a transmission speed that the first node 82 can accept, the second request The message carries the second request transmission speed information.
本实施例提供的终端 81 , 请求消息发送单元 11向第一节点 82发送第 一请求消息, 响应处理单元 12接收所述第一节点 82发送的响应, 获取所 述第一请求消息的响应中的第一反馈传输速度信息, 以使所述请求消息发 送单元 11根据所述第一反馈传输速度信息指示的传输速度向所述第一节点 82发送第二请求消息。 通过请求传输速度信息的设置, 可以向服务器或中 间节点请求传输速度, 中间节点和服务器也可以根据自身能够接受的传输 速度对该请求传输速度信息进行修改, 并向终端 81进行反馈, 终端 81与 中间节点或服务器实现速度协商, 可以保证传输路径中的各个节点保持最 高的传输效率, 实现了数据的快速传输, 提高了传输效率。  In the terminal 81 provided by the embodiment, the request message sending unit 11 sends a first request message to the first node 82, and the response processing unit 12 receives the response sent by the first node 82, and obtains the response in the first request message. The first feedback transmission speed information is such that the request message transmitting unit 11 transmits a second request message to the first node 82 according to the transmission speed indicated by the first feedback transmission speed information. By requesting the setting of the transmission speed information, the transmission speed can be requested from the server or the intermediate node, and the intermediate node and the server can also modify the request transmission speed information according to the transmission speed that can be accepted by itself, and feedback to the terminal 81, and the terminal 81 and Speed negotiation between the intermediate node or the server ensures that each node in the transmission path maintains the highest transmission efficiency, realizes fast data transmission, and improves transmission efficiency.
图 7 b为本发明实施例提供的第二种终端的结构示意图, 包括存储器 701 , 和处理器 601。其中存储器 701用于存储图 7a所述的各单元, 处理器 601 与存储器 701连接, 运行存储器 701中的各单元执行存储器 701中各单元的相 应功能。 图 7b中存储器 701中各单元的功能与图 7a中的各单元的功能相同, 本发明实施例在此不再详述。 FIG. 7 is a schematic structural diagram of a second terminal according to an embodiment of the present invention, including a memory 701, and a processor 601. The memory 701 is used to store the units described in FIG. 7a, the processor 601 is connected to the memory 701, and each unit in the running memory 701 performs the corresponding function of each unit in the memory 701. The functions of the units in the memory 701 in FIG. 7b are the same as those of the units in FIG. 7a. The embodiments of the present invention are not described in detail herein.
图 8a为本发明实施例提供的第三种终端结构示意图。如图 8a所示,在 本实施例中, 所述响应处理单元 12具体还可以用于若所述第一反馈传输速 度信息指示的传输速度等于所述第一请求传输速度信息指示的传输速度, 则将所述第一请求传输速度信息指示的传输速度指数增长, 生成用以指示 指数增长后的传输速度的所述第二请求传输速度信息, 根据所述第二请求 传输速度信息生成所述第二请求消息; 若所述第一反馈传输速度信息指示 的传输速度小于所述第一请求传输速度信息指示的传输速度, 则将所述第 一请求传输速度信息指示的传输速度线性增长, 生成用以指示线性增长后 的传输速度的所述第二请求传输速度信息, 根据所述第二请求传输速度信 息生成所述第二请求消息。  FIG. 8 is a schematic structural diagram of a third terminal according to an embodiment of the present invention. As shown in FIG. 8a, in the embodiment, the response processing unit 12 may be further configured to: if the transmission speed indicated by the first feedback transmission speed information is equal to the transmission speed indicated by the first request transmission speed information, And exponentially increasing the transmission speed indicated by the first request transmission speed information, generating the second request transmission speed information to indicate an exponentially increasing transmission speed, and generating the first information according to the second request transmission speed information. a request message; if the transmission speed indicated by the first feedback transmission speed information is smaller than the transmission speed indicated by the first request transmission speed information, linearly increasing the transmission speed indicated by the first request transmission speed information, for generating The second request message is generated according to the second request transmission speed information with the second request transmission speed information indicating a linearly increasing transmission speed.
在本实施例中,所述第一请求消息为 GET请求消息,所述 GET请求消 息中还携带有请求的数据包信息。 相应地, 所述终端 81还可以包括第一处 理单元 13 , 第一处理单元 13用于获取响应中的数据包, 对所述数据包进行 相应地处理, 并更新数据包接收日志。  In this embodiment, the first request message is a GET request message, and the GET request message further carries the requested data packet information. Correspondingly, the terminal 81 may further include a first processing unit 13 for acquiring a data packet in the response, processing the data packet accordingly, and updating the data packet receiving log.
在本实施例中, 所述第一请求消息为 PUT/POST第一请求消息, 所述 PUT/POST第一请求消息中还携带有数据包。 相应地, 所述终端 81具体还 可以包括第二处理单元 14, 第二处理单元 14用于更新数据包发送日志。  In this embodiment, the first request message is a PUT/POST first request message, and the PUT/POST first request message further carries a data packet. Correspondingly, the terminal 81 may further include a second processing unit 14, and the second processing unit 14 is configured to update the data packet transmission log.
数据包接收日志和数据包发送日志具体可以记录在同一日志中, 通过 对数据包的接收情况和发送情况进行记录, 可以根据该日志对未接收到的 数据包或未发送成功的数据包重新请求, 提高了终端 81的请求发送的针对 性和调度性。  The packet receiving log and the data packet sending log may be recorded in the same log. By recording the receiving status and the sending status of the data packet, the unreceived data packet or the unsuccessful data packet may be re-requested according to the log. The targeting and scheduling of the request transmission by the terminal 81 are improved.
在本实施例中, 该终端 81还可以包括重新请求单元 15 , 重新请求单元 15用于若在向所述第一节点 82发送第一请求消息后预设时间内,未接收到 所述第一节点 82发送的响应, 则向所述第一节点 82重新发送所述第一请 求消息。 通过重新请求单元 15的设置, 可以避免由于数据包的丟失造成的 数据的不连贯性。  In this embodiment, the terminal 81 may further include a re-request unit 15 for not receiving the first time within a preset time after sending the first request message to the first node 82. The response sent by the node 82 resends the first request message to the first node 82. By re-requesting the settings of unit 15, it is possible to avoid data inconsistency due to packet loss.
图 8b为本发明实施例提供的第四种终端的结构示意图, 包括存储器 702, 和处理器 602。其中存储器 702用于存储图 8a所述的各单元, 处理器 602 与存储器 702连接, 运行存储器 702中的各单元执行存储器 702中各单元的相 应功能。 图 8b中存储器 702中各单元的功能与图 8a中的各单元的功能相同, 本发明实施例在此不再详述。 FIG. 8 is a schematic structural diagram of a fourth terminal according to an embodiment of the present invention, including a memory 702, and a processor 602. The memory 702 is used to store the units described in FIG. 8a, the processor 602 is connected to the memory 702, and each unit in the running memory 702 performs the corresponding function of each unit in the memory 702. The functions of the units in the memory 702 in FIG. 8b are the same as those of the units in FIG. 8a. The embodiments of the present invention are not described in detail herein.
图 9a为本发明实施例提供的第一种服务器结构示意图。 如图 9a所示, 本实施例提供的服务器 83具体可以实现本发明任意实施例提供的应用于服 述。  FIG. 9 is a schematic structural diagram of a first server according to an embodiment of the present invention. As shown in FIG. 9a, the server 83 provided in this embodiment may specifically implement the application provided by any embodiment of the present invention.
本实施例提供的服务器 83具体包括第一请求接收单元 21、第一判断单 元 22和第一响应单元 23。第一请求接收单元 21用于接收第二节点 84发送 的请求消息, 其中, 所述请求消息中携带有请求传输速度信息, 所述第二 节点 84为终端或中间节点。 第一判断单元 22用于判断所述请求传输速度 信息指示的传输速度是否为所述服务器 83能够接受的传输速度, 若是, 则 将所述请求传输速度信息作为反馈传输速度信息, 若否, 则生成用以指示 所述服务器 83能够接收的传输速度作为反馈传输速度信息。 第一响应单元 23用于根据所述反馈传输速度信息生成对应于所述请求消息的响应, 向所 述第二节点 84发送对应于所述请求消息的响应。  The server 83 provided in this embodiment specifically includes a first request receiving unit 21, a first determining unit 22, and a first response unit 23. The first request receiving unit 21 is configured to receive the request message sent by the second node 84, where the request message carries the requested transmission speed information, and the second node 84 is a terminal or an intermediate node. The first determining unit 22 is configured to determine whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server 83, and if yes, use the requested transmission speed information as feedback transmission speed information, and if not, A transmission speed indicating that the server 83 can receive is generated as feedback transmission speed information. The first response unit 23 is configured to generate a response corresponding to the request message according to the feedback transmission speed information, and send a response corresponding to the request message to the second node 84.
本实施例提供的服务器 83 , 第一请求接收单元 21接收第二节点 84发 送的请求消息, 第一判断单元 22判断所述请求传输速度信息指示的传输速 度是否为所述服务器 83能够接受的传输速度, 若是, 则将所述请求传输速 度信息作为反馈传输速度信息, 若否, 则生成用以指示所述服务器 83能够 接收的传输速度的反馈传输速度信息, 第一响应单元 23根据所述反馈传输 速度信息生成对应于所述请求消息的响应, 向所述第二节点 84发送对应于 所述请求消息的响应。 通过请求传输速度信息的设置, 服务器 83接收到的 请求消息中携带有该请求传输速度信息, 服务器 83可以获知终端请求的传 输速度或中间节点可以接受的传输速度, 服务器 83也可以根据自身能够接 受的传输速度对该请求传输速度信息进行修改, 并向终端进行反馈, 终端 与中间节点或服务器 83实现速度协商, 可以保证传输路径中的各个节点保 持最高的传输效率, 实现了数据的快速传输, 提高了传输效率。  In the server 83 provided by the embodiment, the first request receiving unit 21 receives the request message sent by the second node 84, and the first determining unit 22 determines whether the transmission speed indicated by the request transmission speed information is a transmission acceptable to the server 83. Speed, if yes, using the requested transmission speed information as feedback transmission speed information, and if not, generating feedback transmission speed information indicating a transmission speed that the server 83 can receive, the first response unit 23 according to the feedback The transmission speed information generates a response corresponding to the request message, and transmits a response corresponding to the request message to the second node 84. By requesting the setting of the transmission speed information, the request message received by the server 83 carries the requested transmission speed information, and the server 83 can know the transmission speed requested by the terminal or the transmission speed that the intermediate node can accept, and the server 83 can also accept according to itself. The transmission speed is modified by the request transmission speed information, and feedback is sent to the terminal, and the terminal negotiates with the intermediate node or the server 83 to ensure that each node in the transmission path maintains the highest transmission efficiency and realizes fast data transmission. Improve transmission efficiency.
进一步地, 在本实施例中, 该服务器还可以包括传输速度确定单元, 传输速度确定单元获取所述服务器的参数信息, 根据所述参数信息确定所 述服务器能够接受的传输速度, 其中, 所述参数信息包括以下至少一种: 所述服务器的中央处理器空闲时间信息、 所述服务器的内存余量信息和所 述服务器的带宽占用信息。 在本实施例中,所述请求消息为 GET请求消息,所述 GET请求消息中 还携带有请求的数据包信息。 相应地, 所述第一响应单元还用于根据所述 请求的数据包信息对应的数据包生成对应于所述请求消息的响应, 将所述 反馈传输速度信息添加到所述响应中。 Further, in this embodiment, the server may further include a transmission speed determining unit, where the transmission speed determining unit acquires parameter information of the server, and determines, according to the parameter information, a transmission speed that the server can accept, where The parameter information includes at least one of the following: central processor idle time information of the server, memory remaining amount information of the server, and bandwidth occupation information of the server. In this embodiment, the request message is a GET request message, and the GET request message further carries the requested data packet information. Correspondingly, the first response unit is further configured to generate a response corresponding to the request message according to the data packet corresponding to the requested data packet information, and add the feedback transmission speed information to the response.
在本实施例中,所述请求消息为 PUT/POST请求消息,所述 PUT/POST 请求消息中还携带有数据包。 相应地, 所述第一响应单元还用于生成用以 指示收到所述 PUT/POST请求消息中的数据包的响应, 将所述反馈传输速 度信息添加到所述响应中。  In this embodiment, the request message is a PUT/POST request message, and the PUT/POST request message further carries a data packet. Correspondingly, the first response unit is further configured to generate a response to indicate receipt of the data packet in the PUT/POST request message, and add the feedback transmission speed information to the response.
图 9b为本发明实施例提供的第二种服务器的结构示意图, 包括存储器 703 , 和处理器 603。 其中存储器 703用于存储图 9a所述的各单元, 处理器 603与存储器 703连接,运行存储器 703中的各单元执行存储器 703中各单 元的相应功能。 图 9b中存储器 703中各单元的功能与图 9a中的各单元的 功能相同, 本发明实施例在此不再详述。 图 10a为本发明实施例提供的第 一种中间节点结构示意图。 如图 10a所示, 本实施例提供的中间节点 85具 体可以实现本发明任意实施例提供的应用于中间节点的数据包的传输方法 的各个步骤, 此不再赘述。  FIG. 9b is a schematic structural diagram of a second server according to an embodiment of the present invention, including a memory 703, and a processor 603. The memory 703 is used to store the units described in FIG. 9a, the processor 603 is connected to the memory 703, and the units in the memory 703 execute the respective functions of the units in the memory 703. The functions of the units in the memory 703 in Fig. 9b are the same as those of the units in Fig. 9a, and the embodiments of the present invention will not be described in detail herein. FIG. 10a is a schematic structural diagram of a first intermediate node according to an embodiment of the present invention. As shown in FIG. 10a, the intermediate node 85 provided in this embodiment may implement various steps of the method for transmitting data packets applied to the intermediate node according to any embodiment of the present invention, and details are not described herein.
本实施例提供中间节点 85 包括第一代理接收单元 31、 第二判断单元 32和第一代理发送单元 33。 第一代理接收单元 31用于接收终端 81发送的 第一请求消息, 其中, 所述第一请求消息中携带有第一请求传输速度信息。 第二判断单元 32用于判断所述第一请求传输速度信息指示的传输速度是否 为所述中间节点 85能够接受的传输速度, 若是, 则将所述第一请求传输速 度信息作为中转的请求传输速度信息, 若否, 则生成用以指示所述中间节 点 85能够接受的传输速度作为中转的请求传输速度信息。 第一代理发送单 元 33用于将所述中转的请求传输速度信息替换所述第一请求消息中的第一 请求传输速度信息, 向所述服务器 83转发携带有所述中转的请求传输速度 信息的中转的请求消息。  The embodiment provides that the intermediate node 85 includes a first proxy receiving unit 31, a second judging unit 32, and a first proxy transmitting unit 33. The first proxy receiving unit 31 is configured to receive the first request message sent by the terminal 81, where the first request message carries the first request transmission speed information. The second determining unit 32 is configured to determine whether the transmission speed indicated by the first request transmission speed information is a transmission speed that the intermediate node 85 can accept, and if yes, transmit the first request transmission speed information as a request for transiting The speed information, if not, generates request transmission speed information indicating that the intermediate node 85 can accept the transmission speed as the relay. The first proxy sending unit 33 is configured to replace the transited request transmission speed information with the first request transmission speed information in the first request message, and forward the request transmission speed information carrying the transit to the server 83. Transit request message.
本实施例提供的中间节点 85 , 第一代理接收单元 31接收终端 81发送 的第一请求消息, 第二判断单元 32判断所述第一请求传输速度信息指示的 传输速度是否为所述中间节点 85能够接受的传输速度, 若是, 则将所述第 一请求传输速度信息作为中转的请求传输速度信息, 若否, 则生成用以指 示所述中间节点 85能够接受的传输速度的中转的请求传输速度信息, 第一 代理发送单元 33将所述中转的请求传输速度信息替换所述第一请求消息中 的第一请求传输速度信息, 向所述服务器 83转发携带有所述中转的请求传 输速度信息的中转的请求消息。 中间节点可以识别请求消息中的请求传输 速度信息或响应中的反馈传输速度信息, 并配合终端和服务器实现传输速 度的协商, 可以保证传输路径中的各个节点保持最高的传输效率, 实现了 数据的快速传输, 提高了传输效率。 In the intermediate node 85 provided by the embodiment, the first proxy receiving unit 31 receives the first request message sent by the terminal 81, and the second determining unit 32 determines whether the transmission speed indicated by the first request transmission speed information is the intermediate node 85. The acceptable transmission speed, if yes, the first request transmission speed information is used as the requested transmission speed information of the relay, and if not, the request transmission speed for instructing the transmission of the transmission speed acceptable to the intermediate node 85 is generated. Information, first The proxy sending unit 33 replaces the transited request transmission speed information with the first request transmission speed information in the first request message, and forwards the relay request message carrying the relayed request transmission speed information to the server 83. . The intermediate node can identify the request transmission speed information in the request message or the feedback transmission speed information in the response, and cooperate with the terminal and the server to implement the negotiation of the transmission speed, so as to ensure that each node in the transmission path maintains the highest transmission efficiency and realizes the data. Fast transmission and improved transmission efficiency.
在本实施例中, 该中间节点还可以包括第二代理接收单元、 第三判断 单元和第二代理发送单元。 第二代理接收单元用于接收所述服务器发送的 对应于所述中转的请求消息的响应, 其中, 对应于所述中转的请求消息的 响应中携带有反馈传输速度信息。 第三判断单元用于判断所述反馈传输速 度信息指示的传输速度是否为所述中间节点能够接受的传输速度, 若是, 则将所述反馈传输速度信息作为中转的反馈传输速度信息, 若否, 则生成 用以指示所述中间节点能够接受的传输速度的中转的反馈传输速度信息。 第二代理发送用于将所述中转的反馈传输速度信息替换所述响应中的反馈 传输速度信息, 向所述终端转发携带有所述中转的反馈传输速度信息的中 转的响应。  In this embodiment, the intermediate node may further include a second proxy receiving unit, a third determining unit, and a second proxy sending unit. The second proxy receiving unit is configured to receive a response that is sent by the server and is corresponding to the request message of the relay, where the response corresponding to the relayed request message carries feedback transmission speed information. The third determining unit is configured to determine whether the transmission speed indicated by the feedback transmission speed information is a transmission speed that the intermediate node can accept, and if yes, use the feedback transmission speed information as the feedback transmission speed information of the relay, and if not, Then, feedback transmission speed information is generated to indicate the transfer speed of the transmission speed that the intermediate node can accept. The second proxy transmits a feedback transmission speed information for replacing the relay to replace the feedback transmission speed information in the response, and forwards a response of the relay carrying the relayed feedback transmission speed information to the terminal.
图 10b为本发明实施例提供的第二种中间节点的结构示意图, 包括存 储器 704, 和处理器 604。 其中存储器 704用于存储图 10a所述的各单元, 处理器 604与存储器 704连接,运行存储器 704中的各单元执行存储器 704 中各单元的相应功能。 图 10b中存储器 704中各单元的功能与图 10a中的 各单元的功能相同, 本发明实施例在此不再详述。  FIG. 10b is a schematic structural diagram of a second intermediate node according to an embodiment of the present invention, including a memory 704, and a processor 604. The memory 704 is used to store the units described in FIG. 10a, the processor 604 is coupled to the memory 704, and the units operating the memory 704 perform the respective functions of the units in the memory 704. The functions of the units in the memory 704 in FIG. 10b are the same as those of the units in FIG. 10a, and the embodiments of the present invention are not described in detail herein.
在上述单元实施例中, 所包括的各个单元只是按照功能逻辑进行划分 的, 但并不局限于上述的划分, 只要能够实现相应的功能即可; 另外, 各 功能单元的具体名称也只是为了便于相互区分, 并不用于限制本发明的保 护范围。 上述实现数据包的传输方法中终端、 中间节点、 和服务器执行的 操作, 以及装置图中终端, 服务器和中间节点的各功能单元的功能均可以 由终端, 服务器和中间节点的处理器运行各单元完成,  In the above unit embodiment, each unit included is only divided according to functional logic, but is not limited to the above division, as long as the corresponding function can be realized; in addition, the specific names of the functional units are only for convenience. They are distinguished from each other and are not intended to limit the scope of protection of the present invention. The operations performed by the terminal, the intermediate node, and the server in the foregoing method for implementing the data packet transmission, and the functions of the functional units of the terminal, the server, and the intermediate node in the device map may be operated by the processor of the terminal, the server, and the intermediate node. carry out,
此外, 图 7a-图 8b的终端可以执行前述方法流程实施例中群组服务器执 行的任一步骤, 图 9a和图 9b中的服务器可以执行前述方法流程实施例中服 务器执行的任一步骤, 图 10a和图 10b的中间节点也可以执行前述方法流程 实施例中中间节点执行的任何步骤, 本发明在此不再——详述。 图 11 为本发明实施例提供的一种数据包的传输方法流程图。 如图 11 的网络中终端与服务器之间的数据传输过程, 还可以应用于终端和服务器 之间设置有至少一个中间节点作为代理端的多跳环境的数据传输过程。 本 本实施例提供的数据包的传输方法具体包括: In addition, the terminal of FIG. 7a-8b may perform any step performed by the group server in the foregoing method flow embodiment, and the server in FIG. 9a and FIG. 9b may perform any step performed by the server in the foregoing method flow embodiment, The intermediate nodes of 10a and 10b may also perform any of the steps performed by the intermediate nodes in the foregoing method flow embodiments, and the present invention is no longer described in detail. FIG. 11 is a flowchart of a method for transmitting a data packet according to an embodiment of the present invention. The data transmission process between the terminal and the server in the network of FIG. 11 can also be applied to a data transmission process in which a multi-hop environment in which at least one intermediate node is set as a proxy terminal between the terminal and the server. The method for transmitting a data packet provided by this embodiment specifically includes:
步骤 A10、 终端向服务器发送所述终端生成的通信请求消息, 其中, 所述通信请求消息中携带有第一数据包请求指示信息或第一响应间隔指示 信息, 所述第一数据包请求指示信息指示至少两个向所述服务器获取的数 据包信息, 所述第一响应间隔指示信息用以指示所述服务器在收到至少两 个数据包后响应;  Step A10: The terminal sends a communication request message generated by the terminal to the server, where the communication request message carries the first data packet request indication information or the first response interval indication information, and the first data packet request indication information And indicating at least two pieces of data packet information obtained by the server, where the first response interval indication information is used to indicate that the server responds after receiving at least two data packets;
步骤 A20、 所述终端接收所述服务器发送的对应于所述通信请求消息 的响应。  Step A20: The terminal receives a response sent by the server and corresponding to the communication request message.
具体地, 可以根据当前的网络状况设置第一数据包请求指示信息或第 一响应间隔指示信息。 第一数据包请求指示信息和第一响应间隔指示信息 具体针对于不同的通信请求消息。当通信请求消息为 GET通信请求消息时, GET通信请求消息中携带有数据包请求指示信息, 该数据包请求指示信息 用以指示向服务器一次请求的数据包的信息, 该数据包的数量为至少两个。 当通信请求消息为 PUT/POST通信请求消息时, PUT/POST通信请求消息 中携带有响应间隔指示信息, 该响应间隔指示信息用以指示服务器在接收 到响应间隔指示信息对应数量的数据包后返回响应, 该数量也为至少两个。  Specifically, the first data packet request indication information or the first response interval indication information may be set according to the current network condition. The first packet request indication information and the first response interval indication information are specifically directed to different communication request messages. When the communication request message is a GET communication request message, the GET communication request message carries data packet request indication information, where the data packet request indication information is used to indicate information of a data packet requested by the server at a time, the number of the data packet is at least Two. When the communication request message is a PUT/POST communication request message, the PUT/POST communication request message carries the response interval indication information, where the response interval indication information is used to indicate that the server returns after receiving the corresponding number of data packets of the response interval indication information. In response, the number is also at least two.
本实施例提供的数据包的传输方法, 终端向服务器发送终端生成的通 信请求消息, 其中, 通信请求消息中携带有第一数据包请求指示信息或第 一响应间隔指示信息, 第一数据包请求指示信息指示至少两个向服务器获 取的数据包信息, 第一响应间隔指示信息用以指示服务器在收到至少两个 数据包后响应。 终端通过在通信请求消息中携带数据包请求指示信息或响 应间隔指示信息, 实现了终端与服务器的响应间隔能力的协商, 有效利用 了网络带宽, 提高了传输效率。  In the data packet transmission method provided by the embodiment, the terminal sends a communication request message generated by the terminal to the server, where the communication request message carries the first data packet request indication information or the first response interval indication information, and the first data packet request The indication information indicates at least two pieces of packet information acquired to the server, and the first response interval indication information is used to instruct the server to respond after receiving at least two data packets. By carrying the data packet request indication information or the response interval indication information in the communication request message, the terminal realizes the negotiation of the response interval capability between the terminal and the server, effectively utilizes the network bandwidth, and improves the transmission efficiency.
在终端和服务器之间设置有至少一个中间节点作为代理端的多跳环境 中, 中间节点只对终端和服务器交互的数据进行转发处理。  In a multi-hop environment in which at least one intermediate node is provided as a proxy between the terminal and the server, the intermediate node only forwards the data exchanged between the terminal and the server.
在本实施例中, 所述通信请求消息为第一 GET通信请求消息; 所述方 法进一步包括: In this embodiment, the communication request message is a first GET communication request message; The law further includes:
步骤 A30、 所述终端根据第一数据包接收日志确定第一网络丟包率; 步骤 A10、 终端向服务器发送所述终端生成的通信请求消息, 包括: 所述终端根据所述第一网络丟包率生成所述第一数据包请求指示信 息,并生成所述第一 GET通信请求消息,所述第一 GET通信请求消息携带 所述第一数据包请求指示信息 , 若所述第一网络丟包率小于第一预设阔值 , 所述第一数据包请求指示信息指示至少两个向服务器获取的数据包信息; 向所述服务器发送所述第一 GET通信请求消息, 以使所述服务器根据所述 第一数据包请求指示信息发送携带有与所述第一数据包请求指示信息对应 的数据包的响应。  Step A30: The terminal determines, according to the first data packet receiving log, the first network packet loss rate. Step A10: The terminal sends the communication request message generated by the terminal to the server, where the terminal includes: the terminal according to the first network packet loss Generating the first data packet request indication information, and generating the first GET communication request message, where the first GET communication request message carries the first data packet request indication information, if the first network packet loss The first packet request indication information indicates at least two packet information acquired to the server; the first GET communication request message is sent to the server, so that the server is configured according to the server. The first data packet request indication information transmits a response carrying a data packet corresponding to the first data packet request indication information.
具体地, 第一 GET通信请求消息中携带有第一数据包请求指示信息, 第一数据包请求指示信息的设置方式具体可以为: 在第一 GET通信请求消 息的 Option部分添加新的 Option, 该 Option名称具体可以为 ACKGap, 用 以表示一次请求的数据包的数量。 通信请求消息中还携带有请求的数据包 的 BlockID。  Specifically, the first GET communication request message carries the first data packet request indication information, and the setting manner of the first data packet request indication information may be: adding a new Option in the Option part of the first GET communication request message, where The Option name can be ACKGap, which is used to indicate the number of packets requested at one time. The communication request message also carries the BlockID of the requested data packet.
第一网络丟包率可以反映出当前的网络情况, 终端中可以设置第一数 据包接收日志, 用以对数据包的接收情况进行记录。 终端可以根据第一数 据包接收日志确定第一网络丟包率。 当第一网络丟包率小于第一预设阔值 时, 可以说明当前网络状况不错, 则根据第一网络丟包率生成第一 GET通 信请求消息。  The first network packet loss rate can reflect the current network situation, and the first data packet reception log can be set in the terminal to record the data packet reception status. The terminal may determine the first network packet loss rate according to the first data packet receiving log. When the packet loss rate of the first network is less than the first preset threshold, the current network status is good, and the first GET communication request message is generated according to the first network packet loss rate.
当第一网络丟包率大于第一预设阔值时, 说明当前的网络情况不好, 则可以将第一数据包请求指示信息或第一响应间隔指示信息对应的数值设 置的较小的值, 如 1。 在第一 GET通信请求消息中一次请求一个数据包, 服务器发送一个携带有该请求的数据包的响应, 或者在第一 PUT/POST通 信请求消息携带有数值为 1 的第一响应间隔指示信息, 服务器根据该第一 响应间隔指示信息, 在接收到一个数据包后向终端反馈一个响应。 当前的 网络状况不错, 则可以将第一数据包请求指示信息或第一响应间隔指示信 息对应的数值设置的较大的值, 如 5。 在第一 GET通信请求消息中一次请 求五个数据包, 服务器发送五个携带有该请求的数据包的响应, 每个响应 中携带有一个数据包。或者在第一 PUT/POST通信请求消息携带有数值为 5 的第一响应间隔指示信息, 服务器根据该第一响应间隔指示信息, 在接收 到五个数据包后向终端反馈一个响应。 When the packet loss rate of the first network is greater than the first preset threshold, indicating that the current network condition is not good, the first data packet request indication information or the value corresponding to the first response interval indication information may be set to a smaller value. , such as 1. Requesting one data packet at a time in the first GET communication request message, the server sends a response carrying the data packet of the request, or the first PUT/POST communication request message carries the first response interval indication information with a value of 1, The server feeds back a response to the terminal after receiving a data packet according to the first response interval indication information. If the current network status is good, the first data packet request indication information or the value corresponding to the first response interval indication information may be set to a larger value, such as 5. In the first GET communication request message, five data packets are requested at a time, and the server sends five responses carrying the data packets of the request, and each response carries one data packet. Or the first PUT/POST communication request message carries the first response interval indication information with a value of 5, and the server receives the information according to the first response interval indication information. A response is fed back to the terminal after five packets.
可以根据釆集到的网络的传输情况建立网络丟包率与数据包请求指示 信息或响应间隔指示信息数值的对应关系, 以充分利用网络资源, 保证信 号的高效复用。 网络丟包率与数据包请求指示信息或响应间隔指示信息数 值的也可以呈反比关系, 以降低数据包请求指示信息或响应间隔指示信息 的设置难度。  The correspondence between the network packet loss rate and the data packet request indication information or the response interval indication information value may be established according to the transmission condition of the collected network, so as to fully utilize the network resources and ensure efficient multiplexing of the signals. The network packet loss rate and the data packet request indication information or the response interval indication information value may also be inversely related to reduce the difficulty of setting the data packet request indication information or the response interval indication information.
在本实施例中, 进一步地, 该数据包的传输方法还可以包括如下步骤: 步骤 A40、 所述终端根据第二数据包接收日志确定第二网络丟包率; 步骤 A50、 所述终端根据所述第二网络丟包率生成所述第二数据包请 求指示信息;  In this embodiment, the method for transmitting the data packet may further include the following steps: Step A40: The terminal determines a packet loss rate of the second network according to the second data packet receiving log. Step A50: Generating the second packet request indication information by using the second network packet loss rate;
若所述第二网络丟包率小于所述第一预设阔值, 所述第二数据请求指 示信息指示的向所述服务器获取的数据包的数量大于第一数据包请求指示 信息指示的向所述服务器获取的数据包的数量; 或, 若所述第二网络丟包 率大于第二预设域值, 所述第二数据请求指示信息指示的向所述服务器获 取的数据包的数量小于所述第一数据包请求指示信息指示的向所述服务器 获取的数据包的数量;  If the packet loss rate of the second network is smaller than the first preset threshold, the number of data packets acquired by the second data request indication information to the server is greater than the direction indicated by the first data packet request indication information. The number of data packets acquired by the server; or, if the second network packet loss rate is greater than the second preset domain value, the number of data packets obtained by the second data request indication information to the server is less than The first data packet request indication information indicates the number of data packets acquired by the server;
步骤 A60、所述终端生成第二 GET通信请求消息,所述第二 GET通信 请求消息携带所述第二数据包请求指示信息;  Step A60: The terminal generates a second GET communication request message, where the second GET communication request message carries the second data packet request indication information;
步骤 A70、 所述终端向所述服务器发送第二 GET通信请求消息, 以使 所述服务器根据所述第二数据包请求指示信息发送携带有与所述第二数据 包请求指示信息对应的数据包的响应。  Step A70: The terminal sends a second GET communication request message to the server, so that the server sends, according to the second data packet request indication information, a data packet that carries the information corresponding to the second data packet request indication information. the response to.
具体地, 第二数据包接收日志与第一数据包接收日志可以为同一日志, 第二网络丟包率可以反映出当前的网络情况, 若第二网络丟包率仍小于第 一预设阔值, 说明当前网络情况持续良好, 则可以向服务器请求的数据包 的数量大于上一次请求的数据包的数量。 若第二网络丟包率大于第二预设 阔值, 第二预设阔值大于第一预设阔值, 则说明当前网络状况变差, 则可 以向服务器请求的数据包的数量小于上一次请求的数据包的数量。  Specifically, the second data packet receiving log and the first data packet receiving log may be the same log, and the second network packet loss rate may reflect the current network condition, and if the second network packet loss rate is still less than the first preset threshold , indicating that the current network condition continues to be good, the number of packets that can be requested from the server is greater than the number of packets that were requested last time. If the second network packet loss rate is greater than the second preset threshold, and the second preset threshold is greater than the first preset threshold, the current network condition is deteriorated, and the number of data packets that can be requested from the server is smaller than the previous time. The number of requested packets.
在本实施例中, 所述通信请求消息为第一 PUT/POST通信请求消息; 所述方法进一步包括如下步骤:  In this embodiment, the communication request message is a first PUT/POST communication request message; the method further includes the following steps:
A31、 所述终端根据第一数据包发送日志确定第三网络丟包率;  A31. The terminal determines, according to the first data packet sending log, a third network packet loss rate.
A10、 终端向服务器发送所述终端生成的通信请求消息, 具体可以包括 如下步骤: A10. The terminal sends the communication request message generated by the terminal to the server, which may specifically include The following steps:
所述终端根据所述第三网络丟包率生成所述响应间隔指示信息, 根据 所述第一响应间隔指示信息生成所述第一 PUT/POST通信请求消息, 向所 述服务器发送所述第一 PUT/POST通信请求消息, 若所述第三网络丟包率 小于第一预设阔值, 所述第一响应间隔指示信息用以指示所述服务器在收 到至少两个数据包后响应; 以使所述服务器在接收到所述第一响应间隔指 示信息指示的数量的数据包后返回响应。  The terminal generates the response interval indication information according to the third network packet loss rate, generates the first PUT/POST communication request message according to the first response interval indication information, and sends the first message to the server. a PUT/POST communication request message, if the third network packet loss rate is less than a first preset threshold, the first response interval indication information is used to indicate that the server responds after receiving at least two data packets; And causing the server to return a response after receiving the number of data packets indicated by the first response interval indication information.
具体地, 第一 PUT/POST通信请求消息中携带有第一响应间隔指示信 息, 第一响应间隔指示信息的设置方式具体可以为: 在第一 PUT/POST通 信请求消息的 Option 部分添加新的 Option, 该 Option名称具体可以为 ACKGap, 用以指示服务器在接收到 ACKGap对应数值的数据包后返回响 应。  Specifically, the first PUT/POST communication request message carries the first response interval indication information, and the setting manner of the first response interval indication information may be: adding a new Option in the Option part of the first PUT/POST communication request message. The Option name may be specifically ACKGap, which is used to indicate that the server returns a response after receiving the data packet corresponding to the ACKGap value.
第三网络丟包率可以反映出当前的网络情况, 终端中可以设置第一数 据包发送日志, 用以对数据包的发送情况进行记录。 终端可以根据第一数 据包发送日志确定第三网络丟包率。 当第三网络丟包率小于第一预设阔值 时, 可以说明当前网络状况不错, 则根据第三网络丟包率生成第一 PUT/POST通信请求消息。  The third network packet loss rate can reflect the current network situation, and the first data packet transmission log can be set in the terminal to record the data packet transmission. The terminal may determine the third network packet loss rate according to the first data packet sending log. When the packet loss rate of the third network is less than the first preset threshold, it may be stated that the current network condition is good, and the first PUT/POST communication request message is generated according to the third network packet loss rate.
在本实施例中, 该数据包的传输方法还可以包括如下步骤:  In this embodiment, the method for transmitting the data packet may further include the following steps:
A41、 所述终端根据第二数据包发送日志确定第四网络丟包率;  A41. The terminal determines, according to the second data packet sending log, a packet loss rate of the fourth network.
A51、所述终端根据所述第四网络丟包率生成所述第二响应间隔指示信 息;  A51. The terminal generates the second response interval indication information according to the fourth network packet loss rate.
若所述第四网络丟包率小于所述第一预设阔值, 所述第二响应间隔指 示信息指示的数量大于所述第一响应间隔指示信息指示的数量; 或, 若第 四网络丟包率大于第二预设域值, 所述第二响应间隔指示信息指示的数量 小于所述第一响应间隔指示信息指示的数量;  If the fourth network packet loss rate is smaller than the first preset threshold, the number of the second response interval indication information indication is greater than the number indicated by the first response interval indication information; or, if the fourth network is lost The packet rate is greater than the second preset field value, and the quantity indicated by the second response interval indication information is smaller than the number indicated by the first response interval indication information;
A61、 所述终端根据所述第二响应间隔指示信息生成第二 PUT/POST 通信请求消息, 向所述服务器发送所述第二 PUT/POST通信请求消息; 以 使所述服务器在接收到所述第二响应间隔指示信息指示的数量的数据包后 返回响应。  A61. The terminal generates a second PUT/POST communication request message according to the second response interval indication information, and sends the second PUT/POST communication request message to the server, so that the server receives the The second response interval indicates the number of packets indicated by the information and returns a response.
具体地, 第二数据包发送日志与第一数据包发送日志可以为同一曰志, 第四网络丟包率可以反映出当前的网络情况, 若第四网络丟包率仍小于第 一预设阔值, 说明当前网络情况持续良好, 则可以向服务器请求的响应间 隔大于上一次请求的响应间隔。 若第四网络丟包率大于第二预设阔值, 第 二预设阔值大于第一预设阔值, 则说明当前网络状况变差, 则可以向服务 器请求的响应间隔小于上一次请求的响应间隔。 Specifically, the second data packet sending log and the first data packet sending log may be the same, and the fourth network packet loss rate may reflect the current network condition, and if the fourth network packet loss rate is still less than the first A preset threshold indicates that the current network condition continues to be good, and the response interval that can be requested from the server is greater than the response interval of the previous request. If the packet loss rate of the fourth network is greater than the second preset threshold, and the second preset threshold is greater than the first preset threshold, the current network condition is deteriorated, and the response interval that can be requested from the server is smaller than the previous request. Response interval.
在本实施例中, 上述步骤中的所述终端根据所述第一网络丟包率生成 所述第一数据包请求指示信息, 具体可以包括如下步骤:  In this embodiment, the terminal in the foregoing step, according to the first network packet loss rate, generates the first data packet request indication information, which may specifically include the following steps:
所述终端根据所述第一网络丟包率的反比生成所述第一数据包请求指 示信息。  The terminal generates the first data packet request indication information according to an inverse ratio of the first network packet loss ratio.
在本实施例中, 上述步骤中的所述终端根据所述第三网络丟包率生成 第一响应间隔指示信息, 具体可以包括如下步骤:  In this embodiment, the terminal in the foregoing step generates the first response interval indication information according to the third network packet loss rate, and specifically includes the following steps:
所述终端根据所述第三网络丟包率的反比生成所述第一响应间隔指示 信息。  The terminal generates the first response interval indication information according to an inverse ratio of the third network packet loss rate.
图 12为本发明实施例提供的另一种数据包的传输方法流程图。如图 12 的网络中终端与服务器之间的数据传输过程, 还可以应用于终端和服务器 之间设置有至少一个中间节点作为代理端的多跳环境的数据传输过程。 本 实施例提供的数据包的传输方法可以通过服务器来执行。 本实施例提供的 的协商, 其具体实现过程在此不再赘述。  FIG. 12 is a flowchart of another method for transmitting a data packet according to an embodiment of the present invention. The data transmission process between the terminal and the server in the network of FIG. 12 can also be applied to a data transmission process in which a multi-hop environment in which at least one intermediate node is set as a proxy end between the terminal and the server is used. The method for transmitting a data packet provided by this embodiment can be performed by a server. The specific implementation process of the negotiation provided in this embodiment is not described here.
本实施例提供的数据包的传输方法具体包括:  The method for transmitting a data packet provided in this embodiment specifically includes:
步骤 B10、 服务器接收终端发送的通信请求消息, 其中, 所述请求消 息中携带有数据包请求指示信息或响应间隔指示信息, 所述数据包请求指 示信息具体为至少两个向所述服务器获取的数据包信息, 所述响应间隔指 示信息用以指示所述 Λ良务器在收到至少两个数据包后响应;  Step B10: The server receives the communication request message sent by the terminal, where the request message carries the data packet request indication information or the response interval indication information, where the data packet request indication information is specifically at least two acquired by the server. Data packet information, the response interval indication information is used to indicate that the server responds after receiving at least two data packets;
步骤 B20、 所述服务器对所述通信请求消息进行解析, 获取所述请求 消息中的指示信息, 根据所述指示信息向所述终端返回响应。  Step B20: The server parses the communication request message, obtains the indication information in the request message, and returns a response to the terminal according to the indication information.
本实施例提供的数据包的传输方法, 服务器接收终端发送的通信请求 消息, 其中, 所述请求消息中携带有数据包请求指示信息或响应间隔指示 信息, 所述数据包请求指示信息具体为至少两个向所述服务器获取的数据 包信息, 所述响应间隔指示信息用以指示所述服务器在收到至少两个数据 包后响应, 对所述通信请求消息进行解析, 获取所述请求消息中的指示信 息, 根据所述指示信息向所述终端返回响应, 终端通过在通信请求消息中 携带数据包请求指示信息或响应间隔指示信息, 以使服务器根据指示信息 返回响应, 实现了终端与服务器的响应间隔能力的协商, 有效利用了网络 带宽, 提高了传输效率。 In the data packet transmission method provided by the embodiment, the server receives the communication request message sent by the terminal, where the request message carries the data packet request indication information or the response interval indication information, where the data packet request indication information is at least Two data packet information obtained by the server, the response interval indication information is used to indicate that the server responds after receiving at least two data packets, parsing the communication request message, and acquiring the request message. Direction letter And returning a response to the terminal according to the indication information, and the terminal carries the data packet request indication information or the response interval indication information in the communication request message, so that the server returns a response according to the indication information, and the response interval between the terminal and the server is realized. The negotiation of capabilities effectively utilizes network bandwidth and improves transmission efficiency.
在本实施例中, 所述通信请求消息为 GET 通信请求消息, 所述 GET 通信请求消息中携带有数据包请求指示信息。 相应地, 步骤 B20中的, 所 述服务器获取所述请求消息中的指示信息, 根据所述指示信息向所述终端 返回响应, 具体可以包括如下步骤:  In this embodiment, the communication request message is a GET communication request message, and the GET communication request message carries data packet request indication information. Correspondingly, in step B20, the server obtains the indication information in the request message, and returns a response to the terminal according to the indication information, which may include the following steps:
所述服务器获取所述 GET通信请求消息中的数据包请求指示信息指示 至少两个向所述服务器获取的数据包信息, 根据所述向服务器获取的数据 包信息对应的数据包生成至少两个响应, 向所述终端发送所述至少两个响 应, 其中, 每个所述响应中携带一个数据包。  Obtaining, by the server, the data packet request indication information in the GET communication request message, indicating at least two data packet information acquired by the server, and generating at least two responses according to the data packet corresponding to the data packet information acquired by the server. Sending the at least two responses to the terminal, where each of the responses carries one data packet.
在本实施例中, 所述请求消息为 PUT/POST 通信请求消息, 所述 PUT/POST 通信请求消息中携带有响应间隔指示信息和一个数据包。 相应 地, 步骤 B20中的, 所述服务器获取所述请求消息中的指示信息, 根据所 述指示信息向所述终端返回响应, 具体可以包括如下步骤:  In this embodiment, the request message is a PUT/POST communication request message, and the PUT/POST communication request message carries response interval indication information and a data packet. Correspondingly, in step B20, the server obtains the indication information in the request message, and returns a response to the terminal according to the indication information, which may include the following steps:
所述服务器获取所述 PUT/POST通信请求消息中的响应间隔指示信息, 在接收到所述响应间隔指示信息对应数量的数据包后, 向所述终端发送所 述响应。  The server acquires the response interval indication information in the PUT/POST communication request message, and after receiving the data packet corresponding to the response interval indication information, sends the response to the terminal.
在本实施例中, 所述通信请求消息为 PUT/POST通信请求消息时, 终 端向服务器推送数据包, 当网络状况较差时, 服务器可能接收不到终端发 送的数据包。则还可以通过下述方式进行处理: 所述请求消息为 PUT/POST 通信请求消息, 所述 PUT/POST通信请求消息中携带有响应间隔指示信息 和一个数据包。 相应地, 步骤 B20中的, 所述服务器获取所述请求消息中 的指示信息, 根据所述指示信息向所述终端返回响应, 具体可以包括如下 步骤:  In this embodiment, when the communication request message is a PUT/POST communication request message, the terminal pushes the data packet to the server. When the network condition is poor, the server may not receive the data packet sent by the terminal. Then, the processing may be performed by: the request message is a PUT/POST communication request message, and the PUT/POST communication request message carries response interval indication information and a data packet. Correspondingly, in step B20, the server obtains the indication information in the request message, and returns a response to the terminal according to the indication information, which may include the following steps:
所述服务器在上一次向所述终端返回响应时启动定时器, 进行预设时 间的定时;  The server starts a timer when returning a response to the terminal last time, and performs timing of a preset time;
所述服务器在所述预设时间结束前, 当接收到所述响应间隔指示信息 对应数量的数据包时,向所述终端发送数据包接收成功响应; 或当所述预设 时间结束, 仍未接收到所述响应间隔指示信息对应数量的数据包时, 向所 述终端发送数据包接收失败响应。 The server sends a data packet reception success response to the terminal when receiving the data packet corresponding to the response interval indication information before the end of the preset time; or when the preset time is over, When receiving the response interval indication information corresponding to the number of data packets, The terminal sends a packet reception failure response.
成功响应中具体可以携带有成功接收的数据包的信息。 失败响应中具 体用以指示在预设时间内未接收到数据包, 终端接收到该失败响应后, 根 据数据包发送情况以及成功响应情况, 向服务器重新发送该服务器未接收 到的数据包, 也可以将该数据包和其他数据包一起放在下一个 PUT/POST 通信请求消息中发送给服务器。  The successful response may specifically carry information of a successfully received data packet. The failure response is specifically used to indicate that the data packet is not received within the preset time. After receiving the failure response, the terminal resends the data packet not received by the server according to the data packet sending situation and the successful response situation. The packet can be sent to the server along with other packets in the next PUT/POST communication request message.
通过预设时间的设置, 在预设时间结束, 但未接收到所述响应间隔指 示信息对应数量的数据包时, 向终端返回响应, 可以避免用于网络状况较 差而造成的响应反馈的延时。 响应中具体携带有已接收到的数据包的 By setting the preset time, when the preset time is over, but the corresponding number of data packets of the response interval indication information are not received, the response is returned to the terminal, which can avoid the delay of response feedback caused by poor network conditions. Time. The response specifically carries the received data packet.
BlocklD, 已接收到的数据包的数量可以为多个, 终端可以根据响应获知数 据包的发送情况。 预设时间具体可以根据网络状况来设置, 也可以将往返 时延(Round-Trip Time, RTT )与 ACKGap的乘积作为该预设时间。 BlocklD, the number of received data packets can be multiple, and the terminal can know the transmission status of the data packet according to the response. The preset time may be specifically set according to network conditions, or the product of Round-Trip Time (RTT) and ACKGap may be used as the preset time.
图 13为本发明实施例提供的再一种数据包的传输方法的信令图。 以下 结合图 13 , 对终端向服务器发送的通信请求消息为 PUT/POST通信请求消 息时, 终端与服务器的响应间隔协商过程做详细介绍。  FIG. 13 is a signaling diagram of still another method for transmitting a data packet according to an embodiment of the present invention. Referring to FIG. 13 , when the communication request message sent by the terminal to the server is a PUT/POST communication request message, the process of the response interval negotiation between the terminal and the server is described in detail.
终端根据网络丟包率生成响应间隔指示信息 ACKGap, ACKGa 的值 具体可以与网络丟包率呈反比, 向服务器发送 PUT/POST通信请求消息, PUT/POST通信请求消息中携带有响应间隔指示信息 ACKGap和数据包, ACKGap指示的数据包的数量为 1 , 数据包的 BlocklD为 1。  The terminal generates the response interval indication information ACKGap according to the network packet loss rate. The value of the ACKGa may be inversely proportional to the network packet loss rate, and sends a PUT/POST communication request message to the server. The PUT/POST communication request message carries the response interval indication information ACKGap. And the packet, the number of packets indicated by ACKGap is 1, and the Block1D of the packet is 1.
服务器接收到该 PUT/POST通信请求消息, 对 PUT/POST通信请求消 息进行解析, 获取 PUT/POST 通信请求消息中的响应间隔指示信息 ACKGap, 获知 ACKGap的值为 1 , 则在确定接收到该 BlocklD为 1的数据 包后, 向终端发送用以指示已收到该 BlocklD为 1的数据包的响应。  The server receives the PUT/POST communication request message, parses the PUT/POST communication request message, obtains the response interval indication information ACKGap in the PUT/POST communication request message, and knows that the value of ACKGap is 1, and then determines that the BlocklD is received. After the data packet of 1, a response is sent to the terminal to indicate that the packet whose BlocklD is 1 has been received.
终端接收到该响应, 获知 BlocklD为 1 的数据包已经被服务器成功接 收。 终端根据网络丟包率生成响应间隔指示信息 ACKGap, ACKGap指示 的数据包的数量为 2,生成两个 PUT/POST通信请求消息并分别向服务器发 送, 其中一个 PUT/POST 通信请求消息中携带有该响应间隔指示信息 ACKGa 和 BlocklD为 2的数据包, 另一个 PUT/POST通信请求消息中携 带有该响应间隔指示信息 ACKGap和 BlocklD为 3的数据包。  The terminal receives the response and learns that the packet with BlocklD 1 has been successfully received by the server. The terminal generates the response interval indication information ACKGap according to the network packet loss rate, and the number of the data packets indicated by the ACKGap is 2. The two PUT/POST communication request messages are generated and sent to the server respectively, where the PUT/POST communication request message carries the The response interval indication information ACKGa and Block1D are data packets of 2, and the other PUT/POST communication request message carries the data packet with the response interval indication information ACKGap and BlocklD being 3.
服务器依次接收上述两个 PUT/POST 通信请求消息, 分别对两个 PUT/POST通信请求消息进行解析, 获取 PUT/POST通信请求消息中的响 应间隔指示信息 ACKGap, 获知 ACKGap 的值为 2, 则在确定接收到该 BlocklD为 2和 BlocklD为 3的数据包后, 向终端发送用以指示已收到该 BlocklD为 2和 BlocklD为 3的数据包的响应。 The server sequentially receives the above two PUT/POST communication request messages, respectively parses the two PUT/POST communication request messages, and obtains the sound in the PUT/POST communication request message. After the interval indication information ACKGap is obtained, the value of the ACKGap is 2, and after determining that the data packet of Block1D is 2 and Block1D is 3, the terminal is sent to indicate that the Block1D is 2 and the Block1D is 3. The response of the package.
终端接收到该响应,获知 BlocklD为 2和 BlocklD为 3的数据包已经被 服务器成功接收。 终端根据网络丟包率生成响应间隔指示信息 ACKGap, ACKGa 指示的数据包的数量为 3 ,生成三个 PUT/POST通信请求消息并分 别向服务器发送, 其中第一个 PUT/POST通信请求消息中携带有该响应间 隔指示信息 ACKGap和 BlocklD为 4的数据包, 第二个 PUT/POST通信请 求消息中携带有该响应间隔指示信息 ACKGap和 BlocklD为 5的数据包, 第三个 PUT/POST通信请求消息中携带有该响应间隔指示信息 ACKGap和 BlocklD为 6的数据包。  The terminal receives the response and learns that the packet with BlocklD 2 and BlocklD 3 has been successfully received by the server. The terminal generates response interval indication information ACKGap according to the network packet loss rate, and the number of data packets indicated by ACKGa is 3, and generates three PUT/POST communication request messages, which are respectively sent to the server, where the first PUT/POST communication request message is carried. The data packet with the response interval indication information ACKGap and BlocklD being 4, the second PUT/POST communication request message carrying the data packet with the response interval indication information ACKGap and BlocklD being 5, and the third PUT/POST communication request message The data packet with the response interval indication information ACKGap and BlocklD being 6 is carried.
服务器依次接收到携带有 BlocklD为 4数据包的 PUT/POST通信请求 消息和携带有 BlocklD为 6数据包, 分别对两个 PUT/POST通信请求消息 进行解析,获取 PUT/POST通信请求消息中的响应间隔指示信息 ACKGap, 获知 ACKGap 的值为 3 , 但服务器在超过预设时间时仍未接收到第三个 PUT/POST通信请求消息, 则向终端发送用以指示已收到该 BlocklD为 4 和 BlocklD为 6的数据包的响应。  The server sequentially receives the PUT/POST communication request message carrying Block1D as 4 data packets and carries the Block1D as 6 data packets, respectively parses the two PUT/POST communication request messages, and obtains the response in the PUT/POST communication request message. The interval indication information ACKGap, knowing that the value of ACKGap is 3, but the server has not received the third PUT/POST communication request message when the preset time exceeds the preset time, and sends a message to the terminal to indicate that the BlocklD has been received as 4 and BlocklD. The response for the 6 packets.
终端接收到该响应,获知 BlocklD为 4和 BlocklD为 6的数据包已经被 服务器成功接收, 但服务器并未接收到 BlocklD为 5的数据包。 终端根据 网络丟包率生成响应间隔指示信息 ACKGap, ACKGa 指示的数据包的数 量为 2, 生两个 PUT/POST通信请求消息并分别向服务器发送, 其中一个 PUT/POST通信请求消息中携带有该响应间隔指示信息 ACKGap和 BlocklD 为 5的数据包, 以对 BlocklD为 5的数据包重新发送, 另一个 PUT/POST 通信请求消息中携带有该响应间隔指示信息 ACKGap和 BlocklD为 7的数 据包。  The terminal receives the response and learns that the packet with Block1D of 4 and BlocklD of 6 has been successfully received by the server, but the server does not receive the packet with Block1D of 5. The terminal generates response interval indication information ACKGap according to the network packet loss rate, and the number of data packets indicated by ACKGa is 2, and two PUT/POST communication request messages are generated and sent to the server respectively, where a PUT/POST communication request message carries the The data packet with the response interval indication information ACKGap and BlocklD being 5 is retransmitted for the data packet with BlocklD of 5, and the other PUT/POST communication request message carries the data packet with the response interval indication information ACKGap and BlocklD of 7.
图 14为本发明实施例提供的第五种终端结构示意图。 如图 14所示, 本实施例提供的终端 87具体可以实现本发明任意实施例提供的应用于终端 87侧的响应间隔能力协商的方法的各个步骤, 此不再赘述。  FIG. 14 is a schematic structural diagram of a fifth terminal according to an embodiment of the present invention. As shown in FIG. 14, the terminal 87 provided in this embodiment may implement various steps of the method for negotiating the response interval capability of the terminal 87 provided by any embodiment of the present invention, and details are not described herein.
本实施例提供的终端 87具体包括请求单元 41和响应接收单元 42。 请 求单元 41用于向服务器 88发送所述终端生成的通信请求消息, 其中, 所 述通信请求消息中携带有第一数据包请求指示信息或第一响应间隔指示信 息, 所述第一数据包请求指示信息指示至少两个向服务器 88获取的数据包 信息, 所述第一响应间隔指示信息用以指示所述服务器 88在收到至少两个 数据包后响应。 响应接收单元 42用于接收所述服务器 88发送的对应于所 述通信请求消息的响应。 The terminal 87 provided in this embodiment specifically includes a request unit 41 and a response receiving unit 42. The requesting unit 41 is configured to send, to the server 88, the communication request message generated by the terminal, where the communication request message carries the first data packet request indication information or the first response interval indication message. The first data packet request indication information indicates at least two data packet information acquired by the server 88, and the first response interval indication information is used to indicate that the server 88 responds after receiving at least two data packets. The response receiving unit 42 is configured to receive a response sent by the server 88 corresponding to the communication request message.
本实施例提供的终端 87 , 请求单元 41向服务器 88发送所述终端生成 的通信请求消息, 其中, 所述通信请求消息中携带有第一数据包请求指示 信息或第一响应间隔指示信息, 所述第一数据包请求指示信息指示至少两 个向服务器 88获取的数据包信息, 所述第一响应间隔指示信息用以指示所 述服务器 88在收到至少两个数据包后响应。 响应接收单元 42接收所述服 务器 88发送的对应于所述通信请求消息的响应。 终端 87通过在通信请求 消息中携带数据包请求指示信息或响应间隔指示信息, 实现了终端 87与服 务器 88的响应间隔能力的协商, 有效利用了网络带宽, 提高了传输效率。  In the terminal 87 provided by the embodiment, the requesting unit 41 sends a communication request message generated by the terminal to the server 88, where the communication request message carries the first data packet request indication information or the first response interval indication information. The first data packet request indication information indicates at least two data packet information acquired by the server 88, and the first response interval indication information is used to indicate that the server 88 responds after receiving at least two data packets. The response receiving unit 42 receives a response sent by the server 88 corresponding to the communication request message. The terminal 87 implements the negotiation of the response interval capability of the terminal 87 and the server 88 by carrying the data packet request indication information or the response interval indication information in the communication request message, effectively utilizing the network bandwidth, and improving the transmission efficiency.
在本实施例中,所述通信请求消息为第一 GET通信请求消息;相应地, 所述终端还包括第一丟包率确定单元, 第一丟包率确定单元用于根据第一 数据包接收日志确定第一网络丟包率; 所述第一请求单元还用于所述终端 根据所述第一网络丟包率生成所述第一数据包请求指示信息, 并生成所述 第一 GET通信请求消息,所述第一 GET通信请求消息携带所述第一数据包 请求指示信息, 若所述第一网络丟包率小于第一预设阔值, 所述第一数据 包请求指示信息指示至少 2 个向服务器获取的数据包信息; 向所述服务器 发送所述第一 GET通信请求消息, 以使所述服务器根据所述第一数据包请 求指示信息发送携带有与所述第一数据包请求指示信息对应的数据包的响 应。  In this embodiment, the communication request message is a first GET communication request message; correspondingly, the terminal further includes a first packet loss rate determining unit, where the first packet loss rate determining unit is configured to receive according to the first data packet. Determining, by the log, a packet loss rate of the first network; the first requesting unit is further configured to: generate, by the terminal, the first data packet request indication information according to the first network packet loss rate, and generate the first GET communication request a message that the first GET communication request message carries the first data packet request indication information, and if the first network packet loss rate is less than a first preset threshold, the first data packet request indication information indicates at least 2 Data packet information obtained from the server; sending the first GET communication request message to the server, so that the server sends an indication with the first data packet according to the first data packet request indication information The response of the packet corresponding to the message.
在本实施中, 该终端还可以包括第二丟包率确定单元和第二请求单元。 第二丟包率确定单元用于根据第二数据包接收日志确定第二网络丟包率。 第二请求单元用于根据所述第二网络丟包率生成所述第二数据包请求指示 信息, 若所述第二网络丟包率小于所述第一预设阔值, 所述第二数据请求 指示信息指示的向所述服务器获取的数据包的数量大于第一数据包请求指 示信息指示的向所述服务器获取的数据包的数量; 或,若所述第二网络丟包 率大于第二预设域值, 所述第二数据请求指示信息指示的向所述服务器获 取的数据包的数量小于所述第一数据包请求指示信息指示的向所述服务器 获取的数据包的数量,生成第二 GET通信请求消息,所述第二 GET通信请 求消息携带所述第二数据包请求指示信息, 向所述服务器发送第二 GET通 信请求消息, 以使所述服务器根据所述第二数据包请求指示信息发送携带 有与所述第二数据包请求指示信息对应的数据包的响应。 In this implementation, the terminal may further include a second packet loss rate determining unit and a second request unit. The second packet loss rate determining unit is configured to determine a second network packet loss rate according to the second data packet receiving log. The second requesting unit is configured to generate the second data packet request indication information according to the second network packet loss rate, where the second network packet loss rate is less than the first preset threshold, the second data The number of data packets acquired by the request indication information to the server is greater than the number of data packets acquired by the server indicated by the first data packet request indication information; or, if the second network packet loss rate is greater than the second a preset field value, the number of data packets acquired by the second data request indication information to the server is smaller than the number of data packets obtained by the first data packet request indication information and sent to the server, Two GET communication request message, the second GET communication request The request message carries the second data packet request indication information, and sends a second GET communication request message to the server, so that the server sends and carries the second data packet according to the second data packet request indication information. The response of the data packet corresponding to the request indication information.
在本实施例中, 所述通信请求消息为第一 PUT/POST通信请求消息。 所述终端还包括第三丟包率确定单元, 第三丟包率确定单元用于根据第一 数据包发送日志确定第三网络丟包率。 所述第一请求单元还用于根据所述 第三网络丟包率生成所述响应间隔指示信息, 根据所述第一响应间隔指示 信息生成所述第一 PUT/POST通信请求消息, 向所述服务器发送所述第一 PUT/POST通信请求消息,若所述第三网络丟包率小于第一预设阔值,所述 第一响应间隔指示信息用以指示所述服务器在收到至少两个数据包后响应; 以使所述服务器在接收到所述第一响应间隔指示信息指示的数量的数据包 后返回口向应。  In this embodiment, the communication request message is a first PUT/POST communication request message. The terminal further includes a third packet loss rate determining unit, where the third packet loss rate determining unit is configured to determine a third network packet loss rate according to the first data packet sending log. The first requesting unit is further configured to generate the response interval indication information according to the third network packet loss rate, and generate the first PUT/POST communication request message according to the first response interval indication information, to the The server sends the first PUT/POST communication request message, if the third network packet loss rate is less than the first preset threshold, the first response interval indication information is used to indicate that the server receives at least two Responding to the data packet; so that the server returns to the port after receiving the number of data packets indicated by the first response interval indication information.
在本实施例中, 该终端还可以包括第四丟包率确定单元和第三请求单 元。 第四丟包率确定单元用于根据第二数据包发送日志确定第四网络丟包 率。 第三请求单元用于根据所述第四网络丟包率生成所述第二响应间隔指 示信息, 若所述第四网络丟包率小于所述第一预设阔值, 所述第二响应间 隔指示信息指示的数量大于所述第一响应间隔指示信息指示的数量; 或, 若第四网络丟包率大于第二预设域值, 所述第二响应间隔指示信息指示的 数量小于所述第一响应间隔指示信息指示的数量, 所述终端根据所述第二 响应间隔指示信息生成第二 PUT/POST通信请求消息, 向所述服务器发送 所述第二 PUT/POST通信请求消息; 以使所述服务器在接收到所述第二响 应间隔指示信息指示的数量的数据包后返回响应。  In this embodiment, the terminal may further include a fourth packet loss rate determining unit and a third request unit. The fourth packet loss rate determining unit is configured to determine a fourth network packet loss rate according to the second data packet sending log. The third requesting unit is configured to generate the second response interval indication information according to the fourth network packet loss rate, where the second network packet loss rate is less than the first preset threshold, the second response interval The number of the indication information indication is greater than the number indicated by the first response interval indication information; or, if the fourth network packet loss rate is greater than the second preset domain value, the second response interval indication information indicates that the number is smaller than the number a response indicating the number of indications, the terminal generating a second PUT/POST communication request message according to the second response interval indication information, and sending the second PUT/POST communication request message to the server; The server returns a response after receiving the number of data packets indicated by the second response interval indication information.
图 15为本发明实施例提供的第三种服务器结构示意图。 如图 15所示, 本实施例提供的服务器 88具体可以实现本发明任意实施例提供的应用于服 务器 88侧的响应间隔能力协商的方法的各个步骤, 此不再赘述。  FIG. 15 is a schematic structural diagram of a third server according to an embodiment of the present invention. As shown in FIG. 15, the server 88 provided in this embodiment may implement various steps of the method for negotiating the response interval capability applied to the server 88 side according to any embodiment of the present invention, and details are not described herein.
本实施例提供的服务器 88具体包括第二请求接收单元 51和第二响应 单元 52。 第二请求接收单元 51用于接收终端 87发送的通信请求消息, 其 中, 所述请求消息中携带有数据包请求指示信息或响应间隔指示信息, 所 述数据包请求指示信息具体为至少两个向所述服务器获取的数据包信息, 所述响应间隔指示信息用以指示所述服务器在收到至少两个数据包后响 应。 第二响应单元 52用于对所述通信请求消息进行解析, 获取所述请求消 息中的指示信息, 根据所述指示信息向所述终端 87返回响应。 The server 88 provided in this embodiment specifically includes a second request receiving unit 51 and a second response unit 52. The second request receiving unit 51 is configured to receive the communication request message sent by the terminal 87, where the request message carries the data packet request indication information or the response interval indication information, where the data packet request indication information is specifically at least two directions. The packet information obtained by the server, the response interval indication information is used to indicate that the server responds after receiving at least two data packets. The second response unit 52 is configured to parse the communication request message, and obtain the request cancellation. The indication information in the information returns a response to the terminal 87 according to the indication information.
本实施例提供的服务器 88, 第二请求接收单元 51接收终端 87发送的 通信请求消息, 其中, 所述请求消息中携带有数据包请求指示信息或响应 间隔指示信息, 所述数据包请求指示信息具体为至少两个向所述服务器获 取的数据包信息, 所述响应间隔指示信息用以指示所述服务器在收到至少 两个数据包后响应。 第二响应单元 52对所述通信请求消息进行解析, 获取 所述请求消息中的指示信息, 根据所述指示信息向所述终端 87返回响应, 终端 87通过在通信请求消息中携带数据包请求指示信息或响应间隔指示信 息, 以使服务器 88根据指示信息返回响应, 实现了终端 87与服务器 88的 响应间隔能力的协商, 有效利用了网络带宽, 提高了传输效率。  In the server 88 provided by the embodiment, the second request receiving unit 51 receives the communication request message sent by the terminal 87, where the request message carries the data packet request indication information or the response interval indication information, and the data packet request indication information Specifically, it is at least two pieces of data packet information obtained by the server, where the response interval indication information is used to indicate that the server responds after receiving at least two data packets. The second response unit 52 parses the communication request message, obtains the indication information in the request message, returns a response to the terminal 87 according to the indication information, and the terminal 87 carries the data packet request indication by transmitting the communication request message. The information or response interval indication information is such that the server 88 returns a response according to the indication information, realizing the negotiation of the response interval capability of the terminal 87 and the server 88, effectively utilizing the network bandwidth, and improving the transmission efficiency.
在本实施例中, 所述通信请求消息为 GET 通信请求消息, 所述 GET 通信请求消息中携带有数据包请求指示信息。 所述第二响应单元还用于所 述服务器获取所述 GET通信请求消息中的数据包请求指示信息指示至少两 个向所述服务器获取的数据包信息, 根据所述向服务器获取的数据包信息 对应的数据包生成至少两个响应, 向所述终端发送所述至少两个响应, 其 中, 每个所述响应中携带一个数据包。  In this embodiment, the communication request message is a GET communication request message, and the GET communication request message carries data packet request indication information. The second response unit is further configured to: the server obtains the data packet request indication information in the GET communication request message, and indicates at least two data packet information acquired by the server, according to the data packet information acquired by the server. The corresponding data packet generates at least two responses, and the at least two responses are sent to the terminal, where each of the responses carries one data packet.
在本实施例中, 所述请求消息为 PUT/POST 通信请求消息, 所述 PUT/POST 通信请求消息中携带有响应间隔指示信息和一个数据包。 相应 地, 所述第二响应单元还用于获取所述 PUT/POST通信请求消息中的响应 间隔指示信息, 在接收到所述响应间隔指示信息对应数量的数据包后, 向 所述终端发送所述响应。  In this embodiment, the request message is a PUT/POST communication request message, and the PUT/POST communication request message carries response interval indication information and a data packet. Correspondingly, the second response unit is further configured to acquire the response interval indication information in the PUT/POST communication request message, and send the location to the terminal after receiving the data packet corresponding to the response interval indication information. Respond to the response.
在本实施例中, 所述请求消息为 PUT/POST 通信请求消息, 所述 PUT/POST 通信请求消息中携带有响应间隔指示信息和一个数据包。 相应 地, 所述第二响应单元还用于所述服务器在上一次向所述终端返回响应时 启动定时器, 进行预设时间的定时, 在所述预设时间结束前, 当接收到所 述响应间隔指示信息对应数量的数据包时, 向所述终端发送数据包接收成 功响应; 或当所述预设时间结束,仍未接收到所述响应间隔指示信息对应数 量的数据包时, 向所述终端发送数据包接收失败响应。  In this embodiment, the request message is a PUT/POST communication request message, and the PUT/POST communication request message carries response interval indication information and a data packet. Correspondingly, the second response unit is further configured to: when the server returns a response to the terminal, start a timer to perform a preset time, before the preset time ends, when the When the response interval indication information corresponds to the quantity of data packets, sending a data packet reception success response to the terminal; or when the preset time expires, the corresponding number of data packets of the response interval indication information are still not received, The terminal sends a packet reception failure response.
图 16为本发明实施例提供的传输处理流程图。 如图 16所示, 终端可 以与服务器同时进行传输速度的协商和响应间隔能力的协商, 即终端发送 的通信请求消息中既携带有请求传输速度信息 SendSpeed,还携带有数据包 请求指示信息或响应间隔指示信息 ACKGap。 终端对数据包的处理具体可 以分为三个过程: 接收过程、 调度过程和发送过程。 FIG. 16 is a flowchart of a transmission process according to an embodiment of the present invention. As shown in FIG. 16, the terminal can perform the negotiation of the transmission speed and the negotiation of the response interval capability simultaneously with the server, that is, the communication request message sent by the terminal carries the requested transmission speed information SendSpeed and carries the data packet. The request indication information or the response interval indication information ACKGap. The processing of the data packet by the terminal can be specifically divided into three processes: a receiving process, a scheduling process, and a sending process.
发送过程包括: 终端每次检查待发送包队列的队头是否有待发送的数 据包, 然后执行发送操作, 并把发送时间和编号反馈给数据包收发日志。 接收过程包括: 终端每接收到一个响应以后经过解析, 把解析出的 The sending process includes: The terminal checks whether the queue of the to-be-sent packet queue has a data packet to be sent, and then performs a sending operation, and feeds the sending time and number to the data packet to send and receive logs. The receiving process includes: parsing the parsed after each response is received by the terminal
SendSpeed 和 ACKGap 交给制定发送计划单元, 同时把收到数据包的 通过日志跟踪单元对数据包收发日志的跟踪, 会发现确定已经丟失的数据 包、 当前网络的 RTT和丟包率。 日志跟踪单元将这些参数一起交给制定发 送计划单元, 由该制定发送计划单元制定制定发送计划, 如即将发送的包 和该包中携带哪些参数。 SendSpeed and ACKGap are handed over to the development of the transmission planning unit, and the tracking of the received and received logs of the received packets through the log tracking unit will find out the data packets that have been lost, the RTT of the current network, and the packet loss rate. The log tracking unit hands these parameters together to the development delivery planning unit, which formulates the delivery plan, such as the package to be sent and which parameters are carried in the package.
例如,在开始一个 BLOCK传输以后,终端会对所有需要请求的数据包 产生请求计划, 按照这个请求计划和协商确定的发送速度不断的发送通信 请求消息, 对每个数据包跟踪其是否超时丟失。 如果丟失将其插入到队列 前端, 按照当前速度发送。 丟包与否并不会影响速度的增减, 唯一能够影 响传输速度的是两端节点的处理能力。 也就是说在丟包率高的网络中, 接 收方收到的数据包比发送端发出的包的数量少, 在终端能力足够的情况下, 服务器将能够接受更高的发送速度。 就会造成这样一种现象: 假设网络的 丟包率为 90%, 即终端发出 10个包有 1个包到达服务器。 如果服务器最多 能够接受的传输速度是 10包 /s, 此时在这种方法中, 服务器将会以 100包 /s 的速度发送数据包, 即使是 90%丟包率的网络, 依然能够使服务器满负 荷运行。 从这种意义上高效利用现有的网络, 使数据能够快速传输。  For example, after starting a BLOCK transmission, the terminal will generate a request plan for all data packets that need to be requested, and continuously send a communication request message according to the transmission speed determined by the request plan and negotiation, and track each packet for timeout loss. If it is missing, insert it at the front of the queue and send it at the current speed. Losing or not does not affect the speed increase and decrease. The only thing that can affect the transmission speed is the processing power of the nodes at both ends. That is to say, in a network with a high packet loss rate, the receiver receives less packets than the sender, and the server will be able to accept higher transmission speeds when the terminal capacity is sufficient. This will cause such a phenomenon: Assume that the packet loss rate of the network is 90%, that is, the terminal sends out 10 packets and has 1 packet to reach the server. If the server can accept a maximum transmission speed of 10 packets / s, in this way, the server will send packets at 100 packets / s, even for networks with 90% packet loss rate, can still make the server Run at full capacity. In this sense, efficient use of existing networks enables data to be transmitted quickly.
在本实施例提供的数据包的传输方法, 服务器可以尽量做到无状态。 服务器也可以通过保存部分数据包的 BlocklD列表来提高信道的利用率。  In the data packet transmission method provided in this embodiment, the server can be stateless as much as possible. The server can also increase channel utilization by saving a BlocklD list of partial packets.
服务器在处理 PUT/POST通信请求消息时, 服务器可以保存从上次响 应以后收到的包的数据包的 BlocklD列表, 并从收到的 PUT/POST通信请 求消息中获取 ACKGap, 并判断是不是要立即反馈响应还是继续等待。 在 存在丟包的情况下, 因为终端会不断的对还没有被响应的数据包进行超时 重传, 所以服务器只要计数在收到 ACKGap对应数量的数据包以后进行一 次响应反馈即可。  When the server processes the PUT/POST communication request message, the server can save the BlocklD list of the packet received from the last response, and obtain ACKGap from the received PUT/POST communication request message, and determine whether it is necessary or not. Feedback immediately or continue to wait. In the case where there is a packet loss, since the terminal continuously retransmits the packet that has not been responded to, the server only needs to count the response after receiving the packet of the corresponding number of ACKGap.
服务器在处理 GET通信请求消息时,终端发送来的 GET请求中包含多 个数据包的请求, 并且包含一个 SendSpeed, 服务器可以暂时保存这些被请 求的数据包的 BlockID列表,并按顺序按照 SendSpeed把这些数据包在响应 中返回给终端。 When the server processes the GET communication request message, the GET request sent by the terminal contains more Requests for packets, and include a SendSpeed, the server can temporarily save the BlockID list of these requested packets, and return them to the terminal in response according to SendSpeed in order.
通过这种方法, 服务器只需要维护简单的状态数据即可以完成对信道 中多余响应的处理, 使响应和请求消息大大的集中, 从而高效利用带宽。  In this way, the server only needs to maintain simple state data to complete the processing of redundant responses in the channel, so that the response and request messages are greatly concentrated, thereby efficiently utilizing bandwidth.
在本实施例提供的数据包的传输方法在具体的实施过程中, 如果任意 有一个节点不能支持上述的传输速度协商能力或者间隔响应能力的处理方 式。  In the specific implementation process of the data packet transmission method provided in this embodiment, if any node does not support the above-mentioned transmission speed negotiation capability or the interval response capability processing method.
对传输速度协商过程来讲,终端发起一个 BLOCK传输过程以后将在请 求消息中添加 SendSpeed Option表示请求更高的传输速度。 如果服务器可 以接受该速度就在响应中带有相同的 SendSpeed。但如果服务器不愿意进行 速度协商, 只愿意进行传统的 BLOCK传输方式, 或者服务器不能识别该 SendSpeed Option, 它只需在响应中不携带 SendSpeed。 终端在收到该响应 后后将知道当前路径上不能进行速度协商操作, 从而开始传统的 BLOCK 传输方式。  For the transmission speed negotiation process, after the terminal initiates a BLOCK transmission process, a SendSpeed Option is added to the request message to indicate a higher transmission speed. If the server can accept the speed, it will have the same SendSpeed in the response. However, if the server is not willing to negotiate speed, it is only willing to perform the traditional BLOCK transmission mode, or the server does not recognize the SendSpeed Option, it only needs to carry SendSpeed in the response. After receiving the response, the terminal will know that the speed negotiation operation cannot be performed on the current path, thus starting the traditional BLOCK transmission mode.
对间隔响应协商来讲, 如果服务器不能支持或者不能识别 ACKGap Option, 或者它不能对多个 BLOCK Option进行解析。 它只需要简单的对每 个数据包进行响应或者对第一个 BLOCK Option所代表的数据包进行响应 即可, 终端不需要任何变化即可回退到传统模式。  For interval response negotiation, if the server cannot support or does not recognize the ACKGap Option, or it cannot parse multiple BLOCK Option. It simply responds to each packet or responds to the packet represented by the first BLOCK Option, and the terminal can fall back to legacy mode without any changes.
本发明实施例提供的数据包的传输方法和设备, 方案解决了在受限环 境中进行基于 CoAP协议进行通信时,对大资源釆用 BLOCK分包传输时效 率低的问题, 本发明实施例从两个方面来改进这一过程。  The method and device for transmitting data packets provided by the embodiments of the present invention solve the problem of low efficiency when using BLOCK packet transmission for large resources when performing communication based on the CoAP protocol in a restricted environment, and the embodiment of the present invention Two aspects to improve this process.
一种方式是使用了传输速度协商方法。 该方法在传输过程中链路上的 各个节点之间协商一个最佳的数据发送速度, 保证链路上各个节点都能够 工作在允许范围内。 同时在链路上处理能力瓶颈节点附近。 保证方法在已 知路径上的高效传输。 保证待传输资源能以最快速度发送到接收方, 或者 保证以最快速度从远端获取资源。  One way is to use a transmission speed negotiation method. The method negotiates an optimal data transmission speed between nodes on the link during transmission to ensure that each node on the link can work within the allowable range. At the same time, the capability bottleneck node is processed on the link. Ensure efficient transfer of methods on known paths. Ensure that the resources to be transmitted can be sent to the receiver as fast as possible, or ensure that resources are obtained from the remote end as quickly as possible.
这种传输速度协商方法只和链路上各个节点的处理能力相关, 而与网 络状态无关。 这种节点处理能力可能用 CPU空闲时间、 剩余内存等多个指 标或者多种方法来衡量。 节点在获得了处理能力以后, 对其需要处理的消 息或者需要中转的消息中 SendSpeed Option进行解析, 根据自己的能力选 择接受该速度或者调整该速度。 当选择接受时, 中间节点保持原有的This transmission speed negotiation method is only related to the processing capability of each node on the link, and is independent of the network state. This node processing capability may be measured by multiple metrics such as CPU idle time, remaining memory, or multiple methods. After the node obtains the processing capability, it parses the message that needs to be processed or the message that needs to be transferred in the SendSpeed Option, and selects according to its own capabilities. Choose to accept the speed or adjust the speed. When the selection is accepted, the intermediate node remains the original
SendSpeed值不变进行转发,服务器在响应中带有相同的 SendSpeed Option。 当选择调整时, 中间节点在转发的包中替换原有的 SendSpeed为可接受的 值, 同样服务器在响应中使用可接受的值代替原有 SendSpeed。 终端执行相 应的提速或者减速的操作。 The SendSpeed value is forwarded unchanged, and the server has the same SendSpeed Option in the response. When the adjustment is selected, the intermediate node replaces the original SendSpeed with an acceptable value in the forwarded packet, and the server replaces the original SendSpeed with an acceptable value in the response. The terminal performs the corresponding speed-up or deceleration operation.
这种方法保证传输过程中充分利用各个节点的资源, 以尽快的传输数 据。 在各个节点资源能力充足的情况下, 终端以较高速度发送数据包, 并 且速度不断上升。 在节点资源有限的情况下, 终端发送速度不超过瓶颈节 点的处理能力, 保证不必要的重传的发生。  This method ensures that the resources of each node are fully utilized during the transmission process to transfer data as quickly as possible. In the case where the resource capacity of each node is sufficient, the terminal transmits the data packet at a relatively high speed, and the speed continues to rise. In the case where the node resources are limited, the terminal transmission speed does not exceed the processing capability of the bottleneck node, and unnecessary retransmission is guaranteed.
另一方式是使用了间隔响应协商方法。 这种方法主要对网络丟包率进 行感知, 根据丟包率调整响应间隔与其成反比关系。 丟包率高时需要对每 个数据包进行响应, 丟包率低时可以一次发送多个数据包以后再进行响应。  Another way is to use an interval response negotiation method. This method mainly senses the network packet loss rate, and adjusts the response interval according to the packet loss rate. When the packet loss rate is high, each packet needs to be responded. When the packet loss rate is low, multiple packets can be sent at a time before responding.
相比一般的对每个数据包都必须进行响应的方式, 这种方法让信道更 多的用来传输数据的净荷。 减少响应的次数用来提高信道的利用率。 在较 好的稳定的网络中, 因为网络的可信度高, 响应间隔不断增大, 信道上充 斥的全是实际的数据, 通信效率高。 在不稳定的丟包率高的网络中, 最终 该方法将要求对每个数据包进行响应, 以确保每个数据包成功传输以后再 进行后面的包的传输。 避免不必要的重传。  Compared to the general way of responding to each packet, this method allows the channel to use more payload to transmit data. The number of times the response is reduced is used to increase channel utilization. In a relatively stable network, because the network has high credibility and the response interval is increasing, the channel is full of actual data, and the communication efficiency is high. In an unstable network with high packet loss rate, the method will eventually require a response to each packet to ensure that each packet is successfully transmitted before subsequent packet transmission. Avoid unnecessary retransmissions.
本发明实施例给出了一种多跳网络中进行速度协商的方法, 使得发明 实施例中提供的方法能够运用到涉及到多个中间节点的传输的场景中。  The embodiment of the present invention provides a method for speed negotiation in a multi-hop network, so that the method provided in the embodiment of the invention can be applied to a scenario involving transmission of multiple intermediate nodes.
本发明实施例同时给出了一种对于不支持协商的节点的处理方式。 可 以保证对于不支持速度协商或者响应间隔的方式, 能够退回到传统的一来 一回的 BLOCK传输方案。  The embodiment of the present invention also provides a processing manner for a node that does not support negotiation. It can be guaranteed to return to the traditional one-on-one BLOCK transmission scheme for the way that speed negotiation or response interval is not supported.
这两种方法可以结合起来同时起作用, 在进行速度协商的同时根据网 络丟包率对已经传输的多个包只发送一个响应。 使得 BLOCK传输效率更 高。 并且可以根据节点的状态和网络的状态自适应的变化, 调整发送速度 或者响应间隔以获得最佳效果。  These two methods can work together at the same time, and only one response is sent to the multiple packets that have been transmitted according to the network packet loss rate while performing speed negotiation. Make BLOCK transfer more efficient. And the transmission speed or response interval can be adjusted to get the best effect according to the state of the node and the state adaptive change of the network.
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步 骤可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机 可读取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序 代码的介质。 A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The steps of the foregoing method embodiments are included; and the foregoing storage medium includes: various storage programs such as a ROM, a RAM, a magnetic disk, or an optical disk. The medium of the code.
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修 改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不 使相应技术方案的本质脱离本发明各实施例技术方案的范围。  It should be noted that the above embodiments are only for explaining the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; and the modifications or substitutions do not deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

权利要求 Rights request
1、 一种数据包的传输方法, 其特征在于, 所述数据包的传输方法基于 CoAP协议, 包括: A method for transmitting a data packet, wherein the data packet transmission method is based on a CoAP protocol, and includes:
终端向第一节点发送第一请求消息, 其中, 所述第一请求消息中携带 有第一请求传输速度信息, 所述第一节点为服务器或中间节点;  The terminal sends a first request message to the first node, where the first request message carries the first request transmission speed information, and the first node is a server or an intermediate node;
所述终端接收所述第一节点发送的响应, 获取所述第一请求消息的响 应中的第一反馈传输速度信息 , 根据所述第一反馈传输速度信息指示的传 输速度向所述第一节点发送第二请求消息, 其中, 所述第一反馈传输速度 信息用以指示所述第一节点能够接受的传输速度, 所述第二请求消息中携 带有第二请求传输速度信息。  Receiving, by the terminal, the response sent by the first node, acquiring first feedback transmission speed information in the response of the first request message, and transmitting, according to the transmission speed indicated by the first feedback transmission speed information, to the first node Sending a second request message, where the first feedback transmission speed information is used to indicate a transmission speed that the first node can accept, and the second request message carries second request transmission speed information.
2、 根据权利要求 1所述的数据包的传输方法, 其特征在于, 所述终端 根据所述第一反馈传输速度信息指示的传输速度向所述第一节点发送第二 请求消息之前, 还包括:  The method for transmitting a data packet according to claim 1, wherein the terminal further includes, before sending the second request message to the first node according to the transmission speed indicated by the first feedback transmission speed information, :
若所述第一反馈传输速度信息指示的传输速度等于所述第一请求传输 速度信息指示的传输速度, 所述终端则将所述第一请求传输速度信息指示 的传输速度指数增长, 生成用以指示指数增长后的传输速度的所述第二请 求传输速度信息, 根据所述第二请求传输速度信息生成所述第二请求消息; 若所述第一反馈传输速度信息指示的传输速度小于所述第一请求传输 速度信息指示的传输速度, 所述终端则将所述第一请求传输速度信息指示 的传输速度线性增长, 生成用以指示线性增长后的传输速度的所述第二请 求传输速度信息, 根据所述第二请求传输速度信息生成所述第二请求消息。  And if the transmission speed indicated by the first feedback transmission speed information is equal to the transmission speed indicated by the first request transmission speed information, the terminal increases exponentially the transmission speed indicated by the first request transmission speed information, and generates The second request transmission speed information indicating an exponentially increasing transmission speed, generating the second request message according to the second request transmission speed information; if the first feedback transmission speed information indicates a transmission speed less than the Transmitting, by the terminal, a transmission speed indicated by the transmission speed information, the terminal linearly increasing the transmission speed indicated by the first request transmission speed information, and generating the second request transmission speed information to indicate a linearly increasing transmission speed And generating, according to the second request transmission speed information, the second request message.
3、 根据权利要求 1或 2所述的数据包的传输方法, 其特征在于: 所述第一请求消息和所述第二请求消息为 GET请求消息, 所述 GET 请求消息中还携带有请求的数据包信息;  The method for transmitting a data packet according to claim 1 or 2, wherein: the first request message and the second request message are GET request messages, and the GET request message further carries a request Packet information;
相应地, 所述终端接收所述第一节点发送的响应之后, 还包括: 获取所述响应中的数据包, 对所述数据包进行相应地处理, 并更新数 据包接收日志。  Correspondingly, after receiving the response sent by the first node, the terminal further includes: acquiring a data packet in the response, processing the data packet accordingly, and updating the data packet receiving log.
4、 根据权利要求 1所述的数据包的传输方法, 其特征在于:  4. The method of transmitting a data packet according to claim 1, wherein:
所述第一请求消息为 PUT/POST第一请求消息, 所述 PUT/POST第一 请求消息中还携带有数据包; The first request message is a PUT/POST first request message, and the PUT/POST is first The request message also carries a data packet;
相应地, 所述终端接收所述第一节点发送的响应之后, 还包括: 更新数据包发送日志。  Correspondingly, after receiving the response sent by the first node, the terminal further includes: updating a data packet sending log.
5、 根据权利要求 3或 4所述的数据包的传输方法, 其特征在于, 还包 括:  The method for transmitting a data packet according to claim 3 or 4, further comprising:
所述终端若在向所述第一节点发送第一请求消息后预设时间内, 未接 收到所述第一节点发送的响应, 则向所述第一节点重新发送所述第一请求 消息。  If the terminal does not receive the response sent by the first node within a preset time after sending the first request message to the first node, the terminal resends the first request message to the first node.
6、 一种数据包的传输方法, 其特征在于, 所述数据包的传输方法基于 CoAP协议, 包括:  A method for transmitting a data packet, wherein the data packet transmission method is based on a CoAP protocol, and includes:
服务器接收第二节点发送的请求消息, 其中, 所述请求消息中携带有 请求传输速度信息, 所述第二节点为终端或中间节点;  The server receives the request message sent by the second node, where the request message carries the request transmission speed information, and the second node is a terminal or an intermediate node;
所述服务器判断所述请求传输速度信息指示的传输速度是否为所述服 务器能够接受的传输速度, 若是, 则将所述请求传输速度信息作为反馈传 输速度信息, 若否, 则生成用以指示所述服务器能够接收的传输速度作为 反馈传输速度信息;  Determining, by the server, whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server, and if yes, using the requested transmission speed information as feedback transmission speed information, and if not, generating Describe the transmission speed that the server can receive as the feedback transmission speed information;
所述服务器根据所述反馈传输速度信息生成对应于所述请求消息的响 应, 向所述第二节点发送对应于所述请求消息的响应。  The server generates a response corresponding to the request message according to the feedback transmission speed information, and sends a response corresponding to the request message to the second node.
7、 根据权利要求 6所述的数据包的传输方法, 其特征在于, 所述服务 器判断所述请求传输速度信息指示的传输速度是否为能够接受的传输速度 之前, 还包括:  The method for transmitting a data packet according to claim 6, wherein before the server determines whether the transmission speed indicated by the request transmission speed information is an acceptable transmission speed, the method further includes:
所述服务器获取所述服务器的参数信息, 根据所述参数信息确定所述 服务器能够接受的传输速度, 其中, 所述参数信息包括以下至少一种: 所 述服务器的中央处理器空闲时间信息、 所述服务器的内存余量信息和所述 服务器的带宽占用信息。  The server obtains parameter information of the server, and determines a transmission speed that the server can accept according to the parameter information, where the parameter information includes at least one of the following: a central processor idle time information of the server, where The memory margin information of the server and the bandwidth occupation information of the server.
8、 根据权利要求 6所述的数据包的传输方法, 其特征在于, 所述请求消息为 GET请求消息,所述 GET请求消息中还携带有请求的 数据包信息;  The method for transmitting a data packet according to claim 6, wherein the request message is a GET request message, and the GET request message further carries the requested data packet information;
相应地, 所述服务器根据所述反馈传输速度信息生成对应于所述请求 消息的响应, 包括:  Correspondingly, the server generates a response corresponding to the request message according to the feedback transmission speed information, including:
所述服务器根据所述请求的数据包信息对应的数据包生成对应于所述 请求消息的响应, 将所述反馈传输速度信息添加到所述响应中。 The server generates, according to the data packet corresponding to the requested packet information, corresponding to the In response to the request message, the feedback transmission speed information is added to the response.
9、 根据权利要求 6所述的数据包的传输方法, 其特征在于:  9. The method of transmitting a data packet according to claim 6, wherein:
所述请求消息为 PUT/POST请求消息, 所述 PUT/POST请求消息中还 携带有数据包;  The request message is a PUT/POST request message, and the PUT/POST request message further carries a data packet;
相应地, 所述服务器根据所述反馈传输速度信息生成对应于所述请求 消息的响应, 包括:  Correspondingly, the server generates a response corresponding to the request message according to the feedback transmission speed information, including:
所述服务器生成用以指示收到所述 PUT/POST请求消息中的数据包的 响应, 将所述反馈传输速度信息添加到所述响应中。  The server generates a response to indicate receipt of a data packet in the PUT/POST request message, and adds the feedback transmission speed information to the response.
10、 根据权利要求 6-9任一所述的数据包的传输方法, 其特征在于: 所述第二节点为终端, 所述请求消息为第一请求消息, 所述第一请求 消息中携带有第一请求传输速度信息, 所述响应为所述第一请求消息的响 应; 或  The method for transmitting a data packet according to any one of claims 6-9, wherein: the second node is a terminal, and the request message is a first request message, where the first request message carries First requesting transmission speed information, the response being a response of the first request message; or
当所述第二节点为中间节点, 所述请求消息为中转的请求消息, 所述 中转的请求消息中携带有中转的请求传输速度信息, 所述响应为所述中转 的请求消息的响应。  When the second node is an intermediate node, the request message is a transit request message, and the transit request message carries a request transmission speed information of the transit, and the response is a response of the transit request message.
11、 一种数据包的传输方法, 其特征在于, 所述数据包的传输方法基 于 CoAP协议, 包括:  A method for transmitting a data packet, wherein the data packet transmission method is based on a CoAP protocol, and includes:
中间节点接收终端发送的第一请求消息, 其中, 所述第一请求消息中 携带有第一请求传输速度信息;  The intermediate node receives the first request message sent by the terminal, where the first request message carries the first request transmission speed information;
所述中间节点判断所述第一请求传输速度信息指示的传输速度是否为 所述中间节点能够接受的传输速度, 若是, 则将所述第一请求传输速度信 息作为中转的请求传输速度信息, 若否, 则生成用以指示所述中间节点能 够接受的传输速度作为中转的请求传输速度信息;  Determining, by the intermediate node, whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the first request transmission speed information as the requested transmission speed information of the relay, if No, generating a request transmission speed information indicating that the intermediate node can accept the transmission speed as the transit;
所述中间节点将所述中转的请求传输速度信息替换所述第一请求消息 中的第一请求传输速度信息, 向所述服务器转发携带有所述中转的请求传 输速度信息的中转的请求消息。  And the intermediate node replaces the transited request transmission speed information with the first request transmission speed information in the first request message, and forwards the relay request message carrying the transited request transmission speed information to the server.
12、根据权利要求 11所述的数据包的传输方法,其特征在于,还包括: 所述中间节点接收所述服务器发送的对应于所述中转的请求消息的响 应, 其中, 对应于所述中转的请求消息的响应中携带有反馈传输速度信息; 所述中间节点判断所述反馈传输速度信息指示的传输速度是否为所述 中间节点能够接受的传输速度, 若是, 则将所述反馈传输速度信息作为中 转的反馈传输速度信息, 若否, 则生成用以指示所述中间节点能够接受的 传输速度的中转的反馈传输速度信息; The method for transmitting a data packet according to claim 11, further comprising: the intermediate node receiving a response of the request message corresponding to the relay sent by the server, where the intermediate node corresponds to the relay The response of the request message carries feedback transmission speed information; the intermediate node determines whether the transmission speed indicated by the feedback transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, the feedback transmission speed information As Turning feedback transmission speed information, if not, generating feedback transmission speed information for indicating the transit speed of the intermediate node;
所述中间节点将所述中转的反馈传输速度信息替换所述响应中的反馈 传输速度信息, 向所述终端转发携带有所述中转的反馈传输速度信息的中 转的响应。  The intermediate node replaces the feedback transmission transmission speed information of the relay with the feedback transmission speed information in the response, and forwards a response of the relay carrying the relayed transmission transmission speed information to the terminal.
13、 一种终端, 其特征在于, 包括:  13. A terminal, comprising:
请求消息发送单元, 用于向第一节点发送第一请求消息, 其中, 所述 第一请求消息中携带有第一请求传输速度信息, 所述第一节点为服务器或 中间节点;  a request message sending unit, configured to send a first request message to the first node, where the first request message carries first request transmission speed information, where the first node is a server or an intermediate node;
响应处理单元, 用于接收所述第一节点发送的响应, 获取所述第一请 求消息的响应中的第一反馈传输速度信息, 以使所述请求消息发送单元根 据所述第一反馈传输速度信息指示的传输速度向所述第一节点发送第二请 求消息, 其中, 所述第一反馈传输速度信息用以指示所述第一节点能够接 受的传输速度, 所述第二请求消息中携带有第二请求传输速度信息。  a response processing unit, configured to receive a response sent by the first node, and obtain first feedback transmission speed information in a response of the first request message, so that the request message sending unit is configured according to the first feedback transmission speed The transmission speed indicated by the information is sent to the first node, where the first feedback transmission speed information is used to indicate a transmission speed that the first node can accept, and the second request message carries The second request transmits speed information.
14、 根据权利要求 13所述的终端, 其特征在于:  14. The terminal of claim 13, wherein:
所述响应处理单元还用于若所述第一反馈传输速度信息指示的传输速 度等于所述第一请求传输速度信息指示的传输速度, 则将所述第一请求传 输速度信息指示的传输速度指数增长, 生成用以指示指数增长后的传输速 度的所述第二请求传输速度信息, 根据所述第二请求传输速度信息生成所 述第二请求消息; 若所述第一反馈传输速度信息指示的传输速度小于所述 第一请求传输速度信息指示的传输速度, 则将所述第一请求传输速度信息 指示的传输速度线性增长, 生成用以指示线性增长后的传输速度的所述第 二请求传输速度信息, 根据所述第二请求传输速度信息生成所述第二请求 消息。  The response processing unit is further configured to: if the transmission speed indicated by the first feedback transmission speed information is equal to the transmission speed indicated by the first request transmission speed information, transmit the transmission speed index indicated by the first request transmission speed information Generating, generating the second request transmission speed information to indicate an exponentially increasing transmission speed, generating the second request message according to the second request transmission speed information; if the first feedback transmission speed information indicates Transmitting speed is less than the transmission speed indicated by the first request transmission speed information, and linearly increasing the transmission speed indicated by the first request transmission speed information to generate the second request transmission for indicating a linearly increasing transmission speed Speed information, generating the second request message according to the second request transmission speed information.
15、 根据权利要求 13所述的终端, 其特征在于:  15. The terminal of claim 13, wherein:
所述第一请求消息为 GET请求消息,所述 GET请求消息中还携带有请 求的数据包信息;  The first request message is a GET request message, and the GET request message further carries the requested data packet information;
相应地, 所述终端还包括:  Correspondingly, the terminal further includes:
第一处理单元, 用于获取所述响应中的数据包, 对所述数据包进行相 应地处理, 并更新数据包接收日志。  The first processing unit is configured to acquire a data packet in the response, process the data packet correspondingly, and update the data packet receiving log.
16、 根据权利要求 13所述的终端, 其特征在于: 所述第一请求消息为 PUT/POST第一请求消息, 所述 PUT/POST第一 请求消息中还携带有数据包; 16. The terminal of claim 13 wherein: The first request message is a PUT/POST first request message, and the PUT/POST first request message further carries a data packet;
相应地, 所述终端还包括:  Correspondingly, the terminal further includes:
第二处理单元, 用于更新数据包发送日志。  The second processing unit is configured to update the data packet sending log.
17、 根据权利要求 13所述的终端, 其特征在于, 还包括:  The terminal according to claim 13, further comprising:
重新请求单元, 用于若在向所述第一节点发送第一请求消息后预设时 间内, 未接收到所述第一节点发送的响应, 则向所述第一节点重新发送所 述第一请求消息。  a re-requesting unit, configured to resend the first node to the first node if the response sent by the first node is not received within a preset time after sending the first request message to the first node Request message.
18、 一种服务器, 其特征在于, 包括:  18. A server, comprising:
第一请求接收单元, 用于接收第二节点发送的请求消息, 其中, 所述 请求消息中携带有请求传输速度信息, 所述第二节点为终端或中间节点; 第一判断单元, 用于判断所述请求传输速度信息指示的传输速度是否 为所述服务器能够接受的传输速度, 若是, 则将所述请求传输速度信息作 为反馈传输速度信息, 若否, 则生成用以指示所述服务器能够接收的传输 速度作为反馈传输速度信息;  a first request receiving unit, configured to receive a request message sent by the second node, where the request message carries request transmission speed information, the second node is a terminal or an intermediate node, and the first determining unit is configured to determine Whether the transmission speed indicated by the request transmission speed information is a transmission speed acceptable to the server, and if yes, using the requested transmission speed information as feedback transmission speed information, and if not, generating to indicate that the server can receive Transmission speed as feedback transmission speed information;
第一响应单元, 用于根据所述反馈传输速度信息生成对应于所述请求 消息的响应, 向所述第二节点发送对应于所述请求消息的响应。  And a first response unit, configured to generate a response corresponding to the request message according to the feedback transmission speed information, and send a response corresponding to the request message to the second node.
19、 根据权利要求 18所述的服务器, 其特征在于, 还包括: 传输速度确定单元, 用于获取所述服务器的参数信息, 根据所述参数 信息确定所述服务器能够接受的传输速度, 其中, 所述参数信息包括以下 至少一种: 所述服务器的中央处理器空闲时间信息、 所述服务器的内存余 量信息和所述服务器的带宽占用信息。  The server according to claim 18, further comprising: a transmission speed determining unit, configured to acquire parameter information of the server, and determine, according to the parameter information, a transmission speed acceptable to the server, where The parameter information includes at least one of the following: central processor idle time information of the server, memory remaining amount information of the server, and bandwidth occupation information of the server.
20、 根据权利要求 18所述的服务器, 其特征在于:  20. The server of claim 18, wherein:
所述请求消息为 GET请求消息,所述 GET请求消息中还携带有请求的 数据包信息;  The request message is a GET request message, and the GET request message further carries the requested data packet information;
相应地, 所述第一响应单元还用于根据所述请求的数据包信息对应的 数据包生成对应于所述请求消息的响应, 将所述反馈传输速度信息添加到 所述响应中。  Correspondingly, the first response unit is further configured to generate a response corresponding to the request message according to the data packet corresponding to the requested data packet information, and add the feedback transmission speed information to the response.
21、 根据权利要求 18所述的服务器, 其特征在于:  21. The server of claim 18, wherein:
所述请求消息为 PUT/POST请求消息, 所述 PUT/POST请求消息中还 携带有数据包; 相应地, 所述第一响应单元还用于生成用以指示收到所述 PUT/POST 请求消息中的数据包的响应, 将所述反馈传输速度信息添加到所述响应中。 The request message is a PUT/POST request message, and the PUT/POST request message further carries a data packet; Correspondingly, the first response unit is further configured to generate a response to indicate receipt of the data packet in the PUT/POST request message, and add the feedback transmission speed information to the response.
22、 一种中间节点, 其特征在于, 包括:  22. An intermediate node, comprising:
第一代理接收单元, 用于接收终端发送的第一请求消息, 其中, 所述 第一请求消息中携带有第一请求传输速度信息;  a first proxy receiving unit, configured to receive a first request message sent by the terminal, where the first request message carries first request transmission speed information;
第二判断单元, 用于判断所述第一请求传输速度信息指示的传输速度 是否为所述中间节点能够接受的传输速度, 若是, 则将所述第一请求传输 速度信息作为中转的请求传输速度信息, 若否, 则生成用以指示所述中间 节点能够接受的传输速度作为中转的请求传输速度信息;  a second determining unit, configured to determine whether the transmission speed indicated by the first request transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the first request transmission speed information as a request transmission speed of the relay Information, if not, generating request transmission speed information indicating that the intermediate node can accept the transmission speed as the transit;
第一代理发送单元, 用于将所述中转的请求传输速度信息替换所述第 一请求消息中的第一请求传输速度信息, 向所述服务器转发携带有所述中 转的请求传输速度信息的中转的请求消息。  a first proxy sending unit, configured to replace the transited request transmission speed information with the first request transmission speed information in the first request message, and forward the relay carrying the requested transmission speed information to the server Request message.
23、 根据权利要求 22所述的中间节点, 其特征在于, 还包括: 第二代理接收单元, 用于接收所述服务器发送的对应于所述中转的请 求消息的响应, 其中, 对应于所述中转的请求消息的响应中携带有反馈传 输速度信息;  The intermediate node according to claim 22, further comprising: a second proxy receiving unit, configured to receive a response that is sent by the server and is corresponding to the request message of the relay, where The response of the relayed request message carries feedback transmission speed information;
第三判断单元, 用于判断所述反馈传输速度信息指示的传输速度是否 为所述中间节点能够接受的传输速度, 若是, 则将所述反馈传输速度信息 作为中转的反馈传输速度信息, 若否, 则生成用以指示所述中间节点能够 接受的传输速度的中转的反馈传输速度信息;  a third determining unit, configured to determine whether the transmission speed indicated by the feedback transmission speed information is a transmission speed acceptable to the intermediate node, and if yes, using the feedback transmission speed information as feedback transmission speed information of the relay, if not And generating feedback transmission speed information for indicating the transfer speed of the transmission speed acceptable to the intermediate node;
第二代理发送单元, 用于将所述中转的反馈传输速度信息替换所述响 应中的反馈传输速度信息 , 向所述终端转发携带有所述中转的反馈传输速 度信息的中转的响应。  And a second proxy sending unit, configured to replace the feedback transmission transmission speed information in the response with the feedback transmission speed information, and forward the response of the relay carrying the relayed feedback transmission speed information to the terminal.
24、 一种数据包的传输方法, 其特征在于, 所述数据包的传输方法基 于 CoAP协议, 包括:  A data packet transmission method, characterized in that the data packet transmission method is based on a CoAP protocol, and includes:
终端向服务器发送所述终端生成的通信请求消息, 其中, 所述通信请 求消息中携带有第一数据包请求指示信息或第一响应间隔指示信息, 所述 第一数据包请求指示信息指示至少两个向所述服务器获取的数据包信息, 所述第一响应间隔指示信息用以指示所述服务器在收到至少两个数据包后 向应;  The terminal sends a communication request message generated by the terminal to the server, where the communication request message carries the first data packet request indication information or the first response interval indication information, where the first data packet request indication information indicates at least two Data packet information obtained by the server, the first response interval indication information is used to indicate that the server responds after receiving at least two data packets;
所述终端接收所述服务器发送的对应于所述通信请求消息的响应。 The terminal receives a response sent by the server corresponding to the communication request message.
25、 根据权利要求 24所述的数据包的传输方法, 其特征在于: 所述通 信请求消息为第一 GET通信请求消息; 所述方法进一步包括: The method for transmitting a data packet according to claim 24, wherein: the communication request message is a first GET communication request message;
所述终端根据第一数据包接收日志确定第一网络丟包率;  Determining, by the terminal, a packet loss rate of the first network according to the first data packet receiving log;
终端向服务器发送所述终端生成的通信请求消息, 包括:  Sending, by the terminal, the communication request message generated by the terminal to the server, including:
所述终端根据所述第一网络丟包率生成所述第一数据包请求指示信 息,并生成所述第一 GET通信请求消息,所述第一 GET通信请求消息携带 所述第一数据包请求指示信息 , 若所述第一网络丟包率小于第一预设阔值 , 所述第一数据包请求指示信息指示至少两个向所述服务器获取的数据包信 息; 向所述服务器发送所述第一 GET通信请求消息, 以使所述服务器根据 所述第一数据包请求指示信息发送携带有与所述第一数据包请求指示信息 对应的数据包的响应。  The terminal generates the first data packet request indication information according to the first network packet loss rate, and generates the first GET communication request message, where the first GET communication request message carries the first data packet request Instructing information, if the first network packet loss rate is less than a first preset threshold, the first data packet request indication information indicates at least two data packet information acquired to the server; and sending the And a first GET communication request message, so that the server sends a response carrying the data packet corresponding to the first data packet request indication information according to the first data packet request indication information.
26、 根据权利要求 25所述的数据包的传输方法, 其特征在于, 所述方 法进一步包括: 所述终端根据第二数据包接收日志确定第二网络丟包率; 所述终端根据所述第二网络丟包率生成所述第二数据包请求指示信 息;  The method for transmitting a data packet according to claim 25, wherein the method further comprises: determining, by the terminal, a packet loss rate of the second network according to the second data packet receiving log; Generating, by the second network packet loss rate, the second data packet request indication information;
若所述第二网络丟包率小于所述第一预设阔值, 所述第二数据请求指 示信息指示的向所述服务器获取的数据包的数量大于第一数据包请求指示 信息指示的向所述服务器获取的数据包的数量; 或, 若所述第二网络丟包 率大于第二预设域值, 所述第二数据请求指示信息指示的向所述服务器获 取的数据包的数量小于所述第一数据包请求指示信息指示的向所述服务器 获取的数据包的数量;  If the packet loss rate of the second network is smaller than the first preset threshold, the number of data packets acquired by the second data request indication information to the server is greater than the direction indicated by the first data packet request indication information. The number of data packets acquired by the server; or, if the second network packet loss rate is greater than the second preset domain value, the number of data packets obtained by the second data request indication information to the server is less than The first data packet request indication information indicates the number of data packets acquired by the server;
所述终端生成第二 GET通信请求消息,所述第二 GET通信请求消息携 带所述第二数据包请求指示信息;  The terminal generates a second GET communication request message, and the second GET communication request message carries the second data packet request indication information;
所述终端向所述服务器发送第二 GET通信请求消息, 以使所述服务器 根据所述第二数据包请求指示信息发送携带有与所述第二数据包请求指示 信息对应的数据包的响应。  The terminal sends a second GET communication request message to the server, so that the server sends a response carrying the data packet corresponding to the second data packet request indication information according to the second data packet request indication information.
27、 根据权利要求 24所述的数据包的传输方法, 其特征在于: 所述通 信请求消息为第一 PUT/POST通信请求消息; 所述方法进一步包括:  The method for transmitting a data packet according to claim 24, wherein: the communication request message is a first PUT/POST communication request message; the method further comprising:
所述终端根据第一数据包发送日志确定第三网络丟包率;  Determining, by the terminal, a packet loss rate of the third network according to the first data packet sending log;
终端向服务器发送所述终端生成的通信请求消息, 包括:  Sending, by the terminal, the communication request message generated by the terminal to the server, including:
所述终端根据所述第三网络丟包率生成所述第一响应间隔指示信息, 根据所述第一响应间隔指示信息生成所述第一 PUT/POST通信请求消息, 向所述服务器发送所述第一 PUT/POST通信请求消息, 若所述第三网络丟 包率小于第一预设阔值, 所述第一响应间隔指示信息用以指示所述服务器 在收到至少两个数据包后响应; 以使所述服务器在接收到所述第一响应间 隔指示信息指示的数量的数据包后返回响应。 The terminal generates the first response interval indication information according to the third network packet loss rate, Generating the first PUT/POST communication request message according to the first response interval indication information, and sending the first PUT/POST communication request message to the server, if the third network packet loss rate is less than the first pre- Setting a threshold value, the first response interval indication information is used to indicate that the server responds after receiving at least two data packets, so that the server receives the data indicated by the first response interval indication information. The response is returned after the package.
28、 根据权利要求 27所述的数据包的传输方法, 其特征在于, 所述方 法进一步包括:  The method for transmitting a data packet according to claim 27, wherein the method further comprises:
所述终端根据第二数据包发送日志确定第四网络丟包率;  Determining, by the terminal, a packet loss rate of the fourth network according to the second data packet sending log;
所述终端根据所述第四网络丟包率生成所述第二响应间隔指示信息; 若所述第四网络丟包率小于所述第一预设阔值, 所述第二响应间隔指 示信息指示的数量大于所述第一响应间隔指示信息指示的数量; 或, 若第 四网络丟包率大于第二预设域值, 所述第二响应间隔指示信息指示的数量 小于所述第一响应间隔指示信息指示的数量;  The terminal generates the second response interval indication information according to the fourth network packet loss rate; if the fourth network packet loss rate is less than the first preset threshold, the second response interval indication information indication The number of the first response interval indication information is greater than the number of the first response interval indication information; or, if the fourth network packet loss rate is greater than the second preset domain value, the second response interval indication information indicates that the number is smaller than the first response interval. The number indicated by the indication information;
所述终端根据所述第二响应间隔指示信息生成第二 PUT/POST通信请 求消息, 向所述服务器发送所述第二 PUT/POST通信请求消息; 以使所述 服务器在接收到所述第二响应间隔指示信息指示的数量的数据包后返回响 应。  The terminal generates a second PUT/POST communication request message according to the second response interval indication information, and sends the second PUT/POST communication request message to the server, so that the server receives the second The response is returned after the interval indication information indicates the number of packets.
29、 一种数据包的传输方法, 其特征在于, 所述数据包的传输方法基 于 CoAP协议, 包括:  A data packet transmission method, characterized in that the data packet transmission method is based on a CoAP protocol, and includes:
服务器接收终端发送的通信请求消息, 其中, 所述请求消息中携带有 数据包请求指示信息或响应间隔指示信息, 所述数据包请求指示信息具体 为至少两个向所述服务器获取的数据包信息, 所述响应间隔指示信息用以 指示所述服务器在收到至少两个数据包后响应;  The server receives the communication request message sent by the terminal, where the request message carries the data packet request indication information or the response interval indication information, where the data packet request indication information is specifically at least two data packet information acquired by the server. The response interval indication information is used to indicate that the server responds after receiving at least two data packets;
所述服务器对所述通信请求消息进行解析, 获取所述请求消息中的指 示信息, 根据所述指示信息向所述终端返回响应。  The server parses the communication request message, obtains the indication information in the request message, and returns a response to the terminal according to the indication information.
30、 根据权利要求 29所述的数据包的传输方法, 其特征在于: 所述通信请求消息为通信 GET请求消息,所述 GET通信请求消息中携 带有数据包请求指示信息;  The method for transmitting a data packet according to claim 29, wherein: the communication request message is a communication GET request message, and the GET communication request message carries data packet request indication information;
相应地, 所述服务器获取所述请求消息中的指示信息, 根据所述指示 信息向所述终端返回响应, 包括:  Correspondingly, the server obtains the indication information in the request message, and returns a response to the terminal according to the indication information, including:
所述服务器获取所述 GET通信请求消息中的数据包请求指示信息指示 至少两个向所述服务器获取的数据包信息, 根据所述向服务器获取的数据 包信息对应的数据包生成至少两个响应, 向所述终端发送所述至少两个响 应, 其中, 每个所述响应中携带一个数据包。 The server acquires a data packet request indication information indication in the GET communication request message And generating at least two responses to the data packet corresponding to the data packet information acquired by the server, and sending the at least two responses to the terminal, where each The response carries a packet.
31、 根据权利要求 29所述的数据包的传输方法, 其特征在于: 所述请求消息为 PUT/POST通信请求消息, 所述 PUT/POST通信请求 消息中携带有响应间隔指示信息和一个数据包;  The method for transmitting a data packet according to claim 29, wherein: the request message is a PUT/POST communication request message, and the PUT/POST communication request message carries response interval indication information and a data packet. ;
所述服务器获取所述请求消息中的指示信息, 根据所述指示信息向所 述终端返回响应, 包括:  The server obtains the indication information in the request message, and returns a response to the terminal according to the indication information, including:
所述服务器获取所述 PUT/POST通信请求消息中的响应间隔指示信息, 在接收到所述响应间隔指示信息对应数量的数据包后, 向所述终端发送所 述响应。  The server acquires the response interval indication information in the PUT/POST communication request message, and after receiving the data packet corresponding to the response interval indication information, sends the response to the terminal.
32、 根据权利要求 28所述的数据包的传输方法, 其特征在于: 所述请求消息为 PUT/POST通信请求消息, 所述 PUT/POST通信请求 消息中携带有响应间隔指示信息和一个数据包;  The method for transmitting a data packet according to claim 28, wherein: the request message is a PUT/POST communication request message, and the PUT/POST communication request message carries response interval indication information and a data packet. ;
所述服务器获取所述请求消息中的指示信息, 根据所述指示信息向所 述终端返回响应, 包括:  The server obtains the indication information in the request message, and returns a response to the terminal according to the indication information, including:
所述服务器在上一次向所述终端返回响应时启动定时器, 进行预设时 间的定时;  The server starts a timer when returning a response to the terminal last time, and performs timing of a preset time;
所述服务器在所述预设时间结束前, 当接收到所述响应间隔指示信息 对应数量的数据包时,向所述终端发送数据包接收成功响应; 或当所述预设 时间结束, 仍未接收到所述响应间隔指示信息对应数量的数据包时, 向所 述终端发送数据包接收失败响应。  The server sends a data packet reception success response to the terminal when receiving the data packet corresponding to the response interval indication information before the end of the preset time; or when the preset time is over, When receiving the data packet corresponding to the response interval indication information, sending a data packet reception failure response to the terminal.
33、 一种终端, 其特征在于, 包括:  33. A terminal, comprising:
第一请求单元, 用于向服务器发送所述终端生成的通信请求消息, 其 中, 所述通信请求消息中携带有第一数据包请求指示信息或第一响应间隔 指示信息, 所述第一数据包请求指示信息指示至少两个向所述服务器获取 的数据包信息, 所述第一响应间隔指示信息用以指示所述服务器在收到至 少两个数据包后响应;  a first requesting unit, configured to send, to the server, a communication request message generated by the terminal, where the communication request message carries first data packet request indication information or first response interval indication information, the first data packet The request indication information indicates at least two pieces of data packet information acquired by the server, where the first response interval indication information is used to indicate that the server responds after receiving at least two data packets;
响应接收单元, 用于接收所述服务器发送的对应于所述通信请求消息 的响应。  And a response receiving unit, configured to receive a response sent by the server corresponding to the communication request message.
34、 根据权利要求 33所述的终端, 其特征在于: 所述通信请求消息为 第一 GET通信请求消息; The terminal according to claim 33, wherein: the communication request message is First GET communication request message;
相应地, 所述终端还包括: 第一丟包率确定单元, 用于根据第一数据 包接收日志确定第一网络丟包率;  Correspondingly, the terminal further includes: a first packet loss rate determining unit, configured to determine, according to the first data packet receiving log, a first network packet loss rate;
所述第一请求单元还用于所述终端根据所述第一网络丟包率生成所述 第一数据包请求指示信息, 并生成所述第一 GET通信请求消息, 所述第一 GET通信请求消息携带所述第一数据包请求指示信息, 若所述第一网络丟 包率小于第一预设阔值, 所述第一数据包请求指示信息指示至少 2个向服 务器获取的数据包信息; 向所述服务器发送所述第一 GET通信请求消息, 以使所述服务器根据所述第一数据包请求指示信息发送携带有与所述第一 数据包请求指示信息对应的数据包的响应。  The first requesting unit is further configured to: generate, by the terminal, the first data packet request indication information according to the first network packet loss rate, and generate the first GET communication request message, the first GET communication request The message carries the first data packet request indication information, and if the first network packet loss rate is less than the first preset threshold, the first data packet request indication information indicates at least two data packet information acquired by the server; Sending the first GET communication request message to the server, so that the server sends a response carrying a data packet corresponding to the first data packet request indication information according to the first data packet request indication information.
35、 根据权利要求 34所述的终端, 其特征在于, 还包括:  The terminal according to claim 34, further comprising:
第二丟包率确定单元, 用于根据第二数据包接收日志确定第二网络丟 包率;  a second packet loss rate determining unit, configured to determine a second network packet loss rate according to the second data packet receiving log;
第二请求单元, 用于根据所述第二网络丟包率生成所述第二数据包请 求指示信息, 若所述第二网络丟包率小于所述第一预设阔值, 所述第二数 据请求指示信息指示的向所述服务器获取的数据包的数量大于第一数据包 请求指示信息指示的向所述服务器获取的数据包的数量; 或,若所述第二网 络丟包率大于第二预设域值, 所述第二数据请求指示信息指示的向所述服 务器获取的数据包的数量小于所述第一数据包请求指示信息指示的向所述 服务器获取的数据包的数量, 生成第二 GET通信请求消息, 所述第二 GET 通信请求消息携带所述第二数据包请求指示信息, 向所述服务器发送第二 GET通信请求消息, 以使所述服务器根据所述第二数据包请求指示信息发 送携带有与所述第二数据包请求指示信息对应的数据包的响应。  a second requesting unit, configured to generate the second data packet request indication information according to the second network packet loss rate, where the second network packet loss rate is less than the first preset threshold, the second The number of data packets acquired by the data request indication information to the server is greater than the number of data packets acquired by the server indicated by the first data packet request indication information; or, if the second network packet loss rate is greater than the number a second preset domain value, the number of data packets acquired by the second data request indication information to the server is smaller than the number of data packets acquired by the first data packet request indication information and sent to the server, and generated a second GET communication request message, the second GET communication request message carrying the second data packet request indication information, and sending a second GET communication request message to the server, so that the server is configured according to the second data packet The request indication information transmits a response carrying a data packet corresponding to the second data packet request indication information.
36、 根据权利要求 33所述的终端, 其特征在于: 所述通信请求消息为 第一 PUT/POST通信请求消息;  36. The terminal according to claim 33, wherein: the communication request message is a first PUT/POST communication request message;
所述终端还包括: 第三丟包率确定单元, 用于根据第一数据包发送日 志确定第三网络丟包率;  The terminal further includes: a third packet loss rate determining unit, configured to determine a third network packet loss rate according to the first data packet sending log;
所述第一请求单元还用于根据所述第三网络丟包率生成所述响应间隔 指示信息, 根据所述第一响应间隔指示信息生成所述第一 PUT/POST通信 请求消息, 向所述服务器发送所述第一 PUT/POST通信请求消息, 若所述 第三网络丟包率小于第一预设阔值, 所述第一响应间隔指示信息用以指示 所述服务器在收到至少两个数据包后响应; 以使所述服务器在接收到所述 第一响应间隔指示信息指示的数量的数据包后返回响应。 The first requesting unit is further configured to generate the response interval indication information according to the third network packet loss rate, and generate the first PUT/POST communication request message according to the first response interval indication information, to the The server sends the first PUT/POST communication request message, and if the third network packet loss rate is less than the first preset threshold, the first response interval indication information is used to indicate The server responds after receiving at least two data packets; so that the server returns a response after receiving the number of data packets indicated by the first response interval indication information.
37、 根据权利要求 36所述的终端, 其特征在于, 还包括:  37. The terminal according to claim 36, further comprising:
第四丟包率确定单元, 用于根据第二数据包发送日志确定第四网络丟 包率;  a fourth packet loss rate determining unit, configured to determine a fourth network packet loss rate according to the second data packet sending log;
第三请求单元, 用于根据所述第四网络丟包率生成所述第二响应间隔 指示信息, 若所述第四网络丟包率小于所述第一预设阔值, 所述第二响应 间隔指示信息指示的数量大于所述第一响应间隔指示信息指示的数量; 或, 若第四网络丟包率大于第二预设域值, 所述第二响应间隔指示信息指示的 数量小于所述第一响应间隔指示信息指示的数量, 所述终端根据所述第二 响应间隔指示信息生成第二 PUT/POST通信请求消息, 向所述服务器发送 所述第二 PUT/POST通信请求消息; 以使所述服务器在接收到所述第二响 应间隔指示信息指示的数量的数据包后返回响应。  a third requesting unit, configured to generate the second response interval indication information according to the fourth network packet loss rate, where the second network packet loss rate is less than the first preset threshold, the second response The number indicated by the interval indication information is greater than the number indicated by the first response interval indication information; or, if the fourth network packet loss rate is greater than the second preset domain value, the second response interval indication information indicates that the number is smaller than the number The first response interval indicates the number indicated by the information, the terminal generates a second PUT/POST communication request message according to the second response interval indication information, and sends the second PUT/POST communication request message to the server; The server returns a response after receiving the data packet of the quantity indicated by the second response interval indication information.
38、 一种服务器, 其特征在于, 包括:  38. A server, comprising:
第二请求接收单元, 用于接收终端发送的通信请求消息, 其中, 所述 请求消息中携带有数据包请求指示信息或响应间隔指示信息, 所述数据包 请求指示信息具体为至少两个向所述服务器获取的数据包信息, 所述响应 间隔指示信息用以指示所述 Λ良务器在收到至少两个数据包后响应;  a second request receiving unit, configured to receive a communication request message sent by the terminal, where the request message carries data packet request indication information or response interval indication information, where the data packet request indication information is specifically at least two directions Decoding the packet information obtained by the server, where the response interval indication information is used to indicate that the server responds after receiving at least two data packets;
第二响应单元, 用于对所述通信请求消息进行解析, 获取所述请求消 息中的指示信息, 根据所述指示信息向所述终端返回响应。  And a second response unit, configured to parse the communication request message, obtain indication information in the request message, and return a response to the terminal according to the indication information.
39、 根据权利要求 38所述的服务器, 其特征在于: 所述通信请求消息 为 GET通信请求消息,所述 GET通信请求消息中携带有数据包请求指示信 息;  The server according to claim 38, wherein: the communication request message is a GET communication request message, and the GET communication request message carries a data packet request indication message;
所述第二响应单元还用于所述服务器获取所述 GET通信请求消息中的 数据包请求指示信息指示至少两个向所述服务器获取的数据包信息, 根据 所述向服务器获取的数据包信息对应的数据包生成至少两个响应, 向所述 终端发送所述至少两个响应, 其中, 每个所述响应中携带一个数据包。  The second response unit is further configured to: the server obtains the data packet request indication information in the GET communication request message, and indicates at least two data packet information acquired by the server, according to the data packet information acquired by the server. The corresponding data packet generates at least two responses, and the at least two responses are sent to the terminal, where each of the responses carries one data packet.
40、 根据权利要求 38 所述的服务器, 其特征在于: 所述请求消息为 PUT/POST通信请求消息, 所述 PUT/POST通信请求消息中携带有响应间 隔指示信息和一个数据包;  The server according to claim 38, wherein: the request message is a PUT/POST communication request message, and the PUT/POST communication request message carries response interval indication information and a data packet;
相应地, 所述第二响应单元还用于获取所述 PUT/POST通信请求消息 中的响应间隔指示信息, 在接收到所述响应间隔指示信息对应数量的数据 包后, 向所述终端发送所述响应。 Correspondingly, the second response unit is further configured to acquire the PUT/POST communication request message. The response interval indication information is sent to the terminal after receiving the data packet corresponding to the response interval indication information.
41、 根据权利要求 38 所述的服务器, 其特征在于: 所述请求消息为 41. The server according to claim 38, wherein: the request message is
PUT/POST通信请求消息, 所述 PUT/POST通信请求消息中携带有响应间 隔指示信息和一个数据包; a PUT/POST communication request message, where the PUT/POST communication request message carries response interval indication information and a data packet;
相应地, 所述第二响应单元还用于所述服务器在上一次向所述终端返 回响应时启动定时器, 进行预设时间的定时, 在所述预设时间结束前, 当 接收到所述响应间隔指示信息对应数量的数据包时, 向所述终端发送数据 包接收成功响应; 或当所述预设时间结束,仍未接收到所述响应间隔指示信 息对应数量的数据包时, 向所述终端发送数据包接收失败响应。  Correspondingly, the second response unit is further configured to: when the server returns a response to the terminal, start a timer to perform a preset time, before the preset time ends, when the When the response interval indication information corresponds to the quantity of data packets, sending a data packet reception success response to the terminal; or when the preset time expires, the corresponding number of data packets of the response interval indication information are still not received, The terminal sends a packet reception failure response.
PCT/CN2013/072567 2012-05-04 2013-03-14 Data packet transmission method and device WO2013163908A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210137429.6A CN103384181B (en) 2012-05-04 2012-05-04 The transmission method and equipment of data packet
CN201210137429.6 2012-05-04

Publications (1)

Publication Number Publication Date
WO2013163908A1 true WO2013163908A1 (en) 2013-11-07

Family

ID=49491890

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/072567 WO2013163908A1 (en) 2012-05-04 2013-03-14 Data packet transmission method and device

Country Status (2)

Country Link
CN (1) CN103384181B (en)
WO (1) WO2013163908A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111726658A (en) * 2020-06-12 2020-09-29 腾讯科技(深圳)有限公司 Multimedia data transmission method and device
CN114884913A (en) * 2022-01-10 2022-08-09 中国移动通信有限公司研究院 Message interaction method and device, electronic equipment, message server and storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168274B (en) * 2014-08-05 2018-11-09 广州华多网络科技有限公司 Processing method, client and the server of data acquisition request
CN106254242A (en) * 2016-08-04 2016-12-21 胡汉强 A kind of data transmission method, Centralized Controller, forwarding face equipment and local terminal communicator
CN107342978B (en) * 2017-05-27 2020-12-22 广州市百果园信息技术有限公司 Live broadcast room microphone connection control method and device and corresponding terminal equipment
CN107329803A (en) * 2017-07-07 2017-11-07 北京金山安全管理系统技术有限公司 Virtual machine management method and device
CN109600316B (en) 2017-09-30 2022-08-26 华为技术有限公司 Method and device for controlling flow
CN111223321A (en) * 2018-11-26 2020-06-02 华为技术有限公司 Method, equipment and system for automatic driving planning
CN110298001B (en) * 2019-05-30 2021-11-09 北京奇艺世纪科技有限公司 Method and device for acquiring log data packet and computer readable storage medium
CN111210542B (en) * 2019-12-30 2022-04-05 潍柴动力股份有限公司 Method and device for manufacturing acquisition configuration of vehicle-mounted terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1860715A (en) * 2004-03-26 2006-11-08 松下电器产业株式会社 Communication processing device, home electric device, and home network system
CN101471747A (en) * 2007-12-29 2009-07-01 华为技术有限公司 Method for regulating signal speed, medium gateway and medium gateway controller
US20110191644A1 (en) * 2010-02-04 2011-08-04 Dot Hill Systems Corporation Method and apparatus for SAS speed adjustment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101833528A (en) * 2010-04-06 2010-09-15 四川和芯微电子股份有限公司 Method for regulating transmission speed of electronic equipment
JP2012004811A (en) * 2010-06-16 2012-01-05 Fuji Xerox Co Ltd Communication apparatus, and program therefor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1860715A (en) * 2004-03-26 2006-11-08 松下电器产业株式会社 Communication processing device, home electric device, and home network system
CN101471747A (en) * 2007-12-29 2009-07-01 华为技术有限公司 Method for regulating signal speed, medium gateway and medium gateway controller
US20110191644A1 (en) * 2010-02-04 2011-08-04 Dot Hill Systems Corporation Method and apparatus for SAS speed adjustment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111726658A (en) * 2020-06-12 2020-09-29 腾讯科技(深圳)有限公司 Multimedia data transmission method and device
CN114884913A (en) * 2022-01-10 2022-08-09 中国移动通信有限公司研究院 Message interaction method and device, electronic equipment, message server and storage medium

Also Published As

Publication number Publication date
CN103384181B (en) 2018-04-20
CN103384181A (en) 2013-11-06

Similar Documents

Publication Publication Date Title
WO2013163908A1 (en) Data packet transmission method and device
JP6319608B2 (en) Transmission control method, apparatus and system
JP7174058B2 (en) Methods and devices, storage media, and electronic devices for determining transmission modes
KR102156687B1 (en) Method and multi-homed equipment for establishing a multipath connection
KR100585230B1 (en) Method and system for setting TCP proxy in order to reduce packet loss and transmission delay in wire/wireless integrated IP network
US6646987B1 (en) Method and system for transmission control protocol (TCP) packet loss recovery over a wireless link
EP3979594A1 (en) Packet forwarding method and apparatus for heterogeneous network
US8984158B2 (en) Data communication system and method
US11088957B2 (en) Handling of data packet transfer via a proxy
JP2018500827A (en) Data transmission method and apparatus
US20130176847A1 (en) Communication processing method, apparatus and gateway device
WO2011100911A2 (en) Detection processing method, data transmitter, data receiver and communication system
WO2019100831A1 (en) Transmission layer protocol adaptation method, and network element device and system
JP7479427B2 (en) Point-to-point database synchronization over transport protocols
WO2014194797A2 (en) Transmission control protocol(tcp)connection control parameter in-band signaling
CN108173851B (en) High-efficiency multimedia transmission method for spatial information network
US9949300B2 (en) Packet transmission method and system, and station
WO2010130156A1 (en) Method, apparatus and system for transmitting ack response in bidirectional data transmission
WO2014161421A1 (en) Data transmission method, device, and system
WO2013152614A1 (en) System and method for network access based on application layer data
JP5662779B2 (en) Communication system and node device
CN109391675B (en) Reliable transmission method applied to WSN (Wireless sensor network) from sink node to sensor node
JP2008085950A (en) Rate control method using tcp, server and program
Fu et al. Active network based TCP-friendly congestion control for reliable multicast

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: 13784386

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: 13784386

Country of ref document: EP

Kind code of ref document: A1