[go: up one dir, main page]

CN107733903B - Data transmission confirmation method based on UDP (user Datagram protocol) and base station - Google Patents

Data transmission confirmation method based on UDP (user Datagram protocol) and base station Download PDF

Info

Publication number
CN107733903B
CN107733903B CN201710998300.7A CN201710998300A CN107733903B CN 107733903 B CN107733903 B CN 107733903B CN 201710998300 A CN201710998300 A CN 201710998300A CN 107733903 B CN107733903 B CN 107733903B
Authority
CN
China
Prior art keywords
layer protocol
data packet
timer
base station
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710998300.7A
Other languages
Chinese (zh)
Other versions
CN107733903A (en
Inventor
张勍
盛煜
李先达
单丽雅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201710998300.7A priority Critical patent/CN107733903B/en
Publication of CN107733903A publication Critical patent/CN107733903A/en
Application granted granted Critical
Publication of CN107733903B publication Critical patent/CN107733903B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1848Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W80/00Wireless network protocols or protocol adaptations to wireless operation
    • H04W80/06Transport layer protocols, e.g. TCP [Transport Control Protocol] over wireless

Landscapes

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

Abstract

本发明实施例提供一种基于UDP的数据传输确认方法和基站,涉及数据传输领域,能够节省上行网络资源,提高上行无线资源利用率。该方法包括:基站接收服务器发送的数据包并解析获取IP五元组信息;当基站根据IP五元组信息中的传输层协议字段、目的IP地址和目的端口号确定数据包的传输层协议是UDP且数据包的应用层协议为需要传输消息确认包的类型时,基站根据目的IP地址将数据包发送给对应的用户终端,同时设定定时器开始计时;当定时器计时时间等于定时器门限值时,基站根据IP五元组信息和应用层协议模拟用户终端生成消息确认包并发送给服务器。

Embodiments of the present invention provide a UDP-based data transmission confirmation method and a base station, which relate to the field of data transmission, can save uplink network resources, and improve the utilization rate of uplink wireless resources. The method includes: the base station receives the data packet sent by the server and analyzes and obtains the IP quintuple information; when the base station determines the transport layer protocol of the data packet according to the transport layer protocol field, the destination IP address and the destination port number in the IP quintuple information. UDP and the application layer protocol of the data packet is the type that needs to transmit a message confirmation packet, the base station sends the data packet to the corresponding user terminal according to the destination IP address, and sets the timer to start timing; when the timer timing is equal to the timer gate When the limit value is reached, the base station simulates the user terminal according to the IP quintuple information and the application layer protocol to generate a message confirmation packet and send it to the server.

Description

一种基于UDP的数据传输确认方法和基站A UDP-based data transmission confirmation method and base station

技术领域technical field

本发明涉及数据传输领域,尤其涉及一种基于UDP的数据传输确认方法和基站。The invention relates to the field of data transmission, in particular to a UDP-based data transmission confirmation method and a base station.

背景技术Background technique

在网络通信中,由于用户数据报协议(UDP,User Datagram Protocol)处理数据包时具有资源消耗小、处理速度快的特点,在音频、视频和数据传送时得到广泛的应用。UDP的主要作用是将网络数据流量压缩成数据包的形式,但UDP不提供数据包分组、组装且不能对数据包进行排序,接收端也不对接收的报文发出确认。因此,一些数据业务基于传输开销小的特点选择UDP成为传输层协议,但为了使服务器能够明确数据传输的成功与否从而决定继续传输还是传输停止,需要在应用层需要另外添加消息确认机制,从而保障数据传输的可靠性。例如,TFTP(Trival File Transfer Protocol,简单文件传输协议)就是基于UDP协议的简单文件传输协议,用户终端使用ACK(Acknowledgement,确认字符)包作为消息确认包向服务器告知自己成功接收数据。In network communication, because User Datagram Protocol (UDP, User Datagram Protocol) has the characteristics of low resource consumption and fast processing speed when processing data packets, it is widely used in audio, video and data transmission. The main function of UDP is to compress network data traffic into the form of data packets, but UDP does not provide data packet grouping, assembly, and cannot sort data packets, and the receiving end does not send confirmation to received packets. Therefore, some data services choose UDP as the transport layer protocol based on the characteristics of low transmission overhead. However, in order for the server to determine whether the data transmission is successful or not and decide whether to continue the transmission or stop the transmission, an additional message confirmation mechanism needs to be added at the application layer. Ensure the reliability of data transmission. For example, TFTP (Trival File Transfer Protocol, simple file transfer protocol) is a simple file transfer protocol based on the UDP protocol. The user terminal uses an ACK (Acknowledgment, confirmation character) packet as a message confirmation packet to inform the server that it has successfully received data.

使用ACK包等消息确认包机制,虽然可以实现基于UDP协议的可靠传输,但同时也带来了与TCP(Transmission Control Protocol,传输控制协议)协议类似的传输网络资源开销增加的问题。尤其是,基于UDP协议的ACK包消息,其功能单一,只用于确认包接收情况,包格式简单,包长极小,例如TFTP协议的ACK包只有4个字节,但该ACK包通过无线网络由用户终端发送给基站,进而由基站转发给服务器时,需要叠加UDP封装和IP(InternetProtocol,网络之间互连的协议)封装,IP包的数据部分大小甚至小于包头大小,其次在移动网络内还需要进一步封装为物理层数据包,ACK包实际承载的信息较小,封装和包头等占用资源要比需要传输的数据还多,这样就造成了无线网络的传输资源被浪费。因此,如何提高ACK包的发送效率,从而提高上行传输资源利用率成为一个亟待解决的问题。Using a message confirmation packet mechanism such as an ACK packet, although reliable transmission based on the UDP protocol can be realized, it also brings about the problem of increased transmission network resource overhead similar to the TCP (Transmission Control Protocol, Transmission Control Protocol) protocol. In particular, the ACK packet message based on the UDP protocol has a single function and is only used to confirm the reception of the packet. The packet format is simple and the packet length is extremely small. When the network is sent from the user terminal to the base station, and then forwarded by the base station to the server, it is necessary to superimpose UDP encapsulation and IP (Internet Protocol, a protocol for interconnection between networks) encapsulation. The size of the data part of the IP packet is even smaller than the size of the header. Secondly, in the mobile network The ACK packet needs to be further encapsulated into a physical layer data packet. The actual information carried by the ACK packet is small, and the encapsulation and packet header occupy more resources than the data to be transmitted, which causes the transmission resources of the wireless network to be wasted. Therefore, how to improve the transmission efficiency of ACK packets, thereby improving the utilization rate of uplink transmission resources has become an urgent problem to be solved.

发明内容Contents of the invention

本发明的实施例提供一种基于UDP的数据传输确认方法和基站,能够提高无线网络上行网络资源利用率。Embodiments of the present invention provide a UDP-based data transmission confirmation method and a base station, which can improve the utilization rate of uplink network resources in a wireless network.

为达到上述目的,本发明的实施例采用如下技术方案:In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:

第一方面,提供一种基于UDP的数据传输确认方法,包括:In the first aspect, a UDP-based data transmission confirmation method is provided, including:

基站接收服务器发送的数据包并解析数据包以获取数据包的互联网协议IP五元组信息;基站根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为用户数据报协议UDP,同时根据IP五元组信息中的目的IP地址和目的端口号判断数据包的应用层协议类型;当基站确定数据包的传输层协议是UDP且数据包的应用层协议为需要传输消息确认包的类型时,基站根据目的IP地址将数据包发送给对应的用户终端,同时设定定时器开始计时;当定时器计时时间等于定时器门限值时,基站根据IP五元组信息和应用层协议模拟用户终端生成消息确认包并发送给服务器。The base station receives the data packet sent by the server and parses the data packet to obtain the Internet Protocol IP 5-tuple information of the data packet; the base station judges whether the transport layer protocol of the data packet is the user datagram protocol according to the transport layer protocol field in the IP 5-tuple information UDP, while judging the application layer protocol type of the data packet according to the destination IP address and destination port number in the IP quintuple information; type of the packet, the base station sends the data packet to the corresponding user terminal according to the destination IP address, and sets the timer to start counting; when the timer time is equal to the timer threshold value, the base station The layer protocol simulates the user terminal to generate a message confirmation packet and send it to the server.

上述实施例提供的基于UDP的数据传输确认方法,在该方法中,当数据包的传输层协议为UDP且应用层协议是需要返回消息确认包时,基站在将从服务器接收到的数据包发送给用户终端时,设定一个定时器,定时器的门限值为数据包在基站和用户终端之间数据传输的往返时间长度与用户客户端处理并生成错误包的时间长度之和,如果一切正常,用户终端会在定时器计时到门限值之前就已经收到该数据包,基站则在定时器计时到门限值时根据对数据包的解析生成的IP五元组信息生成一个消息确认包并发送给服务器,因为该消息确认包是根据对数据包的解析信息生成的即该消息确认包相当于是基站模拟用户终端生成的,所以服务器在接到该消息确认包后确定用户已收到数据包便可以准备下一数据包的发送;因而在整个方法流程中可以使得用户终端不需要通过无线网络发送消息确认包给基站,节省了这一阶段的网络资源使用,进而提高了上行无线资源利用率。The UDP-based data transmission confirmation method provided by the above-mentioned embodiments, in this method, when the transport layer protocol of the data packet is UDP and the application layer protocol needs to return a message confirmation packet, the base station sends the data packet received from the server For the user terminal, set a timer. The threshold value of the timer is the sum of the round-trip time length of the data packet between the base station and the user terminal and the time length of the user client to process and generate an error packet. If all Normally, the user terminal will have received the data packet before the timer reaches the threshold value, and the base station will generate a message confirmation according to the IP quintuple information generated by analyzing the data packet when the timer reaches the threshold value Because the message confirmation packet is generated based on the analysis information of the data packet, that is, the message confirmation packet is equivalent to being generated by the base station simulating the user terminal, so the server determines that the user has received the message confirmation packet after receiving the message confirmation packet The data packet can prepare the sending of the next data packet; therefore, in the whole process of the method, the user terminal does not need to send a message confirmation packet to the base station through the wireless network, which saves the use of network resources at this stage, thereby improving the uplink wireless resources. utilization rate.

可选的,基站根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为用户数据报协议UDP包括:基站根据IP五元组信息中的传输层协议字段获取传输层协议字段的值;若传输层协议的值为预设值,则数据包的传输层协议为UDP。Optionally, the base station judges whether the transport layer protocol of the data packet is User Datagram Protocol UDP according to the transport layer protocol field in the IP quintuple information, including: the base station obtains the transport layer protocol according to the transport layer protocol field in the IP quintuple information The value of the field; if the value of the transport layer protocol is the default value, the transport layer protocol of the data packet is UDP.

示例性的,当基站发送数据包给用户终端时,用户终端也会有一个定时器,正常情况下在定时器计时到达门限值时用户终端会顺利接收到该数据包,但如果出现数据拥堵或者其他原因导致该定时器计时时间到达定时器门限值时用户终端未能接收到该数据包,则用户终端会生成错误包发送给基站用于告知基站该用户终端未能正常接收到该数据包,则此时优选的,该方法还包括:若定时器计时时间小于定时器门限值,基站接收到用户终端发送的错误包,则基站控制定时器停止计时并将错误包发送给服务器;错误包用于标识用户终端未能成功接收该数据包。Exemplarily, when the base station sends a data packet to the user terminal, the user terminal also has a timer. Normally, the user terminal will successfully receive the data packet when the timer reaches the threshold value, but if data congestion occurs Or other reasons cause the user terminal to fail to receive the data packet when the timer time reaches the timer threshold, the user terminal will generate an error packet and send it to the base station to inform the base station that the user terminal has failed to receive the data normally packet, then preferably at this time, the method also includes: if the timer counting time is less than the timer threshold value, the base station receives the error packet sent by the user terminal, then the base station controls the timer to stop timing and sends the error packet to the server; The error packet is used to identify that the user terminal failed to receive the data packet successfully.

可选的,该方法还包括:当定时器计时时间等于定时器门限值时,基站控制定时器重置,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制定时器开始计时。Optionally, the method also includes: when the timer timing time is equal to the timer threshold value, the base station controls the timer reset, and sends the next time the transport layer protocol is UDP and the application layer protocol is the type of message confirmation packet that needs to be transmitted The control timer starts counting when the packet is received.

可选的,基站控制定时器停止计时之后还包括:基站控制定时器重置,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制定时器开始计时。Optionally, after the base station controls the timer to stop counting, it also includes: the base station controls the timer reset, and controls the timer to start when the next transmission layer protocol is UDP and the application layer protocol is a type of data packet that needs to transmit a message confirmation packet timing.

第二方面,提供一种基站,包括:接收模块、解析模块、发送模块和模拟模块;接收模块用于接收服务器发送的数据包;解析模块用于解析接收模块接收的数据包以获取数据包的IP五元组信息,并根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为UDP,同时根据IP五元组信息中的目的IP地址和目的端口号判断数据包的应用层协议类型;发送模块用于在解析模块确定数据包的传输层协议是用户数据报协议UDP,且数据包的应用层协议为需要传输消息确认包的类型时,将数据包发送给用户终端,同时设定定时器开始计时;当定时器计时时间等于定时器门限值时,模拟模块用于根据解析模块获取的数据包的参数信息模拟用户终端生成消息确认包并由发送模块发送给服务器。In the second aspect, a base station is provided, including: a receiving module, an analyzing module, a sending module and an analog module; the receiving module is used to receive the data packet sent by the server; the analyzing module is used to analyze the data packet received by the receiving module to obtain the data packet IP 5-tuple information, and judge whether the transport layer protocol of the data packet is UDP according to the transport layer protocol field in the IP 5-tuple information, and judge the destination IP address and destination port number of the data packet according to the IP 5-tuple information. Application layer protocol type; the sending module is used to send the data packet to the user terminal when the analysis module determines that the transport layer protocol of the data packet is the user datagram protocol UDP, and the application layer protocol of the data packet is the type that needs to transmit a message confirmation packet , at the same time set the timer to start counting; when the timer timing is equal to the timer threshold value, the simulation module is used to simulate the user terminal to generate a message confirmation packet according to the parameter information of the data packet obtained by the analysis module and send it to the server by the sending module .

具体的,解析模块具体用于:根据IP五元组信息中的传输层协议字段获取传输层协议字段的值;若传输层协议字段的值为预设值,则数据包的传输层协议为UDP。Specifically, the parsing module is specifically used to: obtain the value of the transport layer protocol field according to the transport layer protocol field in the IP quintuple information; if the value of the transport layer protocol field is a preset value, the transport layer protocol of the data packet is UDP .

优选的,若定时器计时时间小于定时器门限值,接收模块接收到用户终端发送的错误包,则发送模块还用于控制定时器停止计时并将错误包发送给服务器;错误包用于标识用户终端未能成功接收该数据包。Preferably, if the timer counting time is less than the timer threshold value, the receiving module receives the error packet sent by the user terminal, then the sending module is also used to control the timer to stop counting and send the error packet to the server; the error packet is used to identify The user terminal failed to receive the packet successfully.

可选的,当定时器计时时间等于定时器门限值时,发送模块控制定时器重置,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制定时器开始计时。Optionally, when the timer timing is equal to the timer threshold value, the sending module controls the timer reset, and when sending the next time the transport layer protocol is UDP and the application layer protocol is the type of data packet that needs to transmit a message confirmation packet The control timer starts timing.

可选的,发送模块在控制定时器停止计时后重置定时器,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制定时器开始计时。Optionally, the sending module resets the timer after the control timer stops timing, and controls the timer to start timing when the next transmission layer protocol is UDP and the application layer protocol is a type of data packet that needs to transmit a message confirmation packet.

本发明实施例提供的基于UDP的数据传输确认方法和基站,因为该方法包括:基站接收服务器发送的数据包并解析数据包以获取数据包的互联网协议IP五元组信息;基站根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为用户数据报协议UDP,同时根据IP五元组信息中的目的IP地址和目的端口号判断数据包的应用层协议类型;当基站确定数据包的传输层协议是UDP且数据包的应用层协议为需要传输消息确认包的类型时,基站根据目的IP地址将数据包发送给对应的用户终端,同时设定定时器开始计时;当定时器计时时间等于定时器门限值时,基站根据IP五元组信息和应用层协议模拟用户终端生成消息确认包并发送给服务器。在该方法中,当数据包的传输层协议为UDP且应用层协议是需要返回消息确认包时,基站在将从服务器接收到的数据包发送给用户终端时,设定一个定时器,定时器的门限值为数据包在基站和用户终端之间数据传输的往返时间长度与用户客户端处理并生成错误包的时间长度之和,如果一切正常,用户终端会在定时器计时到门限值之前就已经收到该数据包,基站则在定时器计时到门限值时根据对数据包的解析生成的IP五元组信息生成一个消息确认包并发送给服务器,因为该消息确认包是根据对数据包的解析信息生成的即该消息确认包相当于是基站模拟用户终端生成的,所以服务器在接到该消息确认包后确定用户已收到数据包便可以准备下一数据包的发送;因而在整个方法流程中可以使得用户终端不需要通过无线网络发送消息确认包给基站,节省了这一阶段的网络资源使用,进而提高了上行无线资源利用率。The UDP-based data transmission confirmation method and base station provided by the embodiments of the present invention, because the method includes: the base station receives the data packet sent by the server and parses the data packet to obtain the Internet Protocol IP quintuple information of the data packet; The transport layer protocol field in the group information judges whether the transport layer protocol of the data packet is UDP, and judges the application layer protocol type of the data packet according to the destination IP address and destination port number in the IP quintuple information; when the base station When it is determined that the transport layer protocol of the data packet is UDP and the application layer protocol of the data packet is the type that needs to transmit a message confirmation packet, the base station sends the data packet to the corresponding user terminal according to the destination IP address, and sets the timer to start timing; When the timer counting time is equal to the timer threshold value, the base station simulates the user terminal according to the IP quintuple information and the application layer protocol to generate a message confirmation packet and send it to the server. In this method, when the transport layer protocol of the data packet is UDP and the application layer protocol needs to return a message confirmation packet, the base station sets a timer when sending the data packet received from the server to the user terminal, and the timer The threshold value is the sum of the round-trip time length of the data packet between the base station and the user terminal and the length of time the user client processes and generates an error packet. If everything is normal, the user terminal will count to the threshold value in the timer The data packet has been received before, and the base station generates a message confirmation packet according to the IP quintuple information generated by analyzing the data packet when the timer reaches the threshold value, and sends it to the server, because the message confirmation packet is based on The message acknowledgment packet generated from the analysis information of the data packet is equivalent to that generated by the base station simulating the user terminal, so the server can prepare to send the next data packet after receiving the message acknowledgment packet after confirming that the user has received the data packet; In the whole process of the method, the user terminal does not need to send a message confirmation packet to the base station through the wireless network, which saves the use of network resources at this stage, thereby improving the utilization rate of uplink wireless resources.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明实施例提供的一种基于UDP的数据传输确认方法流程示意图;FIG. 1 is a schematic flow chart of a UDP-based data transmission confirmation method provided by an embodiment of the present invention;

图2为本发明另一实施例提供的一种基于UDP的数据传输确认方法流程示意图;Fig. 2 is a schematic flow chart of a UDP-based data transmission confirmation method provided by another embodiment of the present invention;

图3为本发明实施例提供的一种基站结构示意图。FIG. 3 is a schematic structural diagram of a base station provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

需要说明的是,本发明实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本发明实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used for example, illustration or illustration. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present invention shall not be construed as being more preferred or more advantageous than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.

还需要说明的是,本发明实施例中,“的(英文:of)”,“相应的(英文:corresponding,relevant)”和“对应的(英文:corresponding)”有时可以混用,应当指出的是,在不强调其区别时,其所要表达的含义是一致的。It should also be noted that, in the embodiments of the present invention, "的 (English: of)", "corresponding (English: corresponding, relevant)" and "corresponding (English: corresponding)" can sometimes be used in combination. It should be pointed out that , when the difference is not emphasized, the meanings they want to express are consistent.

现有技术中,服务器、基站和用户终端之间基于UDP的数据传输的过程中用于确认数据包传输成功的消息确认包格式简单、包长极小,使得其在用户终端到服务器之间的无线网络传输中需要添加的各类封装的数据大小甚至大于该消息确认包实际需要传输的数据大小,这在一定程度上对于上行无线资源是一种浪费,所以需要有一种新的基于UDP的数据传输确认方案来减小这种浪费,从而达到提高上行无线资源利用率的效果。In the prior art, in the UDP-based data transmission process between the server, the base station, and the user terminal, the message confirmation packet used to confirm the successful transmission of the data packet has a simple format and a very small packet length, so that it is between the user terminal and the server. The size of various encapsulated data that needs to be added in wireless network transmission is even larger than the actual data size that needs to be transmitted in the message confirmation packet, which is a waste of uplink wireless resources to a certain extent, so a new UDP-based data is needed The transmission confirmation scheme is used to reduce this waste, so as to achieve the effect of improving the utilization rate of uplink wireless resources.

针对上述问题,参照图1所示,本发明实施例提供一种基于UDP的数据传输确认方法,该方法包括:In view of the above problems, referring to Fig. 1, an embodiment of the present invention provides a UDP-based data transmission confirmation method, the method comprising:

101、基站接收服务器发送的数据包并解析数据包以获取数据包的IP五元组信息。101. The base station receives the data packet sent by the server and parses the data packet to obtain IP quintuple information of the data packet.

具体的,这里所说的解析数据包是将数据包的封装和原始数据分开,并将数据包的封装中包含的各项信息解封出来,其中解析所得的IP五元组信息包括:目的IP地址、源IP地址、目的端口号、源端口号和传输层协议字段。Specifically, the parsing of the data packet mentioned here is to separate the encapsulation of the data packet from the original data, and decapsulate the various information contained in the encapsulation of the data packet, wherein the IP quintuple information obtained by parsing includes: destination IP Address, source IP address, destination port number, source port number, and transport layer protocol fields.

102、基站根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为UDP,同时根据IP五元组信息中的目的IP地址和目的端口号判断数据包的应用层协议类型。102. The base station judges whether the transport layer protocol of the data packet is UDP according to the transport layer protocol field in the IP quintuple information, and judges the application layer protocol type of the data packet according to the destination IP address and destination port number in the IP quintuple information .

具体的,传输层协议字段的值不同时,传输层协议也不同,在现有技术中,每一种传输层协议对应一个值;102步骤中的基站根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为用户数据报协议UDP具体可以包括:基站根据IP五元组信息中的传输层协议字段获取传输层协议字段的值;若传输层协议的值为预设值,则数据包的传输层协议为UDP;现有技术中,UDP针对的传输层协议字段的值为17。Specifically, when the value of the transport layer protocol field is different, the transport layer protocol is also different. In the prior art, each transport layer protocol corresponds to a value; the base station in step 102 according to the transport layer protocol in the IP quintuple information Whether the field determines whether the transport layer protocol of the data packet is the User Datagram Protocol UDP may specifically include: the base station obtains the value of the transport layer protocol field according to the transport layer protocol field in the IP quintuple information; if the value of the transport layer protocol is a preset value , then the transport layer protocol of the data packet is UDP; in the prior art, the value of the transport layer protocol field for UDP is 17.

103、当基站确定数据包的传输层协议是UDP且数据包的应用层协议为需要传输消息确认包的类型时,基站根据目的IP地址将数据包发送给对应的用户终端,同时设定定时器开始计时。103. When the base station determines that the transport layer protocol of the data packet is UDP and the application layer protocol of the data packet is the type that needs to transmit a message confirmation packet, the base station sends the data packet to the corresponding user terminal according to the destination IP address, and sets a timer at the same time start the timer.

具体的,这里所说的需要传输消息确认包的应用层协议一般是为了保证数据包传输的可靠性设计的基于UDP的应用层协议,例如TFTP等;在数据包使用这类应用层协议时,用户终端与服务器建立通信信道准备发送的数据包后会去确定该数据包使用的是何种应用层协议,如果是这类基于UDP的应用层协议,就会去返回用于表明用户终端已接收到数据包的消息确认包给服务器,或者在不能接收到数据包时返回用于表明未能接收到数据包的错误包给服务器;示例性的,TFTP对应的目的端口号通常为69。Specifically, the application layer protocol that needs to transmit the message confirmation packet mentioned here is generally a UDP-based application layer protocol designed to ensure the reliability of data packet transmission, such as TFTP; when the data packet uses this type of application layer protocol, After the user terminal establishes a communication channel with the server and prepares to send the data packet, it will determine which application layer protocol the data packet uses. If it is such a UDP-based application layer protocol, it will return to indicate that the user terminal has received it. A message acknowledgment packet for the received data packet is sent to the server, or an error packet for indicating that the data packet cannot be received is returned to the server when the data packet cannot be received; for example, the destination port number corresponding to TFTP is usually 69.

需要说明的是,当数据包的IP五元组信息不能确定该数据包的传输层协议是UDP且数据包的应用层协议为需要传输消息确认包的类型时,依照其传输层协议和应用层协议进行数据传输和确认,具体情况参照实际而定,此处不予赘述。It should be noted that when the IP quintuple information of the data packet cannot determine that the transport layer protocol of the data packet is UDP and the application layer protocol of the data packet is the type that needs to transmit a message confirmation packet, according to its transport layer protocol and application layer The protocol performs data transmission and confirmation. The specific situation depends on the actual situation and will not be described here.

104、当定时器计时时间等于定时器门限值时,基站根据IP五元组信息和应用层协议模拟用户终端生成消息确认包并发送给服务器。104. When the time counted by the timer is equal to the threshold value of the timer, the base station simulates the user terminal according to the IP quintuple information and the application layer protocol to generate a message confirmation packet and send it to the server.

具体的,这里所说的定时器的门限值为数据包在基站和用户终端之间数据传输的往返时间长度与用户客户端处理并生成错误包的时间长度之和,通常情况下基站和用户终端之间数据传输的往返时间长度是一定的,而用户终端发现无法接收到数据包然后处理并生成错误包的时间长度则是和用户终端的处理能力有关,所以该定时器门限值的大小在设定时主要是和用户终端的处理能力相关,用户终端处理能力越强,则与之对应的定时器门限值也就越短,当然,最短也要大于基站和用户终端之间数据传输的往返时间长度;如果一切正常,用户终端会在定时器计时到门限值之前就已经收到该数据包,基站则在定时器计时到门限值时根据对数据包的解析生成的IP五元组信息生成一个消息确认包并发送给服务器,因为该消息确认包是根据对数据包的解析信息生成的即该消息确认包相当于是基站模拟用户终端生成的,所以服务器在接到该消息确认包后确定用户已收到数据包便可以准备下一数据包的发送。Specifically, the threshold value of the timer mentioned here is the sum of the round-trip time length of the data packet between the base station and the user terminal and the time length for the user client to process and generate an error packet. Usually, the base station and the user terminal The length of the round-trip time for data transmission between terminals is certain, and the length of time for the user terminal to find that it cannot receive the data packet and then process and generate an error packet is related to the processing capability of the user terminal, so the threshold value of the timer The setting is mainly related to the processing capability of the user terminal. The stronger the processing capability of the user terminal, the shorter the corresponding timer threshold value. Of course, the shortest time is greater than the data transmission between the base station and the user terminal. If everything is normal, the user terminal will have received the data packet before the timer reaches the threshold, and the base station will generate the IP address based on the analysis of the data packet when the timer reaches the threshold. The tuple information generates a message confirmation packet and sends it to the server, because the message confirmation packet is generated based on the analysis information of the data packet, that is, the message confirmation packet is equivalent to that generated by the base station simulating the user terminal, so the server receives the message confirmation After confirming that the user has received the data packet, the user can prepare to send the next data packet.

上述实施例提供的基于UDP的数据传输确认方法,在该方法中,当数据包的传输层协议为UDP且应用层协议是需要返回消息确认包时,基站在将从服务器接收到的数据包发送给用户终端时,设定一个定时器,定时器的门限值为数据包在基站和用户终端之间数据传输的往返时间长度与用户客户端处理并生成错误包的时间长度之和,如果一切正常,用户终端会在定时器计时到门限值之前就已经收到该数据包,基站则在定时器计时到门限值时根据对数据包的解析生成的IP五元组信息生成一个消息确认包并发送给服务器,因为该消息确认包是根据对数据包的解析信息生成的即该消息确认包相当于是基站模拟用户终端生成的,所以服务器在接到该消息确认包后确定用户已收到数据包便可以准备下一数据包的发送;因而在整个方法流程中可以使得用户终端不需要通过无线网络发送消息确认包给基站,节省了这一阶段的网络资源使用,进而提高了上行无线资源利用率。The UDP-based data transmission confirmation method provided by the above-mentioned embodiments, in this method, when the transport layer protocol of the data packet is UDP and the application layer protocol needs to return a message confirmation packet, the base station sends the data packet received from the server For the user terminal, set a timer. The threshold value of the timer is the sum of the round-trip time length of the data packet between the base station and the user terminal and the time length of the user client to process and generate an error packet. If all Normally, the user terminal will have received the data packet before the timer reaches the threshold value, and the base station will generate a message confirmation according to the IP quintuple information generated by analyzing the data packet when the timer reaches the threshold value Because the message confirmation packet is generated based on the analysis information of the data packet, that is, the message confirmation packet is equivalent to being generated by the base station simulating the user terminal, so the server determines that the user has received the message confirmation packet after receiving the message confirmation packet The data packet can prepare the sending of the next data packet; therefore, in the whole process of the method, the user terminal does not need to send a message confirmation packet to the base station through the wireless network, which saves the use of network resources at this stage, thereby improving the uplink wireless resources. utilization rate.

参照图2所示,本发明另一实施例还提供一种基于UDP的数据传输确认方法作为对上述实施例提供的基于UDP的数据传输确认方法更进一步的补充说明,该方法包括:As shown in FIG. 2, another embodiment of the present invention also provides a UDP-based data transmission confirmation method as a further supplementary description of the UDP-based data transmission confirmation method provided in the above-mentioned embodiment. The method includes:

201、基站接收服务器发送的数据包并解析数据包以获取数据包的IP五元组信息。201. The base station receives the data packet sent by the server and parses the data packet to obtain IP quintuple information of the data packet.

202、基站根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为UDP,同时根据IP五元组信息中的目的IP地址和目的端口号判断数据包的应用层协议类型。202. The base station judges whether the transport layer protocol of the data packet is UDP according to the transport layer protocol field in the IP quintuple information, and judges the application layer protocol type of the data packet according to the destination IP address and destination port number in the IP quintuple information .

203、当基站确定数据包的传输层协议是UDP且数据包的应用层协议为需要传输消息确认包的类型时,基站根据目的IP地址将数据包发送给对应的用户终端,同时设定定时器开始计时。203. When the base station determines that the transport layer protocol of the data packet is UDP and the application layer protocol of the data packet is the type that needs to transmit a message confirmation packet, the base station sends the data packet to the corresponding user terminal according to the destination IP address, and sets a timer at the same time start the timer.

2041、当定时器计时时间等于定时器门限值时,基站根据IP五元组信息和应用层协议模拟用户终端生成消息确认包并发送给服务器。2041. When the time counted by the timer is equal to the threshold value of the timer, the base station simulates the user terminal according to the IP quintuple information and the application layer protocol to generate a message confirmation packet and send it to the server.

2042、若定时器计时时间小于定时器门限值,基站接收到用户终端发送的错误包,则基站控制定时器停止计时并将错误包发送给服务器;错误包用于标识用户终端未能成功接收该数据包。2042. If the time counted by the timer is less than the timer threshold and the base station receives the error packet sent by the user terminal, the base station controls the timer to stop timing and sends the error packet to the server; the error packet is used to indicate that the user terminal failed to receive the packet.

示例性的,当基站发送数据包给用户终端时,用户终端也会有一个定时器,正常情况下在定时器计时到达门限值时用户终端会顺利接收到该数据包,但如果出现数据拥堵或者其他原因导致该定时器计时时间到达定时器门限值时用户终端未能接收到该数据包,则用户终端会生成错误包发送给基站用于告知基站该用户终端未能正常接收到该数据包;当然用户终端也可以是在与基站建立通信信道后实时检测数据包的发送情况,若信道拥堵无法收到该数据包则会生成错误包发送给基站,用户终端具体如何生成错误包的形式依据实际而定,此处仅为示例情况,具体情况,不做限制。Exemplarily, when the base station sends a data packet to the user terminal, the user terminal also has a timer. Normally, the user terminal will successfully receive the data packet when the timer reaches the threshold value, but if data congestion occurs Or other reasons cause the user terminal to fail to receive the data packet when the timer time reaches the timer threshold, the user terminal will generate an error packet and send it to the base station to inform the base station that the user terminal has failed to receive the data normally Of course, the user terminal can also detect the transmission of the data packet in real time after establishing a communication channel with the base station. If the channel is congested and cannot receive the data packet, it will generate an error packet and send it to the base station. How does the user terminal generate an error packet? Depending on the actual situation, this is only an example situation, and the specific situation is not limited.

205、基站控制定时器重置,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制定时器开始计时。205. The base station controls the reset of the timer, and controls the timer to start timing when the next transmission layer protocol is UDP and the application layer protocol is a type of data packet that needs to transmit a message confirmation packet.

具体的,为了保证基站发送数据包的连续性,在定时器这一发送过程计时工作完成后,在下一次基站需要发送同样性质的数据包时定时器重新开始进行计时工作。Specifically, in order to ensure the continuity of the data packets sent by the base station, after the timing work of the sending process of the timer is completed, the timer restarts the timing work when the base station needs to send a data packet of the same nature next time.

本发明实施例提供的基于UDP的数据传输确认方法,因为该方法包括:基站接收服务器发送的数据包并解析数据包以获取数据包的互联网协议IP五元组信息;基站根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为用户数据报协议UDP,同时根据IP五元组信息中的目的IP地址和目的端口号判断数据包的应用层协议类型;当基站确定数据包的传输层协议是UDP且数据包的应用层协议为需要传输消息确认包的类型时,基站根据目的IP地址将数据包发送给对应的用户终端,同时设定定时器开始计时;当定时器计时时间等于定时器门限值时,基站根据IP五元组信息和应用层协议模拟用户终端生成消息确认包并发送给服务器。在该方法中,当数据包的传输层协议为UDP且应用层协议是需要返回消息确认包时,基站在将从服务器接收到的数据包发送给用户终端时,设定一个定时器,定时器的门限值为数据包在基站和用户终端之间数据传输的往返时间长度与用户客户端处理并生成错误包的时间长度之和,如果一切正常,用户终端会在定时器计时到门限值之前就已经收到该数据包,基站则在定时器计时到门限值时根据对数据包的解析生成的IP五元组信息生成一个消息确认包并发送给服务器,因为该消息确认包是根据对数据包的解析信息生成的即该消息确认包相当于是基站模拟用户终端生成的,所以服务器在接到该消息确认包后确定用户已收到数据包便可以准备下一数据包的发送;因而在整个方法流程中可以使得用户终端不需要通过无线网络发送消息确认包给基站,节省了这一阶段的网络资源使用,进而提高了上行无线资源利用率。The UDP-based data transmission confirmation method provided by the embodiment of the present invention, because the method includes: the base station receives the data packet sent by the server and parses the data packet to obtain the Internet Protocol IP quintuple information of the data packet; the base station according to the IP quintuple information The transport layer protocol field in the data packet judges whether the transport layer protocol of the data packet is the user datagram protocol UDP, and judges the application layer protocol type of the data packet according to the destination IP address and destination port number in the IP quintuple information; when the base station determines that the data When the transport layer protocol of the packet is UDP and the application layer protocol of the data packet is the type that needs to transmit a message confirmation packet, the base station sends the data packet to the corresponding user terminal according to the destination IP address, and sets the timer to start counting; when the timer When the timing time is equal to the timer threshold value, the base station simulates the user terminal according to the IP quintuple information and the application layer protocol to generate a message confirmation packet and send it to the server. In this method, when the transport layer protocol of the data packet is UDP and the application layer protocol needs to return a message confirmation packet, the base station sets a timer when sending the data packet received from the server to the user terminal, and the timer The threshold value is the sum of the round-trip time length of the data packet between the base station and the user terminal and the length of time the user client processes and generates an error packet. If everything is normal, the user terminal will count to the threshold value in the timer The data packet has been received before, and the base station generates a message confirmation packet according to the IP quintuple information generated by analyzing the data packet when the timer reaches the threshold value, and sends it to the server, because the message confirmation packet is based on The message acknowledgment packet generated from the analysis information of the data packet is equivalent to that generated by the base station simulating the user terminal, so the server can prepare to send the next data packet after receiving the message acknowledgment packet after confirming that the user has received the data packet; In the whole process of the method, the user terminal does not need to send a message confirmation packet to the base station through the wireless network, which saves the use of network resources at this stage, thereby improving the utilization rate of uplink wireless resources.

参照图3所示,为了更好的实施上述实施例提供的基于UDP的数据传输确认方法,本发明实施例还提供一种基站02,该基站02包括:接收模块31、解析模块32、发送模块33和模拟模块34;Referring to Figure 3, in order to better implement the UDP-based data transmission confirmation method provided by the above embodiments, the embodiment of the present invention also provides a base station 02, the base station 02 includes: a receiving module 31, an analysis module 32, and a sending module 33 and an analog module 34;

接收模块31用于接收服务器01发送的数据包;The receiving module 31 is used to receive the data packet sent by the server 01;

解析模块32用于解析接收模块31接收的数据包以获取数据包的IP五元组信息,并根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为UDP,同时根据IP五元组信息中的目的IP地址和目的端口号判断数据包的应用层协议类型;Parsing module 32 is used for parsing the data packet that receiving module 31 receives to obtain the IP quintuple information of data packet, and judges whether the transport layer protocol of data packet is UDP according to the transport layer protocol field in the IP quintuple information, simultaneously according to The destination IP address and destination port number in the IP quintuple information determine the application layer protocol type of the data packet;

发送模块33用于在解析模块32确定数据包的传输层协议是用户数据报协议UDP,且数据包的应用层协议为需要传输消息确认包的类型时,将数据包发送给用户终端03,同时设定定时器开始计时;The sending module 33 is used to determine that the transport layer protocol of the data packet in the parsing module 32 is the User Datagram Protocol UDP, and when the application layer protocol of the data packet is the type that needs to transmit a message confirmation packet, the data packet is sent to the user terminal 03, and at the same time Set the timer to start timing;

当定时器计时时间等于定时器门限值时,模拟模块34用于根据解析模块32获取的数据包的参数信息模拟用户终端03生成消息确认包并由发送模块33发送给服务器01。When the timer counting time is equal to the timer threshold value, the simulation module 34 is used to simulate the user terminal 03 to generate a message confirmation packet according to the parameter information of the data packet obtained by the analysis module 32 and send it to the server 01 by the sending module 33 .

具体的,参照图3所示,解析模块32具体用于:根据IP五元组信息中的传输层协议字段获取传输层协议字段的值;若传输层协议字段的值为预设值,则数据包的传输层协议为UDP。Specifically, as shown in FIG. 3 , the parsing module 32 is specifically used to: obtain the value of the transport layer protocol field according to the transport layer protocol field in the IP quintuple information; if the value of the transport layer protocol field is a preset value, then the data The transport layer protocol of the packet is UDP.

优选的,参照图3所示,若定时器计时时间小于定时器门限值,接收模块31接收到用户终端03发送的错误包,则发送模块33还用于控制定时器停止计时并将错误包发送给服务器01;错误包用于标识用户终端03未能成功接收该数据包。Preferably, as shown in FIG. 3, if the timer counting time is less than the timer threshold value and the receiving module 31 receives the error packet sent by the user terminal 03, the sending module 33 is also used to control the timer to stop counting and send the error packet sent to the server 01; the error packet is used to indicate that the user terminal 03 failed to receive the data packet successfully.

可选的,参照图3所示,当定时器计时时间等于定时器门限值时,发送模块33控制定时器重置,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制定时器开始计时。Optionally, as shown in FIG. 3, when the timer timing time is equal to the timer threshold value, the sending module 33 controls the timer reset, and the next time the transmission layer protocol is UDP and the application layer protocol needs to transmit a message confirmation The control timer starts counting when the packet is of type data packet.

可选的,参照图3所示,发送模块33在控制定时器停止计时后重置定时器,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制定时器开始计时。Optionally, as shown in FIG. 3 , the sending module 33 resets the timer after the control timer stops counting, and when the next time the transmission layer protocol is UDP and the application layer protocol is a data packet of the type that needs to transmit a message confirmation packet The control timer starts timing.

本发明实施例提供的基站,因为该基站包括:接收模块、解析模块、发送模块和模拟模块;接收模块用于接收服务器发送的数据包;解析模块用于解析接收模块接收的数据包以获取数据包的IP五元组信息,并根据IP五元组信息中的传输层协议字段判断数据包的传输层协议是否为UDP,同时根据IP五元组信息中的目的IP地址和目的端口号判断数据包的应用层协议类型;发送模块用于在解析模块确定数据包的传输层协议是用户数据报协议UDP,且数据包的应用层协议为需要传输消息确认包的类型时,将数据包发送给用户终端,同时设定定时器开始计时;当定时器计时时间等于定时器门限值时,模拟模块用于根据解析模块获取的数据包的参数信息模拟用户终端生成消息确认包并发送给服务器。所以在该基站对接收模块从服务器接收到的数据包进行传输时,当解析模块确定数据包的传输层协议为UDP且应用层协议是需要返回消息确认包时,发送模块在将从服务器接收到的数据包发送给用户终端时,设定一个定时器,定时器的门限值为数据包在基站和用户终端之间数据传输的往返时间长度与用户客户端处理并生成错误包的时间长度之和,如果一切正常,用户终端会在定时器计时到门限值之前就已经收到该数据包,模拟模块则在定时器计时到门限值时根据解析模块对数据包的解析生成的IP五元组信息生成一个消息确认包并发送给服务器,因为该消息确认包是根据对数据包的解析信息生成的即该消息确认包相当于是基站模拟用户终端生成的,所以服务器在接到该消息确认包后确定用户已收到数据包便可以准备下一数据包的发送;因而该基站在对数据包进行发送的过程中可以使得用户终端不需要通过无线网络发送消息确认包给基站,节省了这一阶段的网络资源使用,进而提高了上行无线资源利用率。The base station provided by the embodiment of the present invention, because the base station includes: a receiving module, an analyzing module, a sending module and an analog module; the receiving module is used to receive the data packet sent by the server; the analyzing module is used to analyze the data packet received by the receiving module to obtain data The IP quintuple information of the packet, and judge whether the transport layer protocol of the data packet is UDP according to the transport layer protocol field in the IP quintuple information, and judge the data according to the destination IP address and destination port number in the IP quintuple information The application layer protocol type of the packet; the sending module is used to send the packet to The user terminal sets the timer to start timing at the same time; when the timer timing is equal to the timer threshold value, the simulation module is used to simulate the user terminal to generate a message confirmation packet according to the parameter information of the data packet obtained by the analysis module and send it to the server. Therefore, when the base station transmits the data packet received by the receiving module from the server, when the analysis module determines that the transport layer protocol of the data packet is UDP and the application layer protocol needs to return a message confirmation packet, the sending module will receive the data packet received from the server. When the data packet is sent to the user terminal, a timer is set, and the threshold value of the timer is between the round-trip time length of data transmission between the base station and the user terminal and the time length for the user client to process and generate an error packet. And, if everything is normal, the user terminal will have received the data packet before the timer counts to the threshold value, and the simulation module will generate the IP address based on the parsing of the data packet by the analysis module when the timer counts to the threshold value. The tuple information generates a message confirmation packet and sends it to the server, because the message confirmation packet is generated based on the analysis information of the data packet, that is, the message confirmation packet is equivalent to that generated by the base station simulating the user terminal, so the server receives the message confirmation After confirming that the user has received the data packet, the user can prepare to send the next data packet; thus, the base station can make the user terminal not need to send a message confirmation packet to the base station through the wireless network during the process of sending the data packet, saving this time. The use of network resources in one stage improves the utilization rate of uplink wireless resources.

本发明实施例还提供一种计算机程序,该计算机程序可直接加载到存储器中,并含有软件代码,该计算机程序经由计算机载入并执行后能够实现上述的基于UDP的数据传输确认方法。The embodiment of the present invention also provides a computer program, which can be directly loaded into the memory and contains software codes. After the computer program is loaded and executed by the computer, it can realize the above-mentioned UDP-based data transmission confirmation method.

本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that, in the above one or more examples, the functions described in the present invention may be implemented by hardware, software, firmware or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.

示例性的,该用户终端具体可以为:手机、导航仪、个人计算机(personalcomputer,PC)、上网本、个人数字助理(英文:Personal Digital Assistant,简称:PDA)、服务器等。Exemplarily, the user terminal may specifically be: a mobile phone, a navigator, a personal computer (personal computer, PC), a netbook, a personal digital assistant (English: Personal Digital Assistant, PDA for short), a server, and the like.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. All should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (10)

1.一种基于UDP的数据传输确认方法,其特征在于,包括:1. A data transmission confirmation method based on UDP, characterized in that, comprising: 基站接收服务器发送的数据包并解析所述数据包以获取所述数据包的互联网协议IP五元组信息;The base station receives the data packet sent by the server and parses the data packet to obtain the Internet Protocol IP quintuple information of the data packet; 所述基站根据所述IP五元组信息中的传输层协议字段判断所述数据包的传输层协议是否为用户数据报协议UDP,同时根据所述IP五元组信息中的目的IP地址和目的端口号判断所述数据包的应用层协议类型;The base station judges whether the transport layer protocol of the data packet is User Datagram Protocol UDP according to the transport layer protocol field in the IP quintuple information, and at the same time according to the destination IP address and destination IP address in the IP quintuple information. The port number judges the application layer protocol type of the data packet; 当所述基站确定所述数据包的传输层协议是UDP且所述数据包的应用层协议为需要传输消息确认包的类型时,所述基站根据所述目的IP地址将所述数据包发送给对应的用户终端,同时设定定时器开始计时;When the base station determines that the transport layer protocol of the data packet is UDP and the application layer protocol of the data packet is the type that needs to transmit a message confirmation packet, the base station sends the data packet to The corresponding user terminal sets the timer to start counting at the same time; 当所述定时器计时时间等于定时器门限值时,所述基站根据所述IP五元组信息和所述应用层协议模拟所述用户终端生成消息确认包并发送给所述服务器。When the timer time is equal to the timer threshold, the base station simulates the user terminal according to the IP quintuple information and the application layer protocol to generate a message confirmation packet and send it to the server. 2.根据权利要求1所述的方法,其特征在于,所述基站根据所述IP五元组信息中的传输层协议字段判断所述数据包的传输层协议是否为用户数据报协议UDP包括:2. The method according to claim 1, wherein the base station judges whether the transport layer protocol of the data packet is User Datagram Protocol UDP according to the transport layer protocol field in the IP quintuple information: 所述基站根据所述IP五元组信息中的传输层协议字段获取所述传输层协议字段的值;The base station obtains the value of the transport layer protocol field according to the transport layer protocol field in the IP quintuple information; 若所述传输层协议的值为预设值,则所述数据包的传输层协议为UDP。If the value of the transport layer protocol is a preset value, the transport layer protocol of the data packet is UDP. 3.根据权利要求1所述的方法,其特征在于,所述方法还包括:3. The method according to claim 1, characterized in that the method further comprises: 若所述定时器计时时间小于定时器门限值,所述基站接收到所述用户终端发送的错误包,则所述基站控制所述定时器停止计时并将所述错误包发送给所述服务器;所述错误包用于标识用户终端未能成功接收所述数据包。If the timer counting time is less than the timer threshold value, the base station receives the error packet sent by the user terminal, then the base station controls the timer to stop timing and sends the error packet to the server ; The error packet is used to identify that the user terminal failed to receive the data packet successfully. 4.根据权利要求1所述的方法,其特征在于,所述方法还包括:4. The method according to claim 1, wherein the method further comprises: 当所述定时器计时时间等于定时器门限值时,所述基站控制所述定时器重置,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制所述定时器开始计时。When the timer counting time is equal to the timer threshold value, the base station controls the timer to reset, and sends a data packet that the transport layer protocol is UDP and the application layer protocol is a type that needs to transmit a message confirmation packet next time When the timer is controlled to start counting. 5.根据权利要求3所述的方法,其特征在于,所述基站控制所述定时器停止计时之后还包括:5. The method according to claim 3, characterized in that after the base station controls the timer to stop counting, it further comprises: 所述基站控制所述定时器重置,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制所述定时器开始计时。The base station controls the reset of the timer, and controls the timer to start counting when the next transmission layer protocol is UDP and the application layer protocol is a type of data packet that needs to transmit a message confirmation packet. 6.一种基站,其特征在于,包括:接收模块、解析模块、发送模块和模拟模块;6. A base station, comprising: a receiving module, an analyzing module, a sending module and an analog module; 所述接收模块用于接收服务器发送的数据包;The receiving module is used to receive the data packet sent by the server; 所述解析模块用于解析所述接收模块接收的所述数据包以获取所述数据包的IP五元组信息,并根据所述IP五元组信息中的传输层协议字段判断所述数据包的传输层协议是否为UDP,同时根据所述IP五元组信息中的目的IP地址和目的端口号判断所述数据包的应用层协议类型;The parsing module is used to parse the data packet received by the receiving module to obtain the IP quintuple information of the data packet, and judge the data packet according to the transport layer protocol field in the IP quintuple information whether the transport layer protocol is UDP, and simultaneously judge the application layer protocol type of the data packet according to the destination IP address and the destination port number in the IP quintuple information; 所述发送模块用于在所述解析模块确定所述数据包的传输层协议是用户数据报协议UDP,且所述数据包的应用层协议为需要传输消息确认包的类型时,将所述数据包发送给用户终端,同时设定定时器开始计时;The sending module is configured to send the data when the parsing module determines that the transport layer protocol of the data packet is the User Datagram Protocol UDP, and the application layer protocol of the data packet is a type that needs to transmit a message confirmation packet. The packet is sent to the user terminal, and the timer is set to start counting at the same time; 当所述定时器计时时间等于定时器门限值时,所述模拟模块用于根据所述解析模块获取的所述数据包的IP五元组信息模拟用户终端生成消息确认包并由所述发送模块发送给所述服务器。When the timer timing time is equal to the timer threshold value, the simulation module is used to simulate the user terminal to generate a message confirmation packet according to the IP quintuple information of the data packet obtained by the analysis module and send it by the module is sent to the server. 7.根据权利要求6所述的基站,其特征在于,所述解析模块具体用于:7. The base station according to claim 6, wherein the parsing module is specifically used for: 根据所述IP五元组信息中的传输层协议字段获取所述传输层协议字段的值;Obtain the value of the transport layer protocol field according to the transport layer protocol field in the IP quintuple information; 若所述传输层协议字段的值为预设值,则所述数据包的传输层协议为UDP。If the value of the transport layer protocol field is a preset value, the transport layer protocol of the data packet is UDP. 8.根据权利要求6所述的基站,其特征在于,若所述定时器计时时间小于定时器门限值,所述接收模块接收到所述用户终端发送的错误包,则所述发送模块还用于控制所述定时器停止计时并将所述错误包发送给所述服务器;所述错误包用于标识用户终端未能成功接收所述数据包。8. The base station according to claim 6, wherein if the timer counting time is less than the timer threshold value, the receiving module receives the error packet sent by the user terminal, and the sending module further It is used to control the timer to stop timing and send the error packet to the server; the error packet is used to indicate that the user terminal failed to receive the data packet successfully. 9.根据权利要求6所述的基站,其特征在于,当所述定时器计时时间等于定时器门限值时,所述发送模块控制所述定时器重置,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制所述定时器开始计时。9. The base station according to claim 6, characterized in that, when the timer counting time is equal to the timer threshold value, the sending module controls the timer reset, and sends the transport layer protocol next time When the UDP and the application layer protocol are data packets that need to transmit message confirmation packets, the timer is controlled to start counting. 10.根据权利要求8所述的基站,其特征在于,所述发送模块在控制所述定时器停止计时后重置所述定时器,并在下一次发送传输层协议是UDP且应用层协议为需要传输消息确认包的类型的数据包时控制所述定时器开始计时。10. The base station according to claim 8, characterized in that, the sending module resets the timer after controlling the timer to stop counting, and sends the next time the transport layer protocol is UDP and the application layer protocol is required The timer is controlled to start counting when a data packet of the message confirmation packet type is transmitted.
CN201710998300.7A 2017-10-18 2017-10-18 Data transmission confirmation method based on UDP (user Datagram protocol) and base station Active CN107733903B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710998300.7A CN107733903B (en) 2017-10-18 2017-10-18 Data transmission confirmation method based on UDP (user Datagram protocol) and base station

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710998300.7A CN107733903B (en) 2017-10-18 2017-10-18 Data transmission confirmation method based on UDP (user Datagram protocol) and base station

Publications (2)

Publication Number Publication Date
CN107733903A CN107733903A (en) 2018-02-23
CN107733903B true CN107733903B (en) 2019-12-20

Family

ID=61213652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710998300.7A Active CN107733903B (en) 2017-10-18 2017-10-18 Data transmission confirmation method based on UDP (user Datagram protocol) and base station

Country Status (1)

Country Link
CN (1) CN107733903B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385068B (en) * 2018-12-29 2023-09-22 阿里巴巴集团控股有限公司 Data transmission method, device, electronic equipment and communication system
CN112468513B (en) * 2020-12-14 2022-09-23 南京中孚信息技术有限公司 Terminal management communication method for enterprise network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101651612A (en) * 2008-08-15 2010-02-17 深圳富泰宏精密工业有限公司 Data transmission system and method
WO2010105411A1 (en) * 2009-03-17 2010-09-23 华为技术有限公司 Method, device and system for sending data packet
CN102957730A (en) * 2011-08-29 2013-03-06 腾讯科技(深圳)有限公司 UDP (User Datagram Protocol)-based data transmission method and data transmission system
CN103051436A (en) * 2012-12-27 2013-04-17 青岛飞鸽软件有限公司 System and method for improving reliability of user datagram protocol (UDP) connection

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090240824A1 (en) * 2008-03-11 2009-09-24 Boris Rekhtman UDP Hole Punch Timeout Discovery Algorithm Over Network Address Translation Connection
JP5676067B1 (en) * 2014-07-16 2015-02-25 かもめエンジニアリング株式会社 Communication method and communication system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101651612A (en) * 2008-08-15 2010-02-17 深圳富泰宏精密工业有限公司 Data transmission system and method
WO2010105411A1 (en) * 2009-03-17 2010-09-23 华为技术有限公司 Method, device and system for sending data packet
CN102957730A (en) * 2011-08-29 2013-03-06 腾讯科技(深圳)有限公司 UDP (User Datagram Protocol)-based data transmission method and data transmission system
CN103051436A (en) * 2012-12-27 2013-04-17 青岛飞鸽软件有限公司 System and method for improving reliability of user datagram protocol (UDP) connection

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种基于跨层设计的简单可靠UDP协议;李志强 等;《解放军理工大学学报(自然科学版)》;20090630;第209-214页 *

Also Published As

Publication number Publication date
CN107733903A (en) 2018-02-23

Similar Documents

Publication Publication Date Title
CN113411313B (en) Data transmission method, device and system
CN112438038B (en) Method and device for transmitting data
US11477106B2 (en) Data packet sending method and apparatus in IPV6 network
US12185425B2 (en) Method and apparatus for realizing network capability opening, electronic device and storage medium
CN104937896B (en) The processing method and transponder of address resolution protocol message, controller
CN114363116A (en) Method and device for monitoring service quality
JP2014509483A (en) Mechanisms to improve the performance of transmission control protocols in wireless networks
CN108199925A (en) A kind of data transmission method for uplink, method of reseptance and device
WO2022143902A1 (en) Data packet transmission method and related device
US20160119848A1 (en) Method for service data management, apparatus, and system
CN103945455A (en) Method and device for sending self-adaptive heartbeat data packets
WO2021088813A1 (en) Packet encapsulating method and apparatus, and packet decapsulating method and apparatus
CN107733903B (en) Data transmission confirmation method based on UDP (user Datagram protocol) and base station
EP3490293A1 (en) Data transmission method, data receiving device, and data sending device
CN108141866A (en) A kind of method and device of processing business data packet
CN108809549A (en) A kind of method and apparatus of transmission data
EP3672189B1 (en) Data transmission method, device and system
WO2018045521A1 (en) Method and device for transmitting signaling in wireless network
CN107431965B (en) A method and device for realizing transmission control protocol TCP transmission
CN107548105B (en) Data transmission confirmation method based on UDP (user Datagram protocol) and base station
CN116032853A (en) Flow control method, device, electronic device and storage medium
CN110876160A (en) Resource transmission control method and device based on multimode base station
CN102469011B (en) Data transmission method and device
WO2017067224A1 (en) Packet processing method and apparatus
CN111800756B (en) Data sending method and device and computer readable storage medium

Legal Events

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