CN102045768A - Data transmission method, user device and data transmission system thereof - Google Patents
Data transmission method, user device and data transmission system thereof Download PDFInfo
- Publication number
- CN102045768A CN102045768A CN2009102073504A CN200910207350A CN102045768A CN 102045768 A CN102045768 A CN 102045768A CN 2009102073504 A CN2009102073504 A CN 2009102073504A CN 200910207350 A CN200910207350 A CN 200910207350A CN 102045768 A CN102045768 A CN 102045768A
- Authority
- CN
- China
- Prior art keywords
- data transmission
- packet
- data
- tcp
- user device
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 398
- 230000005540 biological transmission Effects 0.000 title claims abstract description 370
- 230000009471 action Effects 0.000 claims description 70
- 238000012545 processing Methods 0.000 claims description 50
- 238000012790 confirmation Methods 0.000 claims description 20
- 238000012546 transfer Methods 0.000 claims description 8
- 238000005259 measurement Methods 0.000 claims description 7
- 230000008569 process Effects 0.000 description 275
- 238000004891 communication Methods 0.000 description 17
- 238000010586 diagram Methods 0.000 description 8
- 238000013500 data storage Methods 0.000 description 4
- 230000007613 environmental effect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 229910052799 carbon Inorganic materials 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- PCHJSUWPFVWCPO-UHFFFAOYSA-N gold Chemical compound [Au] PCHJSUWPFVWCPO-UHFFFAOYSA-N 0.000 description 1
- 239000010931 gold Substances 0.000 description 1
- 229910052737 gold Inorganic materials 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Mobile Radio Communication Systems (AREA)
Abstract
Description
技术领域technical field
本发明涉及数据传输的方法,特别是涉及一种用于无线通讯环境下在UDP与TCP数据传输模式之间切换的数据传输方法及其用户装置与数据传输系统。The present invention relates to a data transmission method, in particular to a data transmission method for switching between UDP and TCP data transmission modes in a wireless communication environment, a user device and a data transmission system thereof.
背景技术Background technique
目前相当多移动电话用户使用移动电话进行股票交易,且这些移动电话用户可以藉由移动电话实时地查询到目前各股票交易标的的交易价格。然而股票市场的实时交易信息具有数据量小、持续传输时间长、传输密集性高且数据须正确性高等特性。藉由无线通讯网路传输的股票市场的实时交易信息,除了应用层(application layer)的数据传输之外,可能还包含传输控制协议(Transmission Control Protocol,简称为TCP)/因特网(Internet Protocol,简称为IP)的附加负担(overhead)的传输。这些附加负担包括TCP的标头(header)与确认(acknowledgement)信息。At present, quite a number of mobile phone users use mobile phones to conduct stock transactions, and these mobile phone users can inquire about the current transaction prices of various stock trading targets in real time through the mobile phones. However, real-time trading information in the stock market has the characteristics of small data volume, long continuous transmission time, high transmission intensity and high data accuracy. The real-time transaction information of the stock market transmitted through the wireless communication network may include Transmission Control Protocol (Transmission Control Protocol, referred to as TCP)/Internet Protocol (abbreviated as TCP) in addition to the data transmission of the application layer. The transmission of the additional burden (overhead) of IP). These additional burdens include TCP header and acknowledgment information.
请参照图1,图1是利用TCP传输实时交易信息的分组交换的示意图。请参照图1中,用户装置(例如,移动电话)与具有股票市场的实时交易信息的服务器在数据传输前,需要先建立TCP联机。在建立TCP联机过程中,也就是在联机程序S10,用户装置与服务器使用TCP的三向交握程序(handshaking procedure)来建立联机。在建立TCP联机后,也就是在TCP数据传输程序S11,用户装置与服务器之间会使用TCP来传输数据。Please refer to FIG. 1 . FIG. 1 is a schematic diagram of packet exchange using TCP to transmit real-time transaction information. Please refer to FIG. 1 , before data transmission between a user device (for example, a mobile phone) and a server having real-time transaction information of the stock market, a TCP connection needs to be established. In the process of establishing a TCP connection, that is, in the connection procedure S10, the user device and the server use a TCP three-way handshaking procedure (handshaking procedure) to establish a connection. After the TCP connection is established, that is, in the TCP data transmission procedure S11, the user device and the server will use TCP to transmit data.
TCP为了确保数据传输的正确性与分组的顺序,TCP利用TCP标头来纪录传送端与接收端两方的传送分组序号。此外,通常TCP标头为20字节(bytes),而每一次单向数据传输的数据分组还需要至少一个确认数据分组由接收端回复,其中确认数据分组也包括20字节的TCP标头。然而,一般股票市场的实时交易信息仅有大约为20字节。由此可知,若利用TCP来传送每一次更新股票市场的实时交易信息,所造成的附加负担是超过50%。若是再加上用户装置与服务器中断TCP联机时需要经过4个阶段的程序来中断连结,所造成的附加负担会更多。此外,电信营运商针对部分经由无线通讯网路传输的数据是以分组数量或字节数量来计算费用,在此情况下,利用TCP传送实时交易信息将导致不必要的多余通讯费用。In order to ensure the correctness of data transmission and the sequence of packets, TCP uses the TCP header to record the sequence numbers of the transmitted packets at both the sending end and the receiving end. In addition, usually the TCP header is 20 bytes, and each data packet of one-way data transmission needs at least one confirmation data packet to be replied by the receiving end, wherein the confirmation data packet also includes a 20-byte TCP header. However, the real-time transaction information of the general stock market is only about 20 bytes. It can be seen that if TCP is used to transmit the real-time transaction information of the stock market updated each time, the resulting additional burden is more than 50%. If it is added that when the user device and the server interrupt the TCP connection, it needs to go through 4 stages of procedures to interrupt the connection, and the resulting additional burden will be even more. In addition, telecom operators calculate fees based on the number of packets or bytes for part of the data transmitted through the wireless communication network. In this case, using TCP to transmit real-time transaction information will result in unnecessary redundant communication fees.
传统上,为了避免TCP联机的高附加负担,可以利用使用者数据协议(UDP)来传输股票市场的实时交易信息。UDP是非连结导向(connectionless)的通讯协议,用户装置与服务器利用UDP传输数据给对方时,仅需要发送数据,而不需要建立一个联机,且在用户装置收到数据分组后,用户装置并不需要传送确认数据分组给服务器。此外,UDP的标头仅有8字节,故此在良好的通讯质量状况下,利用UDP传输股票市场的实时交易信息的附加负担比利用TCP少很多。然而,UDP无法保证数据分组的顺序与数据分组不会遗失。此外,因为UDP没有建立联机且用户装置不会传送确认数据分组给服务器,若在通讯质量状况不佳的情况下,服务器可能不知道用户装置是否收到数据分组。Traditionally, in order to avoid the high additional load of the TCP connection, the user data protocol (UDP) can be used to transmit real-time transaction information of the stock market. UDP is a non-connection-oriented (connectionless) communication protocol. When the user device and the server use UDP to transmit data to each other, they only need to send data without establishing a connection. After the user device receives the data packet, the user device does not need Send an acknowledgment packet to the server. In addition, the header of UDP is only 8 bytes, so under good communication quality conditions, the additional burden of using UDP to transmit real-time transaction information of the stock market is much less than that of using TCP. However, UDP cannot guarantee the order of data packets and that data packets will not be lost. In addition, because the UDP connection is not established and the user device will not send the confirmation data packet to the server, if the communication quality is not good, the server may not know whether the user device has received the data packet.
发明内容Contents of the invention
本发明的示范实施例提供用于无线通讯环境下的一种数据传输方法及其用户装置与一种数据传输系统,根据所建立的联机的信道质量来决定用户装置与服务器的数据传输模式为TCP数据传输模式或UDP数据传输模式,以降低数据传输量与提升数据传输效率。An exemplary embodiment of the present invention provides a data transmission method, a user device, and a data transmission system used in a wireless communication environment. The data transmission mode between the user device and the server is determined to be TCP according to the channel quality of the established connection. Data transmission mode or UDP data transmission mode to reduce data transmission volume and improve data transmission efficiency.
本发明的示范实施例提供一种数据传输方法,此数据传输方法用于用户装置。首先,用户装置藉由TCP与服务器经由交握程序建立联机,并指定其数据传输模式为TCP数据传输模式与UDP数据传输模式的其中之一。接着,用户装置与服务器使用数据传输模式进行数据传输,其中,在进行数据传输时,用户装置或服务器根据建立联机所使用的信道的质量来决定是否切换数据传输模式。Exemplary embodiments of the present invention provide a data transmission method for a user device. First, the user device establishes a connection with the server through a handshake procedure through TCP, and specifies its data transmission mode as one of the TCP data transmission mode and the UDP data transmission mode. Next, the user device and the server use the data transmission mode to perform data transmission, wherein during the data transmission, the user device or the server determines whether to switch the data transmission mode according to the quality of the channel used to establish the connection.
本发明的示范实施例还提供一种用户装置。本发明所提供的用户装置包括无线收发器单元、TCP处理单元、UDP处理单元、TCP/UDP切换单元、信道质量参数量测单元、信道质量判断单元、存储器与处理器。无线收发器单元传送上传数据至无线接取装置以及从无线接取装置接收下载数据。TCP处理单元具有TCP端口码,TCP处理单元用以将数据封装为TCP数据分组,并将此TCP数据分组送至存储器模块,接着,无线收发器单元便能够将TCP数据分组夹带于上传数据中传送出去。另外,TCP处理单元还能将无线信号收发器所接收到的下载数据中对应于TCP端口码的TCP数据分组解封装。再者,TCP处理单元所封装与解封装的数据包括交握程序的信息与一般数据,因此,藉由TCP处理单元与无线收发单元,用户装置与服务器能够进行联机与使用TCP数据传输模式来传输数据。UDP处理单元具有UDP端口码,UDP处理单元用以将数据封装为UDP数据分组,并将此UDP数据分组送至存储器模块,接着,无线收发器单元便能够将UDP数据分组夹带于上传数据中传送出去。UDP处理单元更能将无线信号收发器所接收到的下载数据中对应于UDP端口码的UDP数据分组解封装。因此,藉由UDP处理单元与无线收发单元,用户装置与服务器能够进行使用UDP数据传输模式来传输数据。TCP/UDP切换单元用以控制用户装置与服务器之间所使用的数据传输模式为TCP数据传输模式或UDP数据传输模式。信道质量参数量测单元量测用户装置与无线接取装置的无线连结以取得信道质量参数。信道质量判断单元根据信道质量参数告知TCP/UDP切换单元是否要切换用户装置的数据传输模式。存储器模块储存信道质量参数、上传数据、下载数据、TCP数据分组与UDP数据分组。处理器用以控制TCP处理单元、UDP处理单元、TCP/UDP切换单元、信道质量参数量测单元与信道质量判断单元等组件的执行顺序。此外,处理器还用以控制无线收发器单元。Exemplary embodiments of the present invention also provide a user device. The user device provided by the present invention includes a wireless transceiver unit, a TCP processing unit, a UDP processing unit, a TCP/UDP switching unit, a channel quality parameter measuring unit, a channel quality judging unit, a memory and a processor. The wireless transceiver unit transmits upload data to the wireless access device and receives download data from the wireless access device. The TCP processing unit has a TCP port code, and the TCP processing unit is used to encapsulate the data into a TCP data packet, and send the TCP data packet to the memory module, and then, the wireless transceiver unit can entrain the TCP data packet in the uploaded data for transmission go out. In addition, the TCP processing unit can also decapsulate the TCP data packet corresponding to the TCP port code in the download data received by the wireless signal transceiver. Furthermore, the data encapsulated and decapsulated by the TCP processing unit includes handshake program information and general data, therefore, through the TCP processing unit and the wireless transceiver unit, the user device and the server can be connected and transmitted using the TCP data transmission mode data. The UDP processing unit has a UDP port code. The UDP processing unit is used to encapsulate the data into a UDP data packet and send the UDP data packet to the memory module. Then, the wireless transceiver unit can entrain the UDP data packet in the uploaded data for transmission go out. The UDP processing unit can further decapsulate the UDP data packet corresponding to the UDP port code in the download data received by the wireless signal transceiver. Therefore, through the UDP processing unit and the wireless transceiver unit, the user device and the server can use the UDP data transmission mode to transmit data. The TCP/UDP switching unit is used for controlling the data transmission mode used between the user device and the server to be TCP data transmission mode or UDP data transmission mode. The channel quality parameter measuring unit measures the wireless connection between the user equipment and the wireless access device to obtain the channel quality parameter. The channel quality judging unit notifies the TCP/UDP switching unit whether to switch the data transmission mode of the user device according to the channel quality parameter. The memory module stores channel quality parameters, upload data, download data, TCP data packets and UDP data packets. The processor is used to control the execution sequence of components such as the TCP processing unit, the UDP processing unit, the TCP/UDP switching unit, the channel quality parameter measurement unit, and the channel quality judgment unit. In addition, the processor is also used to control the wireless transceiver unit.
本发明的示范实施例还提供一种数据传输系统。本发明所提供的数据传输系统包括用户装置与服务器。用户装置与服务器藉由无线连结建立联机,用户装置用以传送上传数据与接收下载数据,服务器用以传送下载数据与接收上传数据。用户装置使用TCP与服务器经由交握程序建立联机,并指定数据传输模式为UDP数据传输模式与TCP数据传输模式的其中之一。接着,用户装置与服务器使用数据传输模式来传输数据。其中,在传输数据时,用户装置或服务器还根据建立联机所使用的信道的质量好坏来决定是否切换其数据传输模式。Exemplary embodiments of the present invention also provide a data transmission system. The data transmission system provided by the invention includes a user device and a server. The user device and the server establish a connection through a wireless connection, the user device is used for sending upload data and receiving download data, and the server is used for sending download data and receiving upload data. The user device uses TCP to establish a connection with the server through a handshake procedure, and specifies a data transmission mode as one of a UDP data transmission mode and a TCP data transmission mode. Then, the user device and the server use the data transmission mode to transmit data. Wherein, when transmitting data, the user device or the server also decides whether to switch its data transmission mode according to the quality of the channel used to establish the connection.
基于上述,本发明的示范实施例提供一种数据传输方法及其用户装置与一种数据传输系统,利用TCP的可靠性高与UDP的数据传输的额外负荷低的特性,并根据量测到信道质量参数来切换用户装置与服务器所使用的数据传输模式,也就是根据信道质量的好坏在TCP数据传输模式与UDP数据传输模式之间进行切换。如此,将可以降低数据传输量、提升数据传输效率并进而提升使用此数据传输方法的用户装置的功率使用效率以及降低不必要的通讯费用。Based on the above, exemplary embodiments of the present invention provide a data transmission method and its user equipment and a data transmission system, utilizing the characteristics of high reliability of TCP and low overhead of data transmission of UDP, and according to the measured channel The quality parameter is used to switch the data transmission mode used by the user device and the server, that is, to switch between the TCP data transmission mode and the UDP data transmission mode according to the quality of the channel. In this way, the amount of data transmission can be reduced, the efficiency of data transmission can be improved, and then the power usage efficiency of the user equipment using this data transmission method can be improved, and unnecessary communication costs can be reduced.
为使本发明的上述特征和优点能更明显易懂,下文特举示范实施例,并结合附图详细说明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, exemplary embodiments are exemplified below and described in detail with reference to the accompanying drawings.
附图说明Description of drawings
图1是利用TCP传输实时交易信息的分组交换的示意图。FIG. 1 is a schematic diagram of packet exchange using TCP to transmit real-time transaction information.
图2是根据本发明的示范实施例所绘示一种数据传输方法中分组交换的示意图。FIG. 2 is a schematic diagram of packet switching in a data transmission method according to an exemplary embodiment of the present invention.
图3是根据本发明的示范实施例所绘示一种数据传输系统的示意图。FIG. 3 is a schematic diagram of a data transmission system according to an exemplary embodiment of the present invention.
图4是根据本发明的示范实施例所绘示一种用户装置的系统方块图。FIG. 4 is a system block diagram of a user device according to an exemplary embodiment of the present invention.
图5是根据本发明的示范实施例所绘示数据传输方法的流程图。FIG. 5 is a flowchart illustrating a data transmission method according to an exemplary embodiment of the present invention.
图6是根据本发明的示范实施例所绘示结合建立联机程序与数据传输程序的细部动作的流程图。FIG. 6 is a flow chart illustrating the detailed actions of combining the connection establishment procedure and the data transmission procedure according to an exemplary embodiment of the present invention.
图7是根据本发明的示范实施例所绘示建立联机程序与切换至UDP数据传输模式的细部动作的流程图。FIG. 7 is a flow chart illustrating detailed actions of establishing a connection procedure and switching to a UDP data transmission mode according to an exemplary embodiment of the present invention.
图8是根据本发明的示范实施例所绘示的指定TCP数据传输模式的联机处理程序的细部动作的流程图。FIG. 8 is a flow chart showing detailed actions of a connection processing program specifying a TCP data transmission mode according to an exemplary embodiment of the present invention.
图9是根据本发明的示范实施例所绘示的指定UDP数据传输模式的联机处理程序的细部动作的流程图。FIG. 9 is a flow chart showing detailed operations of a connection processing program specifying a UDP data transmission mode according to an exemplary embodiment of the present invention.
图10是根据本发明的示范实施例所绘示数据传输程序的流程图。FIG. 10 is a flowchart illustrating a data transmission procedure according to an exemplary embodiment of the present invention.
图11是根据本发明的示范实施例所绘示接收端检查接收分组处理程序的细部动作的流程图。FIG. 11 is a flow chart showing detailed actions of the receiving end checking the received packet processing program according to an exemplary embodiment of the present invention.
图12是根据本发明的示范实施例所绘示发送端要求接收端回传分组序号处理程序的细部动作的流程图。FIG. 12 is a flow chart showing the detailed actions of the sending end requesting the receiving end to return a packet sequence number processing program according to an exemplary embodiment of the present invention.
图13是根据本发明的示范实施例所绘示发送端检查发送频率处理程序的细部动作的流程图。FIG. 13 is a flow chart illustrating the detailed actions of the sending end checking the sending frequency processing program according to an exemplary embodiment of the present invention.
图14是根据本发明的示范实施例所绘示数据传输程序中TCP数据传输模式切换至UDP数据传输模式的流程图。FIG. 14 is a flow chart of switching from the TCP data transmission mode to the UDP data transmission mode in the data transmission procedure according to an exemplary embodiment of the present invention.
图15是根据本发明的示范实施例所绘示数据传输程序中UDP数据传输模式切换至TCP数据传输模式的流程图。FIG. 15 is a flow chart of switching from the UDP data transmission mode to the TCP data transmission mode in the data transmission procedure according to an exemplary embodiment of the present invention.
图16是根据本发明的示范实施例所绘示中断联机程序的细部动作的流程图。FIG. 16 is a flow chart illustrating the detailed actions of interrupting the connection process according to an exemplary embodiment of the present invention.
附图符号说明Description of reference symbols
S10~S11:利用TCP传输实时交易信息的分组交换的各程序S10~S11: Each program of packet exchange using TCP to transmit real-time transaction information
S20~S23:本发明的示范实施例的数据传输方法中分组交换的各程序S20~S23: each program of packet exchange in the data transmission method of the exemplary embodiment of the present invention
310:用户装置310: user device
320:无线接取装置320: wireless access device
330:路由器330: Router
340:因特网340: Internet
350:服务器350: server
360:交易中心服务器360: trading center server
402:TCP处理单元402: TCP processing unit
404:UDP处理单元404: UDP processing unit
406:TCP/UDP切换单元406: TCP/UDP switching unit
412:信道质量参数量测单元412: channel quality parameter measurement unit
416:信道质量判断单元416: channel quality judging unit
414:无线收发器单元414: Wireless Transceiver Unit
430:第一定时器430: First timer
432:第二定时器432: second timer
434:第三定时器434: The third timer
436:第四定时器436: Fourth timer
438:第五定时器438: Fifth timer
439:计数器439: Counter
440:存储器模块440: memory module
440:处理器440: Processor
S510~S550:本发明的示范实施例的数据传输方法的各步骤S510-S550: each step of the data transmission method in the exemplary embodiment of the present invention
S602~S612:本发明的示范实施例中结合建立联机程序与数据传输程序的各步骤S602~S612: In the exemplary embodiment of the present invention, each step of combining the establishment of the online program and the data transmission program
S702~S714:本发明的示范实施例中建立联机程序的各步骤S702~S714: each step of establishing the online program in the exemplary embodiment of the present invention
S802~S806:本发明的示范实施例中TCP数据传输模式联机处理程序的各步骤S802~S806: the steps of the TCP data transmission mode online processing program in the exemplary embodiment of the present invention
S902~S920:本发明的示范实施例中UDP数据传输模式联机处理程序的各步骤S902~S920: the steps of the UDP data transmission mode online processing program in the exemplary embodiment of the present invention
S1002~S1014:本发明的示范实施例的数据传输程序的各步骤S1002~S1014: each step of the data transmission procedure of the exemplary embodiment of the present invention
S1102~S1118:本发明的示范实施例的接收端检查接收分组处理程序的各步骤S1102~S1118: The receiving end of the exemplary embodiment of the present invention checks each step of the receiving packet processing program
S1202~S1220:本发明的示范实施例的发送端要求接收端回传分组序号处理程序的各步骤S1202~S1220: the sending end of the exemplary embodiment of the present invention requires the receiving end to return the steps of the packet sequence number processing program
S1302~S1316:本发明的示范实施例的发送端检查发送频率处理程序的各步骤S1302~S1316: each step of the sending end checking the sending frequency processing program of the exemplary embodiment of the present invention
S1402~S1414:本发明的示范实施例的TCP数据传输模式切换至UDP数据传输模式的各步骤S1402~S1414: each step of switching from the TCP data transmission mode to the UDP data transmission mode in the exemplary embodiment of the present invention
S1502~S1510:本发明的示范实施例的UDP数据传输模式切换至TCP数据传输模式的各步骤S1502~S1510: each step of switching from the UDP data transmission mode to the TCP data transmission mode in the exemplary embodiment of the present invention
S1602~S1612:本发明的示范实施例的中断联机程序的各步骤S1602~S1612: each step of interrupting the online program in the exemplary embodiment of the present invention
具体实施方式Detailed ways
现在将详细参照本发明的示范实施例,所述的示范实施例多绘示于附图中,附带一提的是,整个附图中相同的参考标记用于表示相同或相似的组件。Reference will now be made in detail to the exemplary embodiments of the present invention, many of which are illustrated in the accompanying drawings, wherein like reference numerals are used throughout the drawings to designate the same or like components.
根据本发明的示范实施例,本发明的示范实施例提供一种用于无线通讯环境下的数据传输方法及其用户装置与使用此数据传输方法的一种数据传输系统,上述的数据传输方法可以让移动电话与服务器之间有效率且可靠地使用TCP与UDP来传输实时交易信息或其特性类似的信息。换言之,本发明的示范实施例的传输方法适合传输具有数据量小、持续传输时间长、传输密集性高且数据须正确性高等特性的信息。另外,要说明的是,在本文中使用TCP来传输数据的模式称为TCP数据传输模式,而使用UDP来传输数据的模式则称为UDP数据传输模式。According to an exemplary embodiment of the present invention, the exemplary embodiment of the present invention provides a data transmission method used in a wireless communication environment, a user device thereof, and a data transmission system using the data transmission method. The above data transmission method can be Let the mobile phone and the server efficiently and reliably use TCP and UDP to transmit real-time transaction information or information with similar characteristics. In other words, the transmission method of the exemplary embodiment of the present invention is suitable for transmitting information with the characteristics of small data volume, long continuous transmission time, high transmission intensity and high data accuracy. In addition, it should be noted that in this paper, the mode of using TCP to transmit data is called the TCP data transmission mode, and the mode of using UDP to transmit data is called the UDP data transmission mode.
首先请参照图2,图2是根据本发明的示范实施例所绘示一种数据传输方法中分组交换的示意图。根据本发明的示范实施例,上述的数据传输方法应用在用户装置与服务器之间的数据传输,其中,用户装置可以是,但不限定于,手持装置、笔记型计算机或其它具有无线通讯功能的移动装置。首先,在联机程序S20,用户装置使用TCP与服务器经由三向交握程序建立联机,并指定使用的数据传输模式。接着,用户装置在与服务器建立联机后,也就是在UDP数据传输程序S21,用户装置与服务器使用指定的数据传输模式进行数据传输。在这个例子中,所指定的数据传输模式为UDP数据传输模式,因此,在用户装置与服务器使用TCP建立联机后,服务器便改用UDP来传送数据分组给用户装置。在此值得一提的是,服务器使用UDP来传输数据给用户装置时,若用户装置成功地收到服务器所传送的分组时,用户装置并不需要回复确认数据分组给服务器。Please refer to FIG. 2 first. FIG. 2 is a schematic diagram of packet switching in a data transmission method according to an exemplary embodiment of the present invention. According to an exemplary embodiment of the present invention, the above-mentioned data transmission method is applied to data transmission between a user device and a server, wherein the user device may be, but not limited to, a handheld device, a notebook computer or other devices with wireless communication functions mobile device. First, in the connection procedure S20, the user device uses TCP to establish a connection with the server through a three-way handshake procedure, and specifies the data transmission mode to be used. Next, after the user device establishes a connection with the server, that is, in the UDP data transmission procedure S21, the user device and the server perform data transmission using a designated data transmission mode. In this example, the designated data transmission mode is UDP data transmission mode. Therefore, after the connection between the user device and the server is established using TCP, the server uses UDP instead to transmit data packets to the user device. It is worth mentioning here that when the server uses UDP to transmit data to the user device, if the user device successfully receives the packet sent by the server, the user device does not need to reply the server with an acknowledgment data packet.
若用户装置与服务器之间的信道质量良好,则用户装置与服务器将继续使用UDP进行数据传输程序。若信道质量开始恶化到一定程度时,则在进行S22时,因为信道质量恶化的缘故,用户装置一直无法正确地接收到数据分组。接着,在用户装置重复地请求重发数据分组的次数到达预定数量,或者等待时间数据分组到达预定时间时,用户装置与服务器会切换到TCP数据传输模式。之后,在TCP数据传输程序S23时,在每一次数据分组传送后,TCP数据传输模式需要由用户装置回复确认数据分组。If the channel quality between the user device and the server is good, the user device and the server will continue to use UDP for the data transmission procedure. If the channel quality begins to deteriorate to a certain extent, when performing S22, the user equipment cannot receive the data packet correctly all the time due to the deterioration of the channel quality. Then, when the number of times the user device repeatedly requests to resend the data packet reaches a predetermined number, or the waiting time of the data packet reaches a predetermined time, the user device and the server will switch to the TCP data transmission mode. Afterwards, in the TCP data transmission procedure S23, after each data packet transmission, the TCP data transmission mode requires the user device to reply with an acknowledgment data packet.
在大略地介绍完本发明的示范实施例所提供的数据传输方法之后,以下先介绍本发明的示范实施例所提供的数据传输系统、详细的数据传输方法与其用户装置。After roughly introducing the data transmission method provided by the exemplary embodiment of the present invention, the data transmission system provided by the exemplary embodiment of the present invention, the detailed data transmission method and its user device are first introduced below.
请参照图3,图3是根据本发明的示范实施例所绘示一种数据传输系统300的示意图。数据传输系统300包括用户装置310、无线接取装置320、路由器330、因特网340、服务器350与交易中心服务器360。附带一提的是,图3的数据传输系统300仅是本发明的一种示范实施例,并非用以限定本发明。举例来说,若用户装置310是移动电话时,则无线接取装置320可以用接线网络(operator network)来替代。Please refer to FIG. 3 , which is a schematic diagram of a data transmission system 300 according to an exemplary embodiment of the present invention. The data transmission system 300 includes a
用户装置310传送上传数据至服务器350与自服务器350接收下载数据,用户装置310能够切换其与服务器350之间的数据传输模式,也就是能够在TCP数据传输模式与UDP数据传输模式之间作切换。无线接取装置320与用户装置建立无线连结,并藉由因特网340的因特网联机与服务器350建立联机。用户装置310传送上传数据至服务器350时,用户装置310先传送上传数据至无线接取装置320,无线接取装置320再藉由因特网联机传送上传数据至服务器350。相类似地,用户装置310由服务器350接收下载数据时,无线接取装置320先藉由因特网联机由服务器350接收下载数据,无线接取装置320再藉由因特网联机传送下载数据至用户装置310。The
路由器330在无线接取装置320与服务器350之间提供分组传送的功能。因特网340提供因特网联机给无线接取装置320、路由器330、服务器350与交易中心服务器360。服务器350传送下载数据至用户装置310以及由用户装置310接收上传数据。当用户装置310为发送端时,服务器350为接收端,且当服务器350为发送端时,用户装置310为接收端。此外,服务器350亦能够切换其与用户装置310之间的数据传输模式,也就是能够在TCP数据传输模式与UDP数据传输模式之间切换。如前面的例子所述,用户装置310会利用TCP与服务器350经由TCP的三向交握程序建立联机,并接着指定数据传输模式,若用户装置310与服务器350指定采用UDP数据传输模式,则服务器350与用户装置310会采用UDP数据传输模式UDP进行数据传输程序S21。The router 330 provides the function of packet transmission between the wireless access device 320 and the server 350 . The Internet 340 provides Internet connections to the wireless access device 320 , the router 330 , the server 350 and the transaction center server 360 . The server 350 transmits download data to the
在本示范实施例中,服务器350提供实时交易信息给用户装置310,并接收使用者藉由用户装置310上传给服务器350的交易指令。其中,用户装置310与服务器350之间进行的数据传输程序的上传数据与下载数据具有低位率(low bit rate)、少位量(small amount of bits)、高传输频率、须长时间传输且高可靠性(high reliability)的特性。此外,服务器350也处理与交易指令相关的金融信息交换。In this exemplary embodiment, the server 350 provides real-time transaction information to the
在本示范实施例中,交易中心服务器360是一个股票市场交易中心的服务器,纪录实时的股市交易信息。服务器350将使用者的交易指令上传给股票市场交易中心,并取得实时交易信息以下载给使用者。另外,在本示范实施例中,交易中心服务器360与服务器350是分开的,但是在其它示范实施例中,交易中心服务器360与服务器350可以整合成单一服务器。换言之,本发明并非限定于以上所述。In this exemplary embodiment, the transaction center server 360 is a server of a stock market transaction center, which records real-time stock market transaction information. The server 350 uploads the user's transaction order to the stock market transaction center, and obtains real-time transaction information for downloading to the user. In addition, in this exemplary embodiment, the transaction center server 360 and the server 350 are separated, but in other exemplary embodiments, the transaction center server 360 and the server 350 can be integrated into a single server. In other words, the present invention is not limited to the above description.
除此之外,在本发明的其它示范实施例中,交易中心服务器360与服务器350可以应用在其它交易市场或其它服务系统上面。举例来说,交易中心服务器360可以是如汇率市场、期货交易市场、金价交易市场或炭排放交易市场的交易中心,而服务器350则提供上述的交易市场的实时交易信息给用户装置310。在本发明的其它示范实施例中,交易中心服务器360与服务器350还可以应用在如路况报导系统、导航服务系统、天气预报系统或环境质量量测系统上面。因此,用户装置310与服务器350之间进行的数据传输程序的上传数据与下载数据也可以为金融数据、股市交易数据、外汇数据、期货交易数据、路况数据、导航数据与环境量测数据。Besides, in other exemplary embodiments of the present invention, the trading center server 360 and the server 350 can be applied to other trading markets or other service systems. For example, the trading center server 360 may be a trading center such as an exchange rate market, a futures trading market, a gold price trading market, or a carbon emissions trading market, and the server 350 provides real-time trading information of the above trading markets to the
在介绍完数据传输系统300之后,以下将以图4进一步介绍根据本发明示范实施例的用户装置310的各组件。After the introduction of the data transmission system 300, various components of the
以下请同时参照图3与图4,图4是根据本发明的示范实施例所绘示一种用户装置310的系统方块图。用户装置310包括TCP处理单元402、UDP处理单元404、TCP/UDP切换单元406、信道质量量测单元412、信道质量判断单元416、无线收发器单元414、第一定时器430、第二定时器432、第三定时器434、第四定时器436、第五定时器438、计数器439、存储器模块440与处理器450。Please refer to FIG. 3 and FIG. 4 together below. FIG. 4 is a system block diagram of a
无线收发器单元414传送上传数据至无线接取装置320以及从无线接取装置320接收下载数据。TCP处理单元402具有TCP端口码(port number),TCP处理单元402用以将数据封装为TCP数据分组,并将此TCP数据分组送至存储器模块440,接着,无线收发器单元414便能够将TCP数据分组夹带于上传数据中传送出去。另外,TCP处理单元402还能将无线信号收发器414所接收到的下载数据中对应于TCP端口码的TCP数据分组解封装。此外,TCP处理单元402所封装与解封装的数据包括三向交握程序的讯息与一般数据,因此,藉由TCP处理单元402与无线收发单元414,用户装置310与服务器350能够进行联机与使用TCP数据传输模式来传输数据。The
UDP处理单元404具有UDP端口码,UDP处理单元404用以将数据封装为UDP数据分组,并将此UDP数据分组送至存储器模块440,接着,无线收发器单元414便能够将UDP数据分组夹带于上传数据中传送出去。UDP处理单元404还能将无线信号收发器414所接收到的下载数据中对应于UDP端口码的UDP数据分组解封装。因此,藉由UDP处理单元404与无线收发单元414,用户装置310与服务器350能够进行使用UDP数据传输模式来传输数据。The
TCP/UDP切换单元406用以控制用户装置310与服务器350之间所使用的数据传输模式为TCP数据传输模式或UDP数据传输模式。信道质量参数量测单元412量测用户装置310与无线接取装置320的无线连结(亦即建立联机所采用的无线信道)以取得信道质量参数。信道质量判断单元416根据信道质量参数告知TCP/UDP切换单元406是否要切换用户装置310的数据传输模式。信道质量判断单元416判断信道质量参数是否小于等于信道质量参数阈值,若信道质量参数小于信道质量参数阈值,则信道质量判断单元416告知TCP/UDP切换单元406将用户装置310与服务器350所采用的数据传输模式自UDP数据传输模式切换至TCP数据传输模式。The TCP/
第一定时器430计算未收到服务器350回复的特定种类分组的第一等待时间。第二定时器432计算图3中接收端未收到发送端传送的特定种类分组的第二等待时间。第三定时器434计算持续未收到应用层的传送数据需求的第三等待时间。第四定时器436计算发送分组频率大于等于预设频率阈值的第四等待时间。第五定时器438计算未接到接收端回复的分组的第五等待时间。计数器439计算发送端持续发送特定种类分组给接收端的等待次数。The
请参照图4,存储器模块440储存信道质量参数、上传数据、下载数据、TCP数据分组与UDP数据分组。处理器450用以控制TCP处理单元402、UDP处理单元404、TCP/UDP切换单元406、信道质量参数量测单元412与信道质量判断单元416等组件的执行顺序。此外,处理器450还用以控制无线收发器单元414、第一定时器430、第二定时器432、第三定时器434、第四定时器436、第五定时器438与计数器439。Referring to FIG. 4 , the
此外,存储器模块440还可储存程序模块,藉由处理器450执行所述的程序模块,处理器450会与其连接的各组件完成程序中的一个或多个过程,其中,这些过程例如是TCP联机程序、数据传输程序或中断联机程序等。存储器模块440可为一个或多个存储器装置,用以储存数据以及软件程序,且亦可例如包括RAM、ROM、FLASH、磁性储存设备或光学数据储存设备中的一或多者。处理器450可提供为一个或多个经组态(configure)以执行程序模块的处理器。In addition, the
在介绍完用户装置310的各组件之后,以下将以图5至图16进一步介绍根据本发明的示范实施例的数据传输方法。After introducing each component of the
以下请同时参照图3与图5,图5是根据本发明的示范实施例所绘示数据传输方法500的流程图。首先,在流程方块S510中,用户装置310与服务器350开始上述的数据传输方法500。在流程方块S510之后,接续进行流程方块S520。在流程方块S520中,用户装置310与服务器350执行建立联机程序。通常,所述的建立联机程序是利用TCP的三向交握程序建立完成,接着,用户装置310会指定与服务器350之间的数据传输模式为TCP数据传输模式与UDP数据传输模式的其中之一。在流程方块S520之后,接续进行流程方块S530。Please refer to FIG. 3 and FIG. 5 together below. FIG. 5 is a flowchart of a
在流程方块S530中,用户装置310与服务器350使用所指定的数据传输模式来执行数据传输程序。通常,用户装置310与服务器350可以利用TCP数据传输模式或UDP数据传输模式来进行数据传输,同时也可以选择在TCP数据传输模式与UDP数据传输模式之间切换,以继续进行数据传输。在流程方块S530之后,接续进行流程方块S540。在流程方块S540中,用户装置310与服务器350执行中断联机程序。在流程方块S540之后,接续进行流程方块S550。在流程方块S550中,上述的数据传输方法500到此结束。In process block S530, the
以下将以图6对图5的流程方块S520与530中的建立联机程序与数据传输程序作进一步的说明。The procedure of establishing a connection and the procedure of data transmission in blocks S520 and 530 of FIG. 5 will be further described below with reference to FIG. 6 .
以下请同时参照图3与图6,图6是根据本发明的示范实施例所绘示结合建立联机程序S520与数据传输程序S530的细部动作的流程图。其中,图6是假设所述的建立联机程序是使用TCP来建立且指定其数据传输模式为UDP数据传输模式的例子。首先,在流程方块S602中,用户装置310与服务器350开始建立联机程序S520。在流程方块S602之后,接续进行流程方块S604。在流程方块S604中,用户装置310藉由TCP与服务器350经由三向交握程序建立联机。所述的三向交握程序是利用TCP建立完成的,且用户装置310与服务器350利用所建立的联机直接进入TCP数据传输模式。在流程方块S604之后,接续进行流程方块S606。Please refer to FIG. 3 and FIG. 6 at the same time. FIG. 6 is a flow chart illustrating the detailed operations of the connection establishment procedure S520 and the data transmission procedure S530 according to an exemplary embodiment of the present invention. Wherein, FIG. 6 is an example assuming that the connection establishment procedure is established using TCP and its data transmission mode is designated as UDP data transmission mode. Firstly, in the process block S602, the
在流程方块S606中,用户装置310切换TCP数据传输模式至UDP数据传输模式。因此,用户装置310与服务器350在数据传输程序S530中会使用UDP数据传输模式来传输数据。在流程方块S606之后,接续进行流程方块S608。在流程方块S608中,用户装置310判断目前量测到的信道质量参数是否小于等于一个预设的信道质量参数阈值。若目前信道质量参数小于等于预设的信道质量参数阈值,则在流程方块S608之后,接续进行流程方块S610。若目前信道质量参数大于预设的信道质量参数阈值,则返回进行流程方块S608。In process block S606, the
在此需要说明的是,在本示范实施例中,上述的信道质量参数是用户装置310量测其与无线接取装置320所建立的无线连结的无线通讯信号强度,且信道质量参数的单位是信道质量参数阈值的单位。举例来说,用户装置310是一个双向股票机,而用户装置310的信道质量参数范围为0~31dBm,并且将信道质量参数范围区分成五个范围,此五个范围分别为0~3dBm、3~5dBm、5~8dBm、8~13dBm及13~31dBm。在本示范实施例中,用户装置310量测与无线接取装置320所建立的无线连结的无线通讯信号强度的实施方式为每30秒检测一次讯号。例如,若检测到的无线通讯信号强度小于5dBm则表示无线通讯信号强度落在第1范围(等级)或第2范围(等级)内,此时用户装置310须切换成TCP数据模式。另一方面,若检测到的无线通讯信号强度大于5dBm则表示讯号落在第3范围(等级)、第4范围(等级)或第5范围(等级)内,则此时用户装置310可切换成UDP数据模式。在此值得说明的是,本发明并不限定于此,用户装置310的信道质量参数范围可以区分为少于或大于五个范围(等级),另外实际检测到的无线通讯信号强度在哪个范围(等级)适合切换至UDP数据模式与用户装置310的设计需求有关。在本发明的其它示范实施例中,信道质量参数还可以是其它数值,例如,位错误率(Bit Errior Rate,简称为BER)、区块错误率(Block Error Rate)或分组丢失率(Packet Loss Rate)等。总之,以上所述的信道质量参数的定义与实施方式并非用以限定本发明。It should be noted here that, in this exemplary embodiment, the above-mentioned channel quality parameter is measured by the
在流程方块S610中,用户装置310切换UDP数据传输模式至TCP数据传输模式,因此,用户装置310与服务器350在数据传输程序S530中使用TCP数据传输模式。在流程方块S610之后,接续进行流程方块S612。在流程方块S612中,上述的建立联机程序S520与数据传输程序S530到此结束。In the process block S610, the
除了上述的图6所执行的各个流程方块的步骤之外,本发明的示范实施例在建立联机程序S520还执行其它步骤。介绍这些步骤之前,本发明的示范实施例还提供6种类型的分组来完成这些步骤。以下将以表1至表6先介绍这6种类型的分组,其中,表1至表3的分组定义于TCP的对话层(session layer),表4至表6的分组则定义于UDP的对话层。In addition to the above-mentioned steps in each flow block in FIG. 6 , the exemplary embodiment of the present invention also executes other steps in the connection establishment procedure S520 . Before introducing these steps, the exemplary embodiment of the present invention also provides six types of groups to complete these steps. The following will introduce these six types of packets in Table 1 to Table 6. Among them, the packets in Table 1 to Table 3 are defined in the session layer of TCP, and the packets in Table 4 to Table 6 are defined in the dialog of UDP layer.
以下请参照表1,表1是第1种分组的字段参数与各字段可能的位数目。Please refer to Table 1 below. Table 1 is the field parameters of the first type of grouping and the possible number of bits of each field.
表1Table 1
第1种分组包括动作类型、模式类型与UDP端口码的信息。当用户装置310与服务器350执行建立联机程序时,需要使用第1种分组。第1种分组中动作类型参数值固定为0。模式类型的参数值为0时,代表TCP数据传输模式,此时用户装置310不传送UDP端口码给服务器350。模式类型的参数值为1时,代表UDP数据传输模式,此时用户装置310须传送UDP端口码给服务器350。动作类型的参数值为0代表用户装置310与服务器350执行建立联机程序。The first type of packet includes the information of action type, mode type and UDP port code. When the
以下请参照表2,表2是第2种分组的字段参数与各字段可能的位数目。Please refer to Table 2 below. Table 2 is the field parameters of the second grouping and the possible number of bits of each field.
表2Table 2
第2种分组包括动作类型、分组序号长度指针与分组序号的信息。第2种分组中,动作类型的参数值为1代表由UDP数据传输模式切换至TCP数据传输模式,此时需指定由对方UDP收到的最后序号。动作类型的参数值为2代表用户装置310利用UDP发送由TCP数据传输模式切换至UDP数据传输模式的请求至服务器350;此时,服务器350须回复此第2类分组的序号,以藉此让下一个数据传输模式中所要传送的分组,能够与前一个数据传输模式最后所传送的分组序号能够同步,而不会有缺号或跳号的情况发生。分组序号长度指针为0代表分组序号长度为15个位。分组序号长度指针为1代表分组序号长度为31个位。The second type of packet includes the action type, the length pointer of the packet sequence number and the information of the packet sequence number. In the second group, the parameter value of the action type is 1, which means switching from UDP data transmission mode to TCP data transmission mode. At this time, the last sequence number received by the other party’s UDP needs to be specified. The parameter value of the action type is 2, which means that the
以下请参照表3,表3是第3种分组的字段参数与各字段可能的位数目。Please refer to Table 3 below. Table 3 is the field parameters of the third grouping and the possible number of bits of each field.
表3table 3
第3种分组包括动作类型与应用数据的信息。第3种分组中,动作类型的参数值为3代表TCP数据传输模式,此类型分组除了在TCP标头(Header)加上2个位的动作类型字段之外,其余的部份皆与一般TCP数据传输模式中的TCP数据分组格式相同。The third type of packet includes information about the action type and application data. In the third type of packet, the parameter value of the action type is 3, which represents the TCP data transmission mode. Except for adding a 2-bit action type field to the TCP header (Header), the rest of the packet is the same as the general TCP The TCP data packet format in the data transfer mode is the same.
以下请参照表4,表4是第4种分组的字段参数与各字段可能的位数目。Please refer to Table 4 below. Table 4 is the field parameters of the fourth grouping and the possible number of bits of each field.
表4Table 4
第4种分组包括动作类型与选项指针的信息。第4种分组中,动作类型的参数值为0代表UDP数据传输模式。选项指针的参数值为0代表服务器350回复给用户装置310所提出的切换至UDP数据传输模式的请求。选项指针的参数值为1代表发送端要求接收端回复最后一次接收到的分组序号。选项指针的参数值为2代表用户装置310向服务器350所提出的由TCP数据传输模式切换至UDP数据传输模式的请求。The fourth type of packet includes the information of action type and option pointer. In the fourth grouping, the parameter value of the action type is 0 to represent the UDP data transmission mode. The parameter value of the option pointer is 0, which means that the server 350 replies to the request made by the
以下请参照表5,表5是第5种分组的字段参数与各字段可能的位数目。Please refer to Table 5 below. Table 5 is the field parameters of the fifth grouping and the possible number of bits of each field.
表5table 5
第5种分组包括动作类型、分组序号指针、确认指针、分组序号长度指针、确认序号与应用数据的信息。第5种分组中,动作类型参数为0代表一般数据发送,动作类型参数为1代表除一般数据发送外并同时要求接收端回复目前收到的最后序号。分组序号指针的参数值为0代表不须发送分组序号长度指针、分组序号与应用数据的字段参数。分组序号指针的参数值为1代表须发送分组序号长度指针与分组序号的字段参数,且分组序号指定为应用数据的序号。确认指针的参数值为0代表不须发送确认长度指针与确认序号的字段参数。确认指针的参数值为1代表须发送确认长度指针与确认序号的字段参数,且确认序号指定为应用数据的序号。分组序号长度指针的参数值为0代表分组序号长度为15个位。分组序号长度指针的参数值为1代表分组序号长度为31个位。确认长度指针的参数值为0代表确认序号长度为15个位。确认长度指针的参数值为1代表确认序号长度为31个位。动作类型的参数值为1代表一般的UDP数据传输模式。动作类型的参数值为2代表UDP数据传输模式且要求接收端回复确认分组。The fifth type of packet includes action type, packet sequence number pointer, confirmation pointer, packet sequence number length pointer, confirmation sequence number and application data information. In the fifth type of grouping, the action type parameter is 0 to represent general data transmission, and the action type parameter is 1 to represent that in addition to general data transmission, the receiving end is required to reply the last sequence number currently received. The parameter value of the packet sequence number pointer is 0, indicating that the field parameters of the packet sequence number length pointer, packet sequence number and application data do not need to be sent. The parameter value of the packet sequence number pointer is 1, indicating that the field parameters of the packet sequence number length pointer and the packet sequence number must be sent, and the packet sequence number is designated as the sequence number of the application data. The parameter value of the confirmation pointer is 0, which means that the field parameters of the confirmation length pointer and the confirmation sequence number do not need to be sent. The parameter value of the confirmation pointer is 1, which means that the field parameters of the confirmation length pointer and the confirmation sequence number must be sent, and the confirmation sequence number is designated as the sequence number of the application data. The parameter value of the packet serial number length pointer is 0, which means that the packet serial number length is 15 bits. The parameter value of the packet serial number length pointer is 1, which means that the packet serial number length is 31 bits. The parameter value of the confirmation length pointer is 0, which means that the length of the confirmation sequence number is 15 bits. The parameter value of the confirmation length pointer is 1, which means that the length of the confirmation sequence number is 31 bits. The parameter value of the action type is 1, which represents the general UDP data transmission mode. The parameter value of the action type is 2, which represents the UDP data transmission mode and requires the receiving end to reply with an acknowledgment packet.
以下请参照表6,表6是第6种分组的字段参数与各字段可能的位数目。Please refer to Table 6 below. Table 6 shows the field parameters of the sixth type of grouping and the possible number of bits in each field.
表6Table 6
第6种分组包括动作类型讯、分组序号长度指针与应用数据的信息。第6种分组中,动作类型的参数值为3代表接收端向发送端回补分组序号。第6种分组的分组序号是接收端向发送端回补分组序号至目前发送端已经发送的最新分组序号。分组序号长度指针的参数值为0代表分组序号长度为15个位。分组序号长度指针的参数值为1代表分组序号长度为31个位。The sixth type of packet includes action type information, packet sequence number length pointer and application data information. In the sixth type of grouping, the parameter value of the action type is 3, indicating that the receiving end sends back the packet sequence number to the sending end. The packet sequence number of the sixth type of packet is the latest packet sequence number that the receiving end has sent back to the sending end to the packet sequence number that has been sent by the sending end. The parameter value of the packet serial number length pointer is 0, which means that the packet serial number length is 15 bits. The parameter value of the packet serial number length pointer is 1, which means that the packet serial number length is 31 bits.
介绍完以上6种分组后,以下将以图7至图9来进一步说明建立联机程序的细部动作。After introducing the above six types of grouping, the following will further illustrate the detailed actions of establishing an online program with reference to FIG. 7 to FIG. 9 .
以下请同时参照图3与图7,图7是根据本发明的示范实施例所绘示建立联机程序S520与切换至UDP数据传输模式的细部动作的流程图。在流程方块S702中,用户装置310与服务器350开始建立联机程序S520的其余细部动作。在流程方块S702之后,接续进行流程方块S704。在流程方块S704中,用户装置310开启其UDP端口码所对应的UDP端口,服务器350开启其TCP端口码所对应的TCP端口与其UDP端口码所对应的UDP端口。在流程方块S704之后,接续进行流程方块S706。在流程方块S706中,用户装置310利用TCP与服务器350建立联机,并指定数据传输模式,其中,用户装置310是经由TCP联机传送表1的第1种分组,以指定数据传输模式。在流程方块S706之后,接续进行流程方块S708。Please refer to FIG. 3 and FIG. 7 at the same time. FIG. 7 is a flow chart illustrating the detailed operations of the connection establishment procedure S520 and switching to the UDP data transmission mode according to an exemplary embodiment of the present invention. In the process block S702, the
在流程方块S708中,服务器350确定用户装置310指定的数据传输模式是否为UDP数据传输模式,其中,当第1种分组的模式类型为1时,表示指定的数据传输模式为UDP数据传输模式,当第1种分组的模式类型为0时,表示指定的数据传输模式为TCP数据传输模式。若用户装置310指定UDP数据传输模式,则在流程方块S708之后,接续进行流程方块S710。若用户装置310指定TCP数据传输模式,则进行流程方块S712。在流程方块S710中,用户装置310与服务器350进行指定UDP数据传输模式的联机处理程序。在流程方块S712中,用户装置310与服务器350进行指定TCP数据传输模式的联机处理程序。在流程方块S710或S712之后,接续进行流程方块S714。在流程方块S714中,上述的建立联机程序S520到此结束。In process block S708, the server 350 determines whether the data transmission mode specified by the
以下请同时参照图3、图7与图8,图8是根据本发明的示范实施例所绘示的指定TCP数据传输模式的联机处理程序S712的细部动作的流程图。在流程方块S802中,用户装置310与服务器350开始建立联机程序S520的其余细部动作。在流程方块S802之后,接续进行流程方块S804。在流程方块S804中,用户装置310与服务器350重新设定对话层的序号。之后,在其数据传输程序530时,服务器350就能够开始使用表3的第3种分组来传送数据。在流程方块S804之后,接续进行流程方块S806。在流程方块S806中,上述的建立联机程序S520到此结束,并进入数据传输程序S530。Please refer to FIG. 3 , FIG. 7 and FIG. 8 at the same time. FIG. 8 is a flow chart showing detailed operations of the connection processing program S712 for specifying the TCP data transmission mode according to an exemplary embodiment of the present invention. In the process block S802, the
以下请同时参照图3与图9,图9是根据本发明的示范实施例所绘示指定UDP数据传输模式的联机处理程序S710的细部动作的流程图。在流程方块S902中,用户装置310与服务器350开始建立联机程序S520的其余细部动作,且是图7的流程方块S710的更细部动作。在流程方块S902之后,接续进行流程方块S904。在流程方块S904中,服务器350利用UDP发送表4的第4种分组给用户装置310所指定的UDP端口码来回复用户装置310的指定UDP数据传输模式的请求,其中,第4种分组的选项指针为0。在流程方块S904之后,接续进行流程方块S906。在流程方块S906中,服务器350重新设定对话层的分组序号为0,并可以于数据传输程序530中使用UDP来传送数据。在流程方块S906之后,接续进行流程方块S908。Please refer to FIG. 3 and FIG. 9 at the same time. FIG. 9 is a flow chart showing detailed operations of the connection processing program S710 specifying the UDP data transmission mode according to an exemplary embodiment of the present invention. In the process block S902, the
在流程方块S908中,用户装置310检查是否收到服务器350发出的第4种分组,且检查第4种分组的选项指针是否为0。若否,则在流程方块S908之后,接续进行流程方块S910。若是,则在流程方块S908之后,接续进行流程方块S912。在流程方块S910中,用户装置310检查等待选项指针为0的第4种分组的等待时间是否超过第一等待时间。其中,用户装置310利用第一定时器430是否到期来确认超过第一等待时间。若是,则在流程方块S910之后,接续进行流程方块S914。若否,则在流程方块S910之后,接续进行流程方块S908。在流程方块S912中,用户装置310重新设定对话层的分组序号为0,并可以开始使用UDP来传送数据。在流程方块S912之后,接续进行流程方块S922。In process block S908, the
在流程方块S914中,用户装置310判断等待选项指针为0的第4种分组重发次数是否超过一定次数。若为否,则接续进行流程方块S916。若为是,则表示重发次数超过一定次数并接续进行流程方块S918,其表示服务器350与用户装置310之间无法使用UDP数据传输模式。在流程方块S916中,用户装置310使用TCP重新发出模式类型为1的第1种分组给服务器350,以指定UDP数据传输模式。在流程方块S916之后,接续进行流程方块S904。In process block S914, the
在流程方块S918中,用户装置310利用TCP发出动作类型为1的第2种分组至服务器350,其中第2种分组包括最后自服务器350接收的分组的分组序号(在此,分组序号应该为0),以藉此将目前所指定的数据传输模式切换为TCP数据传输模式。在流程方块S918之后,接续进行流程方块S920。在流程方块S920中,服务器收到切换为TCP数据传输模式的请求后,之后在数据传输程序S530中,服务器350就能够开始使用表3的第3种分组来传输数据,并且服务器350会补发之前已经藉由UDP发出的分组给用户装置310。在流程方块S920之后,接续进行流程方块S922。在流程方块S922中,上述的建立联机程序S520到此结束,并进入数据传输程序S530。In process block S918, the
在介绍完联机程序S520的细部动作后,以下将以图10至图15说明数据传输程序S530的细部动作。After introducing the detailed operations of the connection program S520, the detailed operations of the data transmission program S530 will be described below with reference to FIGS. 10 to 15 .
以下请同时参照图3与图10,图10是根据本发明的示范实施例所绘示数据传输程序的流程图。其中,图10是假设所指定的数据传输模式为UDP数据传输模式的例子。在流程方块S1002中,用户装置310与服务器350执行数据传输程序S530的细部动作。在此示范实施例中,可以假设用户装置310为接收端,而服务器350为发送端。然而,任何此领域具有通常知识者可以知道事实上接收端亦可以是服务器350,且发送端可以是用户装置310。在流程方块S1002之后,接续进行流程方块S1004。Please refer to FIG. 3 and FIG. 10 at the same time. FIG. 10 is a flowchart of a data transmission procedure according to an exemplary embodiment of the present invention. Wherein, FIG. 10 is an example assuming that the specified data transmission mode is the UDP data transmission mode. In the process block S1002, the
在流程方块S1004中,发送端发送第5种分组给接收端,其中,第5种分组包括对话层序号。在流程方块S1004之后,接续进行流程方块S1006。在流程方块S1006中,接收端执行检查接收分组处理程序,其中此检查接收分组处理程序包括相对应的处理程序。在流程方块S1006之后,接续进行流程方块S1008。在流程方块S1008中,发送端执行要求接收端回传序号的处理程序。在流程方块S1008之后,接续进行流程方块S1010。在流程方块S1010中,发送端执行检查发送分组频率处理程序,其中此检查发送分组频率处理程序包括相对应的处理程序。在流程方块S1010之后,接续进行流程方块S1012。In process block S1004, the sending end sends a fifth type packet to the receiving end, wherein the fifth type packet includes a session layer sequence number. After the process block S1004, proceed to the process block S1006. In flow block S1006, the receiving end executes a processing program for checking received packets, wherein the processing program for checking received packets includes corresponding processing programs. After the process block S1006, proceed to the process block S1008. In the process block S1008, the sending end executes a processing procedure that requires the receiving end to return the serial number. After the process block S1008, proceed to the process block S1010. In the process block S1010, the sending end executes a processing program for checking the frequency of the transmitted packets, wherein the processing program for checking the frequency of the transmitted packets includes a corresponding processing program. After the process block S1010, proceed to the process block S1012.
在流程方块S1012中,检查是否用户装置310或服务器350发出中断联机的请求。若是,则在流程方块S1012之后,接续进行流程方块S1014。若否,则在S1012之后,接续进行流程方块S1004。在流程方块S1014中,上述的数据传输程序S530到此结束,并进入中断联机程序S540。In the process block S1012, it is checked whether the
在介绍完图10中数据传输程序S530的细部动作后,以下将以图11至图13来介绍图10中流程方块S1006、流程方块S1008与流程方块S1010的细部动作。After introducing the detailed actions of the data transmission program S530 in FIG. 10 , the detailed actions of process block S1006 , process block S1008 and process block S1010 in FIG. 10 will be described below with reference to FIGS. 11 to 13 .
以下请同时参照图3与图11,图11是根据本发明的示范实施例所绘示接收端检查接收分组处理程序S1006的细部动作的流程图。在流程方块S1102中,用户装置310与服务器350开始执行接收端检查接收分组处理程序S1006的细部动作。在流程方块S1102之后,接续进行流程方块S1104。在流程方块S1104中,接收端检查是否发现第5种分组有跳号状况。若是,则在流程方块S1104之后,接续进行流程方块S1106。若否,则在流程方块S1104之后,进行流程方块S1112。在流程方块S1106中,接收端暂不将数据传输至应用层,并且向发送端请求补送缺号的第5种分组,其中,接收端是使用表6的第6种分组来告知发送端回补缺号的第5种分组。在流程方块S1106之后,接续进行流程方块S1108。Please refer to FIG. 3 and FIG. 11 at the same time. FIG. 11 is a flow chart showing detailed operations of the receiving end checking received packet processing program S1006 according to an exemplary embodiment of the present invention. In the process block S1102, the
在流程方块S1108中,接收端检查超过第二等待时间后是否仍未收到发送端补送的第5种分组。在用户装置310上面,用户装置310利用第二定时器432到期来确认已经超过第二等待时间。若是,则在流程方块S1108之后,接续进行流程方块S1110。若否,则进行流程方块S1112。In process block S1108, the receiving end checks whether the fifth type of packet sent by the sending end has not been received after the second waiting time has elapsed. On the
在流程方块S1110中,接收端向发送端发出使用第5种分组重传接收端缺号的分组的请求(亦即发送第6种分组给发送端),接着发送端使用第5种分组重传接收端缺号的分组。在流程方块S1110之后,接续进行流程方块S1114。在流程方块S1114中,接收端检查超过第二等待时间后是否仍未收到发送端补送的第5种分组。若是,则在流程方块S1114之后,接续进行流程方块S1116。若否,则进行流程方块S1112。在流程方块S1112中,因接收端已经收到发送端补送之前缺号的第5种分组,故接收端将数据传输至应用层。在流程方块S1112之后,接续进行流程方块S1118。In the process block S1110, the receiving end sends a request to the sending end to use the fifth type of packet to retransmit the packet that the receiving end lacks (that is, to send the sixth type of packet to the sending end), and then the sending end uses the fifth type of packet to retransmit A packet with a missing number at the receiving end. After the process block S1110, proceed to the process block S1114. In process block S1114, the receiving end checks whether the fifth type of packet sent by the sending end has not been received after the second waiting time has elapsed. If yes, after the process block S1114, proceed to the process block S1116. If not, proceed to process block S1112. In the process block S1112, since the receiving end has received the fifth packet whose number was missing before the sending end sent it, the receiving end transmits the data to the application layer. After the process block S1112, proceed to the process block S1118.
在流程方块S1116中,接收端利用TCP的联机再次发送第2种分组给发送端,并请求发送端切换至TCP数据传输模式,其中,此第2种分组包括在UDP数据传输模式中在未跳号前,接收端所收到的最后分组序号。在流程方块S1116之后,接续进行流程方块S1118。在流程方块S1118中,接收端检查接收分组处理程序S1006的细部动作到此结束。In the process block S1116, the receiving end uses the TCP connection to send the second type of packet to the sending end again, and requests the sending end to switch to the TCP data transmission mode, wherein the second type of packet is included in the UDP data transmission mode. Before the number, the sequence number of the last packet received by the receiver. After the process block S1116, proceed to the process block S1118. In the flow block S1118, the receiving end checks the detailed actions of the received packet processing program S1006 and ends here.
在此要说明的是,当建立联机的无线信道的质量较差时,会导致接收端会一直无法收到发送端所补送的第5种分组,也就是等待第5种分组的时间可能会超过两倍以上的第二等待时间。因此,在流程方块S1116中,接收端才会发出将UDP数据传输模式改成TCP数据传输模式的请求。另外,值得一提的是,在图11的流程方块S1110中,虽然接收端仅有在没有收到发送端所补送的第5种分组时,使用第6种分组向发送端要求补传其缺号的第5种分组,但是本发明并不限定于上述的要求重传的次数。在本发明的其它示范实施例中,接收端在没有收到发送端所补送的第5种分组时,可以重复超过两次使用第6种分组向发送端要求回补其缺号的第5种分组。What I want to explain here is that when the quality of the wireless channel to establish the connection is poor, the receiving end will always be unable to receive the fifth type of packet sent by the sending end, that is, the waiting time for the fifth type of packet may be shortened. More than double the second wait time. Therefore, in the process block S1116, the receiving end sends out a request for changing the UDP data transmission mode to the TCP data transmission mode. In addition, it is worth mentioning that in the process block S1110 in Figure 11, although the receiving end only uses the sixth type of packet to request the sending end to send another packet when it does not receive the fifth type of packet sent by the sending end. The fifth type of packet with missing numbers, but the present invention is not limited to the above-mentioned number of retransmission requests. In other exemplary embodiments of the present invention, when the receiving end does not receive the fifth packet sent by the sending end, it can repeat the use of the sixth packet for more than two times to request the sending end to fill in the fifth packet of its missing number. kind of grouping.
在介绍完图11中接收端检查接收分组处理程序S1006的细部动作后,以下将以图12说明发送端要求接收端回传分组序号处理程序S1008的细部动作。After introducing the detailed actions of the receiving end checking received packet processing program S1006 in FIG. 11 , the following will illustrate the detailed actions of the sending end requesting the receiving end to return the packet sequence number processing program S1008 with FIG. 12 .
以下请同时参照图3与图12,图12是根据本发明的示范实施例所绘示发送端要求接收端回传分组序号处理程序S1008的细部动作的流程图。在流程方块S1202中,开始执行发送端要求接收端回传分组序号处理程序S1008的细部动作。在流程方块S1202之后,接续进行流程方块S1204。在流程方块S1204中,发送端检查等待应用层的传输数据的需求的时间是否超过第三等待时间。在用户装置310上面,用户装置310利用第三定时器434到期来确认已经超过第三等待时间。若是,则在流程方块S1204之后,进行流程方块S1206。若否,则在流程方块S1204之后,接续进行流程方块S1218。Please refer to FIG. 3 and FIG. 12 together below. FIG. 12 is a flow chart showing the detailed actions of the sending end requesting the receiving end to return the packet sequence number processing program S1008 according to an exemplary embodiment of the present invention. In the process block S1202, start to execute the detailed actions of the sending end requesting the receiving end to return the packet sequence number processing program S1008. After the process block S1202, proceed to the process block S1204. In process block S1204, the sending end checks whether the waiting time for the request of the application layer to transmit data exceeds a third waiting time. On
在流程方块S1206中,发送端发送选项指针为1的第4种分组给接收端,并要求接收端回传最后收到的分组序号。在流程方块S1206之后,进行流程方块S1208。在流程方块S1208中,接收端利用确认指针为1的第5种分组回复最后收到的分组序号。在流程方块S1208之后,进行流程方块S1210。In the process block S1206, the sending end sends the fourth type of packet whose option pointer is 1 to the receiving end, and requests the receiving end to send back the sequence number of the last received packet. After the process block S1206, proceed to the process block S1208. In the process block S1208, the receiving end replies with the last received packet sequence number with the fifth packet whose acknowledgment pointer is 1. After the process block S1208, proceed to the process block S1210.
在流程方块S1210中,判断发送端是否于第二等待时间内收到接收端回复的第5种分组。若是,则在流程方块S1210之后,进行流程方块S1214。若否,则在流程方块S1210之后,接续进行流程方块S1212。在流程方块S1212中,判断发送端发送第4种分组的次数是否超过一定次数。若否,则则在流程方块S1210之后,接续进行流程方块S1206以重传第4种分组。若是,则接续进行流程方块S1216。In the process block S1210, it is determined whether the sending end receives the fifth type packet replied by the receiving end within the second waiting time. If yes, after the process block S1210, proceed to the process block S1214. If not, after the process block S1210, proceed to the process block S1212. In process block S1212, it is judged whether the number of times the sender sends the fourth type of packet exceeds a certain number of times. If not, after the process block S1210, proceed to the process block S1206 to retransmit the fourth type of packet. If yes, proceed to process block S1216.
在流程方块S1214中,发送端检查接收到的分组序号是否与最后发出的分组序号相同。若是,则在流程方块S1214之后,进行流程方块S1220。若否,则在流程方块S1214之后,接续进行流程方块S1218。若发送端在特定时间内未到接收端所回复的分组,则表示整个信道质量不好,必须将UDP数据传输模式切换至TCP数据传输模式。因此,在流程方块S1216中,发送端改利用TCP的联机发送第2种分组给接收端,并请求接收端切换至TCP数据传输模式,其中,此第2种分组包括在UDP数据传输模式中由对方收到的最后分组序号。在流程方块S1216之后,接续进行流程方块S1220。在流程方块S1218中,发送端用第5种分组重传接收端缺号的分组。在流程方块S1218之后,接续进行流程方块S1220。在流程方块S1220中,上述的发送端要求接收端回传分组序号处理程序S1008的细部动作到此结束。In process block S1214, the sender checks whether the sequence number of the received packet is the same as the sequence number of the last sent packet. If yes, after the process block S1214, proceed to the process block S1220. If not, after the process block S1214, proceed to the process block S1218. If the sending end does not receive the packet replied by the receiving end within a certain period of time, it means that the quality of the entire channel is not good, and the UDP data transmission mode must be switched to the TCP data transmission mode. Therefore, in the process block S1216, the sending end uses the TCP connection to send the second type of packet to the receiving end, and requests the receiving end to switch to the TCP data transmission mode, wherein the second type of packet is included in the UDP data transmission mode. The sequence number of the last packet received by the peer. After the process block S1216, proceed to the process block S1220. In the process block S1218, the sending end retransmits the packets with missing numbers at the receiving end using the fifth type of packet. After the process block S1218, proceed to the process block S1220. In the process block S1220, the detailed actions of the sending end requesting the receiving end to return the packet sequence number processing program S1008 end here.
在介绍完图12中发送端要求接收端回传分组序号处理程序S1008的细部动作后,以下将以图13说明发送端要求接收端回传分组序号处理程序S1010的细部动作。After introducing the detailed actions of the processing program S1008 in which the sender requests the receiving end to return the packet sequence number in FIG.
以下请同时参照图3与图13,图13是根据本发明的示范实施例所绘示发送端检查发送频率处理程序S1010的细部动作的流程图。在流程方块S1302中,开始执行发送端检查发送频率处理程序S1010的细部动作。在流程方块S1302之后,接续进行流程方块S1304。在流程方块S1302中,检查于第三等待时间内是否发送分组。若是,则在流程方块S1304之后,接续进行流程方块S1306。若否,则在流程方块S1304之后,则进行流程方块S1308,改接续S1008处理流程。在进行流程方块S1308(即处理流程S1008)之后,接续进行流程方块S1324。Please refer to FIG. 3 and FIG. 13 at the same time. FIG. 13 is a flow chart showing detailed operations of the sending end checking transmission frequency processing program S1010 according to an exemplary embodiment of the present invention. In the flow block S1302, start to execute the detailed operations of the sending end checking sending frequency processing program S1010. After the process block S1302, proceed to the process block S1304. In process block S1302, check whether to send a packet within the third waiting time. If yes, after the process block S1304, proceed to the process block S1306. If not, after the process block S1304, proceed to the process block S1308, and continue the processing flow of S1008. After performing the process block S1308 (that is, the process flow S1008), continue to process the process block S1324.
在流程方块S1306中,发送端检查目前发送分组次数是否超过预设次数阈值,若是,则在流程方块S1306之后,接续进行流程方块S1312。若否,则在流程方块S1306之后,接续进行流程方块S1310。在流程方块S1310中,发送端重设第三等待时间。在用户装置310上面,用户装置310重新设定第三定时器434来重设第三等待时间。在流程方块S1310之后,接续进行流程方块S1304。In the process block S1306, the sender checks whether the current number of sending packets exceeds the preset threshold value, and if so, proceed to the process block S1312 after the process block S1306. If not, after the process block S1306, proceed to the process block S1310. In process block S1310, the sender resets the third waiting time. On the
在流程方块S1312中,发送端在发送分组达到特定次数时,于特定次数的最后一次发送第5种分组,并且要求接收端回复收到分组的序号,也就是最后一次发送端所发送的第5种分组的动作类型会被设为2。在用户装置310上面,用户装置310利用计数器439来计算发送分组的次数。而接收端会发送确认指针设为1的第5种分组来回复最后所收到分组的序号。在流程方块S1312之后,接续进行流程方块S1314。在流程方块S1314中,发送端检查是否于第二等待时间内收到接收端回复第5种分组。若是,在流程方块S1314之后,则接续进行流程方块S1316。若否,在流程方块S1314之后,则接续进行流程方块S1320。In the process block S1312, when the sending end reaches a specific number of times, the sending end sends the fifth type of packet for the last time of the specific number of times, and requests the receiving end to reply with the serial number of the received packet, which is the last sent end. The action type for each group will be set to 2. On the
在流程方块S1316中,发送端检查接收到的分组序号是否与最后发出的分组序号相同。若是,则在流程方块S1316之后,接续进行流程方块S1324。若否,则在流程方块S1316之后,接续进行流程方块S1318。在流程方块S1318中,发送端用第5种分组重传接收端缺号的分组。在流程方块S1318之后,接续进行流程方块S1324。在流程方块S1320中,判断发送端发送第5种分组且动作类型为2的次数是否超过一定次数。在用户装置310上面,用户装置310是利用计数器439来计算发送第5种分组且动作类型为2的次数。若否,则在流程方块S1320之后,接续进行流程方块S1314重传动作类型为2的第5种分组。若是,则在流程方块S1320之后,接续进行流程方块S1314。In process block S1316, the sender checks whether the sequence number of the received packet is the same as the sequence number of the last sent packet. If yes, after the process block S1316, proceed to the process block S1324. If not, after the process block S1316, proceed to the process block S1318. In the process block S1318, the sending end retransmits the packets with missing numbers at the receiving end using the fifth type of packet. After the process block S1318, proceed to the process block S1324. In process block S1320, it is judged whether the number of times that the sender sends the fifth type of packet and the action type is 2 exceeds a certain number of times. On the
在流程方块S1322中,发送端利用TCP的联机传送第2种分组给接收端,并请求接收端切换至TCP数据传输模式,其中,此第2种分组包括发送端于UDP数据传输模式下由接收端收到的最后分组序号。在流程方块S1324中,上述的发送端检查发送频率处理程序S1010的细部动作到此结束。In the process block S1322, the sending end uses the TCP connection to transmit the second type of packet to the receiving end, and requests the receiving end to switch to the TCP data transmission mode. The sequence number of the last packet received by the end. In the flow block S1324, the above-mentioned detailed actions of the sending end checking the sending frequency processing program S1010 are ended here.
若是数据传输程序S530中使用TCP数据传输模式,则发送端与接收端都使用第3种分组并藉由一般TCP数据传输的原理来传送与接收数据。If the TCP data transmission mode is used in the data transmission program S530, both the sending end and the receiving end use the third type of packet to transmit and receive data based on the general TCP data transmission principle.
在介绍完图10中流程方块S1006、流程方块S1008与流程方块S1010的细部动作后,以下将以图14说明数据传输程序中TCP数据传输模式切换至UDP数据传输模式的流程。图14中所述的TCP数据传输模式切换至UDP数据传输模式,主要是藉由检测信道质量参数来判断是否切换数据传输模式,且图14的切换流程是在服务器350与用户装置310使用TCP数据传输模式在进行数据传输时被执行。After introducing the detailed actions of process block S1006, process block S1008 and process block S1010 in FIG. 10, the process of switching from TCP data transmission mode to UDP data transmission mode in the data transmission program will be described below with FIG. 14. The switching of the TCP data transmission mode described in FIG. 14 to the UDP data transmission mode is mainly to judge whether to switch the data transmission mode by detecting channel quality parameters, and the switching process in FIG. 14 is to use TCP data between the server 350 and the
以下请同时参照图3与图14,图14是根据本发明的示范实施例所绘示数据传输程序中TCP数据传输模式切换至UDP数据传输模式的流程图。在流程方块S1402中,用户装置310开始执行TCP数据传输模式切换至UDP数据传输模式的细部动作。在流程方块S1402之后,接续进行流程方块S1404。在流程方块S1404中,用户装置310量测信道质量。在流程方块S1404之后,接续进行流程方块S1406。在流程方块S1406中,用户装置310检查信道质量参数是否大于等于预设信道质量参数阈值。若是,则在流程方块S1406之后,接续进行流程方块S1408。若否,则在流程方块S1406之后,返回进行流程方块S1404。Please refer to FIG. 3 and FIG. 14 together below. FIG. 14 is a flow chart of switching from the TCP data transmission mode to the UDP data transmission mode in the data transmission procedure according to an exemplary embodiment of the present invention. In the process block S1402, the
在流程方块S1408中,用户装置310发送选项指针为2的第4种分组给服务器350,并请求切换到指定UDP数据传输模式。在流程方块S1408之后,接续进行流程方块S1410。在流程方块S1410中,服务器350接收到用户装置310的切换到UDP数据传输模式的请求后,服务器350利用TCP回传动作类型为2的第2种分组至用户装置310,其中第2种分组包括最后藉由TCP发送的分组序号,藉以同步服务器350之后由UDP传送的分组序号。在流程方块S1410之后,接续进行流程方块S1412。In the process block S1408, the
在流程方块S1412中,用户装置310接收到服务器350的回复后,用户装置利用TCP使用动作类型为2的第2种分组回复服务器350,以回应最后藉由TCP发送的分组序号。在流程方块S1412之后,接续进行流程方块S1414。在流程方块S1412中,上述的TCP数据传输模式切换至UDP数据传输模式的流程到此结束。In the process block S1412, after the
以下请同时参照图3与图15,图15是根据本发明的示范实施例所绘示数据传输程序中,当发送端或接收端任一方要求将UDP数据传输模式切换至TCP数据传输模式的流程图。当使用UDP数据传输模式来进行数据传输时,图15所示的切换流程才会被执行。值得一提的是,上述已经介绍了各种可能会从UDP数据传输模式切换至TCP数据传输模式的情况,但是上述的情况并非用以限定本发明。事实上,以上所述用户装置310会从UDP数据传输模式切换至TCP数据传输模式的情况可能是因为目前所建立联机的无线信道的质量不佳。因此,在其它的示范实施例中,亦可以藉由用户装置310来检测信道质量参数,并根据信道质量参数来决定是否切换数据传输模式。例如,信道质量参数小于等于一预设的信道质量参数阈值,就将UDP数据传输模式切换为TCP数据传输模式。Please refer to FIG. 3 and FIG. 15 at the same time below. FIG. 15 is a process flow when either the sending end or the receiving end requests to switch the UDP data transmission mode to the TCP data transmission mode in the data transmission program according to the exemplary embodiment of the present invention. picture. When the UDP data transmission mode is used for data transmission, the switching process shown in FIG. 15 will be executed. It is worth mentioning that the above has introduced various situations that may switch from the UDP data transmission mode to the TCP data transmission mode, but the above situations are not intended to limit the present invention. In fact, the above-mentioned situation where the
在流程方块S1502中,用户装置310(或服务器350)开始执行UDP数据传输模式切换至TCP数据传输模式的细部动作。在流程方块S1502之后,接续进行流程方块S1504。在流程方块S1504中,发送端(或接收端)藉由TCP发送动作类型为1的第2种分组给接收端(或发送端),其中第2种分组包括之前由发送端(或接收端)藉由UDP所收到的最后分组的序号,以请求切换至TCP数据传输模式,并停止接收任何UDP数据分组。在流程方块S1504之后,接续S1506。In the process block S1502, the user device 310 (or the server 350) starts to execute detailed operations of switching from the UDP data transmission mode to the TCP data transmission mode. After the process block S1502, proceed to the process block S1504. In the process block S1504, the sending end (or receiving end) sends the second type of packet whose action type is 1 to the receiving end (or sending end) through TCP, wherein the second type of packet includes the Use the sequence number of the last packet received by UDP to request switching to TCP data transfer mode and stop receiving any UDP data packets. After the process block S1504, continue to S1506.
在流程方块S1506中,接收端与发送端都停止接收UDP数据分组,并且接收端与发送端都藉由TCP接收到第2种分组后,自对方回复最后藉由UDP所接收的UDP数据分组的序号的下一个分组开始,利用TCP传送与接收分组,亦即,使用TCP数据传输模式。在流程方块S1506之后,接续进行流程方决S1508。在流程方块S1508中,接收端与发送端都藉由TCP接收到第2种分组,上述的UDP数据传输模式切换至TCP数据传输模式的流程到此结束。In process block S1506, both the receiving end and the sending end stop receiving UDP data packets, and after receiving the second type of packet through TCP, the receiving end and the sending end reply to the last UDP data packet received through UDP from the other party. Starting with the next packet of the sequence number, the packets are transmitted and received using TCP, ie, using the TCP data transfer mode. After the process block S1506, proceed to the process block S1508. In process block S1508, both the receiving end and the sending end receive the second type of packet through TCP, and the above-mentioned process of switching from the UDP data transmission mode to the TCP data transmission mode ends here.
在介绍完数据传输程序S530的细部动作后,以下将以图16说明中断联机程序S540的细部动作。After introducing the detailed operation of the data transmission program S530, the detailed operation of the disconnection program S540 will be described below with reference to FIG. 16 .
以下请同时参照图3、图5与图16,图16是根据本发明的示范实施例所绘示中断联机程序S540的细部动作的流程图。在流程方块S1602中,用户装置310或服务器350开始中断联机程序S540。在流程方块S1602之后,接续进行流程方块S1604。流程方块S1604中,用户装置310或服务器350藉由TCP发动中断联机程序。在流程方块S1604之后,接续进行流程方块S1606。Please refer to FIG. 3 , FIG. 5 , and FIG. 16 at the same time. FIG. 16 is a flow chart illustrating detailed operations of the disconnection program S540 according to an exemplary embodiment of the present invention. In the process block S1602, the
在流程方块S1606中,用户装置310或服务器350检查目前是否在UDP数据传输模式。若是,则在流程方块S1604之后,接续进行流程方块S1608。若否,则在流程方块S1604之后,接续进行流程方块S1610。在流程方块S1608中,用户装置310与服务器350停止藉由UDP传输数据,并且用户装置310关闭UDP端口。在流程方块S1608之后,接续进行流程方块S1610。在流程方块S1610中,用户装置310与服务器350藉由一般TCP断线程序中断联机,并且用户装置310与服务器350关闭TCP端口。在流程方块S1610之后,接续进行流程方块S1612。在流程方块S1612,上述的中断联机程序S540的流程到此结束。In process block S1606, the
在此值得一提的是,以上所述本发明的示范实施例还可以在计算机可读取的纪录媒体(computer-readable recording medium)上面如计算机可读码(computer-readable code)上面实施。计算机可读取的纪录媒体是任何可以储存数据的数据储存装置,其中数据储存装置后来可以被计算机系统读取。计算机可读取的纪录媒体的范例包括,但并不限定于ROM、RAM、FLASH、CD-ROMs、磁带、软盘磁盘、光数据储存装置与载波信号。上述的载波信号包括例如藉由有线或无线传输路径经由因特网传输的数据。还可藉由网络连结的计算机系统来分送计算机可读取的纪录媒体,进而利用分布式形式储存与执行计算机可读码。此外,本领域的程序设计者在理解本发明的范畴后,可以轻易地实作用以实现本发明的功能程序、指令、指令丛集、编码片段。It is worth mentioning here that the exemplary embodiments of the present invention described above can also be implemented on a computer-readable recording medium such as a computer-readable code. A computer readable recording medium is any data storage device that can store data, where the data storage device can be thereafter read by a computer system. Examples of computer-readable recording media include, but are not limited to, ROM, RAM, FLASH, CD-ROMs, magnetic tapes, floppy disks, optical data storage devices, and carrier signals. The above-mentioned carrier signal includes, for example, data transmitted via the Internet via a wired or wireless transmission path. The computer-readable recording medium can also be distributed through network-connected computer systems, so that the computer-readable codes can be stored and executed in a distributed manner. In addition, programmers skilled in the art can easily implement the functional programs, instructions, instruction clusters, and code segments for realizing the present invention after understanding the scope of the present invention.
综上所述,本发明的示范实施例提供一种数据传输方法及其用户装置与一种数据传输系统,此数据传输方法利用TCP的可靠性高与UDP的数据传输的额外负荷低的特性,并藉由信道质量的好坏来判断何时在TCP数据传输模式与UDP数据传输模式之间进行切换。如此,使用此数据传输方法的用户装置及数据传输系统可以降低数据传输量、提升数据传输效率、提升功率使用效率以及降低不必要的通讯费用。To sum up, exemplary embodiments of the present invention provide a data transmission method and its user equipment and a data transmission system. The data transmission method utilizes the characteristics of high reliability of TCP and low overhead of UDP data transmission, And judging when to switch between the TCP data transmission mode and the UDP data transmission mode according to the quality of the channel. In this way, the user device and the data transmission system using the data transmission method can reduce data transmission volume, improve data transmission efficiency, improve power usage efficiency and reduce unnecessary communication costs.
虽然本发明已以示范实施例揭示如上,然其并非用以限定本发明,本领域的技术人员在不脱离本发明的精神和范围的前提下可作若干的更动与润饰,故本发明的保护范围以本发明的权利要求为准。Although the present invention has been disclosed above with exemplary embodiments, it is not intended to limit the present invention. Those skilled in the art can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of protection is based on the claims of the present invention.
Claims (21)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2009102073504A CN102045768A (en) | 2009-10-26 | 2009-10-26 | Data transmission method, user device and data transmission system thereof |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2009102073504A CN102045768A (en) | 2009-10-26 | 2009-10-26 | Data transmission method, user device and data transmission system thereof |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN102045768A true CN102045768A (en) | 2011-05-04 |
Family
ID=43911415
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2009102073504A Pending CN102045768A (en) | 2009-10-26 | 2009-10-26 | Data transmission method, user device and data transmission system thereof |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102045768A (en) |
Cited By (21)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102404645A (en) * | 2011-11-14 | 2012-04-04 | 黄广宇 | Remote intelligent control method |
| WO2013102450A1 (en) * | 2012-01-06 | 2013-07-11 | 华为终端有限公司 | Method and device for processing tcp data packet |
| CN103685236A (en) * | 2013-11-21 | 2014-03-26 | 南京信息工程大学 | Method for processing data of user layer in transmission of network data of wireless sensor |
| CN103986762A (en) * | 2014-05-15 | 2014-08-13 | 京信通信系统(中国)有限公司 | A method and device for process state detection |
| CN104094561A (en) * | 2011-12-01 | 2014-10-08 | 汤姆逊许可公司 | Device for obtaining content by choosing the transport protocol according to the available bandwidth |
| CN104202255A (en) * | 2014-08-26 | 2014-12-10 | 浪潮(北京)电子信息产业有限公司 | Efficient multi-link data transmission implementation method |
| CN104243094A (en) * | 2013-06-22 | 2014-12-24 | 塔塔咨询服务有限公司 | System and method for adapting characteristics of application layer protocol using sensed indication |
| CN104283716A (en) * | 2014-10-22 | 2015-01-14 | 网易(杭州)网络有限公司 | Data transmission method, equipment and system |
| CN104580312A (en) * | 2013-10-21 | 2015-04-29 | 北京航天长峰科技工业集团有限公司 | Method for plotting and sharing touch screen type situation map |
| CN105978970A (en) * | 2016-05-11 | 2016-09-28 | 珠海格力电器股份有限公司 | method and device for selecting control mode |
| CN106506434A (en) * | 2015-09-07 | 2017-03-15 | 华为技术有限公司 | Service data transmission method and device |
| CN107707933A (en) * | 2017-10-18 | 2018-02-16 | 中国联合网络通信集团有限公司 | Send, receive the method and device of video flowing |
| CN108667775A (en) * | 2017-03-31 | 2018-10-16 | 宇龙计算机通信科技(深圳)有限公司 | Communication means and communication system |
| CN109547454A (en) * | 2018-12-06 | 2019-03-29 | 空网科技(北京)有限公司 | Terminal device and data transmission method |
| CN109818773A (en) * | 2017-11-22 | 2019-05-28 | 大唐移动通信设备有限公司 | A communication method and device for a network management and a managed device |
| CN112714113A (en) * | 2020-12-23 | 2021-04-27 | 上海有个机器人有限公司 | Robot network self-repairing method, device, terminal and storage medium |
| CN113301000A (en) * | 2020-02-24 | 2021-08-24 | 贵州白山云科技股份有限公司 | Data transmission method, device, medium and equipment |
| CN113541858A (en) * | 2020-04-17 | 2021-10-22 | 深圳先进技术研究院 | Data transmission method, device and medium based on low-power wireless sensor network |
| CN114040351A (en) * | 2021-10-21 | 2022-02-11 | 郑州大学第一附属医院 | Wearable children breathe monitored control system based on near field communication |
| WO2022111471A1 (en) * | 2020-11-30 | 2022-06-02 | 华为技术有限公司 | Communication method and devices |
| CN114900269A (en) * | 2022-07-08 | 2022-08-12 | 广州思德医疗科技有限公司 | Data transmission method, electronic device and computer storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1784674A (en) * | 2004-05-03 | 2006-06-07 | 微软公司 | Fast startup for streaming media |
| US20070040818A1 (en) * | 2005-08-19 | 2007-02-22 | Nec Viewtechnology, Ltd. | Moving image distribution system and moving image distribution server |
| EP1806786A1 (en) * | 2005-02-09 | 2007-07-11 | Matsushita Electric Industrial Co., Ltd. | Monitoring camera device, monitoring system using the same, and monitoring image transmission method |
| CN101360045A (en) * | 2007-07-30 | 2009-02-04 | 佳能株式会社 | Method for the transmission of data packets in a tunnel storage means and tunnel end-point |
-
2009
- 2009-10-26 CN CN2009102073504A patent/CN102045768A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1784674A (en) * | 2004-05-03 | 2006-06-07 | 微软公司 | Fast startup for streaming media |
| EP1806786A1 (en) * | 2005-02-09 | 2007-07-11 | Matsushita Electric Industrial Co., Ltd. | Monitoring camera device, monitoring system using the same, and monitoring image transmission method |
| US20070040818A1 (en) * | 2005-08-19 | 2007-02-22 | Nec Viewtechnology, Ltd. | Moving image distribution system and moving image distribution server |
| CN101360045A (en) * | 2007-07-30 | 2009-02-04 | 佳能株式会社 | Method for the transmission of data packets in a tunnel storage means and tunnel end-point |
Cited By (27)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102404645A (en) * | 2011-11-14 | 2012-04-04 | 黄广宇 | Remote intelligent control method |
| CN104094561A (en) * | 2011-12-01 | 2014-10-08 | 汤姆逊许可公司 | Device for obtaining content by choosing the transport protocol according to the available bandwidth |
| WO2013102450A1 (en) * | 2012-01-06 | 2013-07-11 | 华为终端有限公司 | Method and device for processing tcp data packet |
| CN104243094A (en) * | 2013-06-22 | 2014-12-24 | 塔塔咨询服务有限公司 | System and method for adapting characteristics of application layer protocol using sensed indication |
| CN104580312A (en) * | 2013-10-21 | 2015-04-29 | 北京航天长峰科技工业集团有限公司 | Method for plotting and sharing touch screen type situation map |
| CN103685236A (en) * | 2013-11-21 | 2014-03-26 | 南京信息工程大学 | Method for processing data of user layer in transmission of network data of wireless sensor |
| CN103986762A (en) * | 2014-05-15 | 2014-08-13 | 京信通信系统(中国)有限公司 | A method and device for process state detection |
| CN104202255A (en) * | 2014-08-26 | 2014-12-10 | 浪潮(北京)电子信息产业有限公司 | Efficient multi-link data transmission implementation method |
| CN104283716B (en) * | 2014-10-22 | 2018-01-26 | 网易(杭州)网络有限公司 | Data transmission method, equipment and system |
| CN104283716A (en) * | 2014-10-22 | 2015-01-14 | 网易(杭州)网络有限公司 | Data transmission method, equipment and system |
| CN106506434A (en) * | 2015-09-07 | 2017-03-15 | 华为技术有限公司 | Service data transmission method and device |
| WO2017041569A1 (en) * | 2015-09-07 | 2017-03-16 | 华为技术有限公司 | Service data transmission method and device |
| CN105978970A (en) * | 2016-05-11 | 2016-09-28 | 珠海格力电器股份有限公司 | method and device for selecting control mode |
| CN108667775A (en) * | 2017-03-31 | 2018-10-16 | 宇龙计算机通信科技(深圳)有限公司 | Communication means and communication system |
| CN107707933A (en) * | 2017-10-18 | 2018-02-16 | 中国联合网络通信集团有限公司 | Send, receive the method and device of video flowing |
| CN109818773B (en) * | 2017-11-22 | 2021-03-12 | 大唐移动通信设备有限公司 | A communication method and device for a network management and a managed device |
| CN109818773A (en) * | 2017-11-22 | 2019-05-28 | 大唐移动通信设备有限公司 | A communication method and device for a network management and a managed device |
| CN109547454A (en) * | 2018-12-06 | 2019-03-29 | 空网科技(北京)有限公司 | Terminal device and data transmission method |
| CN113301000A (en) * | 2020-02-24 | 2021-08-24 | 贵州白山云科技股份有限公司 | Data transmission method, device, medium and equipment |
| CN113301000B (en) * | 2020-02-24 | 2023-04-18 | 贵州白山云科技股份有限公司 | Data transmission method, device, medium and equipment |
| CN113541858A (en) * | 2020-04-17 | 2021-10-22 | 深圳先进技术研究院 | Data transmission method, device and medium based on low-power wireless sensor network |
| CN113541858B (en) * | 2020-04-17 | 2024-12-03 | 深圳先进技术研究院 | Data transmission method, device and medium based on low-power wireless sensor network |
| WO2022111471A1 (en) * | 2020-11-30 | 2022-06-02 | 华为技术有限公司 | Communication method and devices |
| CN112714113A (en) * | 2020-12-23 | 2021-04-27 | 上海有个机器人有限公司 | Robot network self-repairing method, device, terminal and storage medium |
| CN114040351A (en) * | 2021-10-21 | 2022-02-11 | 郑州大学第一附属医院 | Wearable children breathe monitored control system based on near field communication |
| CN114040351B (en) * | 2021-10-21 | 2023-04-18 | 郑州大学第一附属医院 | Wearable children breathe monitored control system based on near field communication |
| CN114900269A (en) * | 2022-07-08 | 2022-08-12 | 广州思德医疗科技有限公司 | Data transmission method, electronic device and computer storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102045768A (en) | Data transmission method, user device and data transmission system thereof | |
| CN103248452B (en) | Data sending device, data receiving device, terminal and data transmission method | |
| EP1161822B1 (en) | Enhanced wireless-specific interfaces | |
| RU2460218C2 (en) | Status report method in wireless communication system | |
| CN103547342B (en) | Message sending method, message reading notification method, message receiving method and device | |
| JP2003514440A (en) | Improvement of wireless communication line protocol to reduce setup time of data call | |
| CN101989902B (en) | Data retransmission method and device | |
| CN109041119A (en) | A kind of data transmission method, relevant device and system | |
| CN114501412B (en) | Bluetooth protocol data packet loss compensation method based on double-ear connection | |
| EP3525421B1 (en) | Data transmission method and apparatus | |
| CN112152925A (en) | A data transmission method, terminal and communication system | |
| RU99106677A (en) | METHOD FOR PROCESSING SERVICES AND MOBILE NETWORK SYSTEM PROTOCOL | |
| JP2007522704A (en) | Acknowledgment message processing at the terminal | |
| US7203757B2 (en) | Device, method and program for protocol translation | |
| JP2004015136A5 (en) | ||
| WO2022083371A1 (en) | Data transmission method and device | |
| CN100481811C (en) | Method and transmitter for transmitting data packets | |
| WO2006080357A1 (en) | Communication device, communication system, communication method, communication program, and communication circuit | |
| CN104883307A (en) | System and method for sharing data file among routers | |
| TWI419594B (en) | Data transmission method and user equipment and data transmission system | |
| US8165067B2 (en) | Apparatus and method of 3G mobile communication capable of implementing a multi-channel protocol | |
| CN103312753A (en) | Communication method and device of Internet of things | |
| CN1964362A (en) | A mobile communication system and its method and device for air interface data transmission | |
| JP3388575B2 (en) | Wireless communication device and program recording medium | |
| CN101006706B (en) | Communication device, communication system and communication method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20110504 |


