CN117040692A - Method and device for transmitting service data, electronic equipment and storage medium - Google Patents
Method and device for transmitting service data, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117040692A CN117040692A CN202310952646.9A CN202310952646A CN117040692A CN 117040692 A CN117040692 A CN 117040692A CN 202310952646 A CN202310952646 A CN 202310952646A CN 117040692 A CN117040692 A CN 117040692A
- Authority
- CN
- China
- Prior art keywords
- data
- terminal
- data transmission
- layer
- transmission layer
- 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 69
- 230000005540 biological transmission Effects 0.000 claims abstract description 304
- 230000007246 mechanism Effects 0.000 claims abstract description 162
- 230000004044 response Effects 0.000 claims abstract description 100
- 230000003993 interaction Effects 0.000 claims abstract description 30
- 230000001960 triggered effect Effects 0.000 claims abstract description 8
- 230000008569 process Effects 0.000 claims description 23
- 238000004590 computer program Methods 0.000 claims description 20
- 238000010586 diagram Methods 0.000 description 14
- 230000009471 action Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements 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/1607—Details of the supervisory signal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/30—Definitions, standards or architectural aspects of layered protocol stacks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Communication Control (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
Description
技术领域Technical field
本发明涉及数据处理技术领域,特别是涉及一种业务数据传输的方法及装置、电子设备、存储介质。The present invention relates to the field of data processing technology, and in particular to a business data transmission method and device, electronic equipment, and storage media.
背景技术Background technique
在数据传输过程中,业务透传作为一种基于不可靠传输的业务,可以用于管理控制系统管理终端设备。During the data transmission process, business transparent transmission, as a service based on unreliable transmission, can be used in the management control system to manage terminal equipment.
当网络拥塞时,传输的数据可以会发生丢失,从而导致管理控制系统不能及时收到终端设备的数据,应用程序界面处于等待状态。此时,应用程序可以按照秒级标准判断超时,超时后重传。When the network is congested, the transmitted data may be lost, causing the management control system to be unable to receive data from the terminal device in time, and the application program interface to be in a waiting state. At this time, the application can determine the timeout based on the second-level standard and retransmit after the timeout.
然而,从管理控制系统的应用程序将数据重传至终端的应用程序会导致获取终端信息的时间长,进而存在其用户体验不好的问题。However, retransmitting data from the application of the management control system to the application of the terminal will cause a long time to obtain the terminal information, thereby causing a problem of poor user experience.
而且,管理控制系统每次管理终端信息时,需要在收到终端响应或者超时后才能发送下一个请求,当获取的信息量比较多时,获取所有信息的时间会大大增加。Moreover, every time the management control system manages terminal information, it needs to receive a terminal response or time out before sending the next request. When the amount of information obtained is relatively large, the time to obtain all information will be greatly increased.
发明内容Contents of the invention
鉴于上述问题,提出了以便提供克服上述问题或者至少部分地解决上述问题的一种业务数据传输的方法及装置、电子设备、存储介质,包括:In view of the above problems, a business data transmission method and device, electronic equipment, and storage medium are proposed to overcome the above problems or at least partially solve the above problems, including:
一种业务数据传输的方法,应用于第一终端,所述第一终端包括应用层、数据传输层以及数据发送层,所述方法包括:A method of business data transmission, applied to a first terminal. The first terminal includes an application layer, a data transmission layer and a data sending layer. The method includes:
在所述数据传输层中创建与第二终端进行数据传输过程中的重传机制和/或响应机制;Create a retransmission mechanism and/or response mechanism in the data transmission layer during data transmission with the second terminal;
在所述数据传输层接收到待传输至所述第二终端的业务数据后,基于所述数据传输层和所述数据发送层之间的数据交互,采用所述重传机制和/或响应机制,与所述第二终端进行所述业务数据的数据传输。After the data transmission layer receives the service data to be transmitted to the second terminal, based on the data interaction between the data transmission layer and the data sending layer, the retransmission mechanism and/or response mechanism is used , perform data transmission of the service data with the second terminal.
可选地,所述重传机制为超时重传机制,所述基于所述数据传输层和所述数据发送层之间的数据交互,采用所述重传机制和/或响应机制,与所述第二终端进行所述业务数据的数据传输,包括:Optionally, the retransmission mechanism is a timeout retransmission mechanism, based on the data interaction between the data transmission layer and the data sending layer, using the retransmission mechanism and/or response mechanism, and the The second terminal performs data transmission of the service data, including:
在所述数据发送层向所述第二终端发送业务数据时,启动所述数据传输层中的定时器进行计时;When the data transmission layer sends service data to the second terminal, start the timer in the data transmission layer for timing;
当所述定时器的计时数据大于或等于时间阈值时,所述数据传输层未检测到所述第一终端接收到所述第二终端针对所述业务数据反馈的响应数据时,采用所述数据传输层和所述数据发送层将所述业务数据重传至所述第二终端。When the timing data of the timer is greater than or equal to the time threshold and the data transmission layer does not detect that the first terminal receives the response data fed back by the second terminal for the service data, the data is used The transport layer and the data sending layer retransmit the service data to the second terminal.
可选地,所述重传机制为丢包重传机制,所述业务数据以一个或多个数据包的形式被发送至第二终端,每个数据包设置有报文序号,所述基于所述数据传输层和所述数据发送层之间的数据交互,采用所述重传机制和/或响应机制,与所述第二终端进行所述业务数据的数据传输,包括:Optionally, the retransmission mechanism is a packet loss retransmission mechanism. The service data is sent to the second terminal in the form of one or more data packets. Each data packet is set with a message sequence number. The data interaction between the data transmission layer and the data sending layer uses the retransmission mechanism and/or response mechanism to perform data transmission of the service data with the second terminal, including:
采用所述数据传输层接收所述第二终端发送的丢包的数据包对应的目标报文序号,所述数据传输层用于在所述业务数据传输过程中满足所述重传机制和/或响应机制的触发条件时,执行所述重传机制和/或响应机制;The data transmission layer is used to receive the target message sequence number corresponding to the lost data packet sent by the second terminal. The data transmission layer is used to satisfy the retransmission mechanism and/or during the service data transmission process. When the trigger condition of the response mechanism is triggered, execute the retransmission mechanism and/or response mechanism;
采用所述数据发送层将所述目标报文序号对应的数据包重传至所述第二终端,所述数据发送层用于所述业务数据传输过程中,与所述第一终端的数据传输层和/或所述第二终端进行数据交互。The data transmission layer is used to retransmit the data packet corresponding to the target message sequence number to the second terminal. The data transmission layer is used for data transmission with the first terminal during the service data transmission process. layer and/or the second terminal for data exchange.
可选地,所述基于所述数据传输层和所述数据发送层,采用所述重传机制和/或响应机制之间的数据交互,与所述第二终端进行所述业务数据的数据传输,包括:Optionally, the data transmission layer based on the data transmission layer and the data sending layer adopts the data interaction between the retransmission mechanism and/or the response mechanism to perform data transmission of the service data with the second terminal. ,include:
采用所述数据传输层和所述数据发送层发送所述业务数据至所述第二终端;Using the data transmission layer and the data sending layer to send the service data to the second terminal;
采用所述数据传输层接收所述第二终端针对所述业务数据返回的响应数据。The data transmission layer is used to receive response data returned by the second terminal for the service data.
一种业务数据传输的方法,应用于第二终端,所述第二终端包括应用层、数据传输层以及数据发送层,所述方法包括:A method of business data transmission, applied to a second terminal. The second terminal includes an application layer, a data transmission layer and a data sending layer. The method includes:
在所述数据传输层中创建与第一终端进行数据传输过程中的重传机制和/或响应机制;Create a retransmission mechanism and/or response mechanism in the data transmission layer during data transmission with the first terminal;
采用所述数据发送层接收所述第一终端发送至所述第二终端的业务数据;Using the data sending layer to receive service data sent by the first terminal to the second terminal;
基于所述数据传输层和所述数据发送层之间的数据交互,采用所述重传机制和/或响应机制,与所述第一终端进行所述业务数据的数据传输。Based on the data interaction between the data transmission layer and the data sending layer, the retransmission mechanism and/or response mechanism is used to perform data transmission of the service data with the first terminal.
可选地,所述重传机制为丢包重传机制,所述业务数据以一个或多个数据包的形式被发送至第二终端,每个数据包设置有报文序号,所述基于所述数据传输层和所述数据发送层之间的数据交互,采用所述重传机制和/或响应机制,与所述第一终端进行所述业务数据的数据传输,包括:Optionally, the retransmission mechanism is a packet loss retransmission mechanism. The service data is sent to the second terminal in the form of one or more data packets. Each data packet is set with a message sequence number. The data interaction between the data transmission layer and the data sending layer uses the retransmission mechanism and/or response mechanism to perform data transmission of the service data with the first terminal, including:
采用所述数据传输层,根据接收的数据包的报文序号,判断所述第一终端向所述第二终端发送数据包过程中是否存在丢包;Using the data transmission layer, based on the message sequence number of the received data packet, determine whether there is packet loss in the process of sending the data packet from the first terminal to the second terminal;
当所述数据传输层判定所述第二终端存在丢包时,确定所述丢包的数据包对应目标报文序号;When the data transmission layer determines that there is packet loss in the second terminal, determine the target message sequence number corresponding to the lost data packet;
采用所述数据发送层将所述目标报文序号发送至所述第一终端,以使所述第一终端重传所述目标报文序号对应的数据包至所述第二终端。The data sending layer is used to send the target message sequence number to the first terminal, so that the first terminal retransmits the data packet corresponding to the target message sequence number to the second terminal.
一种业务数据传输的装置,应用于第一终端,所述第一终端包括应用层、数据传输层以及数据发送层,所述装置包括:A device for transmitting business data, applied to a first terminal. The first terminal includes an application layer, a data transmission layer and a data sending layer. The device includes:
第一机制创建模块,用于在所述数据传输层中创建与第二终端进行数据传输过程中的重传机制和/或响应机制;A first mechanism creation module, configured to create a retransmission mechanism and/or a response mechanism in the data transmission layer during data transmission with the second terminal;
第一业务数据传输模块,用于在所述数据传输层接收到待传输至所述第二终端的业务数据后,基于所述数据传输层和所述数据发送层之间的数据交互,采用所述重传机制和/或响应机制,与所述第二终端进行所述业务数据的数据传输。The first service data transmission module is configured to, after the data transmission layer receives the service data to be transmitted to the second terminal, based on the data interaction between the data transmission layer and the data sending layer, using the The retransmission mechanism and/or response mechanism are used to transmit the service data with the second terminal.
一种业务数据传输的装置,应用于第二终端,所述第二终端包括应用层、数据传输层以及数据发送层,所述装置包括:A device for transmitting service data, applied to a second terminal. The second terminal includes an application layer, a data transmission layer and a data sending layer. The device includes:
第一机制创建模块,用于在所述数据传输层中创建与第一终端进行数据传输过程中的重传机制和/或响应机制;A first mechanism creation module, configured to create a retransmission mechanism and/or response mechanism in the data transmission layer with the first terminal;
业务数据接收模块,用于采用所述数据发送层接收所述第一终端发送至所述第二终端的业务数据;A service data receiving module, configured to use the data sending layer to receive service data sent by the first terminal to the second terminal;
第二业务数据传输模块,用于基于所述数据传输层和所述数据发送层,采用所述重传机制和/或响应机制,与所述第一终端进行所述业务数据的数据传输。The second service data transmission module is configured to perform data transmission of the service data with the first terminal based on the data transmission layer and the data sending layer and using the retransmission mechanism and/or response mechanism.
一种电子设备,包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如上所述业务数据传输的方法。An electronic device, including a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, the method for transmitting business data as described above is implemented. .
一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如上所述业务数据传输的方法。A computer-readable storage medium stores a computer program on the computer-readable storage medium. When the computer program is executed by a processor, the method for transmitting business data as described above is implemented.
本发明实施例具有以下优点:The embodiments of the present invention have the following advantages:
在本发明实施例中,在数据传输层中创建与第二终端进行数据传输过程中的重传机制和/或响应机制;进而可以在所述数据传输层接收到待传输至所述第二终端的业务数据后,基于数据传输层和数据发送层之间的数据交互,采用重传机制和/或响应机制,与第二终端进行业务数据的数据传输,实现了在数据传输过程中,重传和响应由数据传输层触发,无需到达应用层,从而,避免了应用程序执行重传,当网络因数据量大而拥塞时,可以提高数据成功传输的概率,应用层可以及时获悉业务数据是否发送到第二终端,减少应用层等待时间。In the embodiment of the present invention, a retransmission mechanism and/or a response mechanism during data transmission with the second terminal are created in the data transmission layer; in turn, the data to be transmitted to the second terminal can be received in the data transmission layer After receiving the business data, based on the data interaction between the data transmission layer and the data sending layer, the retransmission mechanism and/or response mechanism is used to transmit the business data with the second terminal, realizing retransmission during the data transmission process. and response are triggered by the data transmission layer and do not need to reach the application layer, thereby avoiding the application program to perform retransmission. When the network is congested due to a large amount of data, the probability of successful data transmission can be improved, and the application layer can learn in time whether the business data is sent. Go to the second terminal to reduce the application layer waiting time.
附图说明Description of the drawings
为了更清楚地说明本发明的技术方案,下面将对本发明的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solution of the present invention more clearly, the drawings needed to be used in the description of the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those in the field, Ordinary technicians can also obtain other drawings based on these drawings without exerting creative labor.
图1是本发明一实施例提供的一种业务数据传输的方法的步骤流程图;Figure 1 is a step flow chart of a service data transmission method provided by an embodiment of the present invention;
图2是本发明一实施例提供的另一种业务数据传输的方法的步骤流程图;Figure 2 is a step flow chart of another method for transmitting business data provided by an embodiment of the present invention;
图3是本发明一实施例提供的另一种业务数据传输的方法的步骤流程图;Figure 3 is a step flow chart of another method of service data transmission provided by an embodiment of the present invention;
图4是本发明一实施例提供的另一种业务数据传输的方法的步骤流程图;Figure 4 is a step flow chart of another method for transmitting service data provided by an embodiment of the present invention;
图5是本发明一实施例提供的另一种业务数据传输的方法的步骤流程图;Figure 5 is a step flow chart of another method of service data transmission provided by an embodiment of the present invention;
图6a是本发明一实施例提供的一种业务数据传输的方法的步骤流程图;Figure 6a is a step flow chart of a service data transmission method provided by an embodiment of the present invention;
图6b是本发明一实施例提供的另一种业务数据传输的方法的步骤流程图;Figure 6b is a step flow chart of another service data transmission method provided by an embodiment of the present invention;
图7是本发明一实施例提供的一种业务数据传输的装置的结构示意图;Figure 7 is a schematic structural diagram of a device for transmitting service data provided by an embodiment of the present invention;
图8是本发明一实施例提供的另一种业务数据传输的装置的结构示意图。FIG. 8 is a schematic structural diagram of another device for transmitting service data provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the above objects, features and advantages of the present invention more obvious and understandable, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present invention.
参照图1,示出了本发明一实施例提供的一种业务数据传输的方法的步骤流程图,应用于第一终端,第一终端包括应用层、数据传输层以及数据发送层,应用层面向用户,响应于用户的输入操作,选择与第一终端进行业务交互的第二终端,并确定需要传输至第二终端的业务数据,在应用层中可以设置发送接口,发送接口用于传入目的号码、子号码和业务数据等业务交互过程中需要的数据;数据传输层中位于应用层和数据发送层之间,用于对业务传输过程中的数据进行处理,在数据传输层中可以填充可靠传输需要的信息,例如:报文序号,本地窗口大小、报文类型、缓存数据、发送次数等,报文序号可以为业务数据拆分的数据包的标识,本地窗口大小用于确定介意传输的数据量大小,报文类型可以包括响应类报文和请求类报文。缓存数据可以用于暂存正在发送的业务数据,避免业务数据丢失后需要重新从应用层获取数据,缩短反映时间。数据发送层可以用于将业务数据发送至外部的其他终端。第一终端、第二终端可以为视联网中的终端。第一终端和第二终端可以通过业务透传协议进行传输,Referring to Figure 1, there is shown a step flow chart of a service data transmission method provided by an embodiment of the present invention, which is applied to a first terminal. The first terminal includes an application layer, a data transmission layer and a data sending layer. The application layer is oriented to The user, in response to the user's input operation, selects a second terminal for business interaction with the first terminal, and determines the business data that needs to be transmitted to the second terminal. A sending interface can be set in the application layer, and the sending interface is used for incoming purposes. Data required in the business interaction process such as numbers, sub-numbers and business data; the data transmission layer is located between the application layer and the data transmission layer and is used to process data during the business transmission process. Reliable filling can be done in the data transmission layer Information required for transmission, such as: message sequence number, local window size, message type, cached data, number of transmissions, etc. The message sequence number can be the identifier of the data packet that the business data is split into, and the local window size is used to determine the data to be transmitted. The amount of data and message types can include response messages and request messages. Cache data can be used to temporarily store the business data being sent to avoid the need to re-obtain the data from the application layer after the business data is lost and shorten the reflection time. The data sending layer can be used to send business data to other external terminals. The first terminal and the second terminal may be terminals in the visual network. The first terminal and the second terminal can transmit through the service transparent transmission protocol,
基于本发明实施例中的第一终端,业务数据传输过程具体可以包括如下步骤:Based on the first terminal in the embodiment of the present invention, the service data transmission process may specifically include the following steps:
步骤101,在数据传输层中创建与第二终端进行数据传输过程中的重传机制和/或响应机制;Step 101: Create a retransmission mechanism and/or response mechanism in the data transmission layer during data transmission with the second terminal;
其中,重传机制可以为终端中触发重新发送业务数据或业务数据的某一个或多个数据包的重传规则,可以预设一个或多个重传规则,进而当第一终端在业务进行过程中,可以基于该重传机制进行终端之间的交互。Among them, the retransmission mechanism can be a retransmission rule in the terminal that triggers the retransmission of service data or one or more data packets of the service data. One or more retransmission rules can be preset, and then when the first terminal is in the process of service , the interaction between terminals can be carried out based on this retransmission mechanism.
响应规则为针对接收的数据,向发送数据的终端反馈对应的响应数据,以告知发送数据的终端,已接收到数据。The response rule is to feed back corresponding response data to the terminal sending the data for the received data, so as to inform the terminal sending the data that the data has been received.
在一示例中,重传机制和响应机制可以通过在数据传输层中配置对应字段创建生成。In an example, the retransmission mechanism and response mechanism can be created and generated by configuring corresponding fields in the data transmission layer.
本发明实施例中,通过在数据传输层设置重传机制和/或响应机制。可以在业务数据传输过程中,由数据传输层执行重传和/或响应,从而,可以增加传输的可靠性,减少应用层的等待时间,在网络拥塞的情况下,改善用户的体验。In the embodiment of the present invention, a retransmission mechanism and/or a response mechanism are set at the data transmission layer. During the service data transmission process, the data transmission layer can perform retransmission and/or response, thereby increasing the reliability of the transmission, reducing the waiting time of the application layer, and improving the user experience in the case of network congestion.
步骤102,在数据传输层接收到待传输至第二终端的业务数据后,基于数据传输层和数据发送层之间的数据交互,采用重传机制和/或响应机制,与第二终端进行业务数据的数据传输。Step 102: After the data transmission layer receives the service data to be transmitted to the second terminal, based on the data interaction between the data transmission layer and the data sending layer, a retransmission mechanism and/or a response mechanism is used to conduct business with the second terminal. Data transfer of data.
在数据传输层创建重传机制和/或响应机制后,数据传输层在接收到待传输的业务数据时,则可以基于已创建的重传机制和/或响应机制,判断当前业务数据传输状态是否符合重传机制和/或响应机制的预设触发条件,进而,数据传输层和数据发送层之间按照重传机制和/或响应机制进行数据交互,实现业务数据的数据传输。After the data transmission layer creates a retransmission mechanism and/or a response mechanism, when the data transmission layer receives the business data to be transmitted, it can determine whether the current business data transmission status is based on the created retransmission mechanism and/or response mechanism. In line with the preset trigger conditions of the retransmission mechanism and/or response mechanism, the data transmission layer and the data sending layer perform data interaction according to the retransmission mechanism and/or response mechanism to realize data transmission of business data.
例如,检测到业务数据当前传输处于传输超时状态(如在发送业务数据后预设时间内未收到业务数据对应的响应数据),则可以启动超时重传机制。For example, if it is detected that the current transmission of business data is in a transmission timeout state (for example, no response data corresponding to the business data is received within a preset time after sending the business data), the timeout retransmission mechanism can be started.
在一示例中,在终端中,业务数据沿应用层-数据传输层-数据发送层的方向传输至另一终端,应用层可以响应于用户的业务数据输入操作,获取待发送至第二终端的业务数据。具体的,在应用层中,可以通过调用中终端的发送接口传入业务数据。此外,在应用层中还可以从通讯录中选择可进行业务数据传输的第二终端,并确定第一终端和第二终端的地址信息。In one example, in the terminal, the service data is transmitted to another terminal along the direction of application layer - data transmission layer - data sending layer. The application layer can respond to the user's service data input operation and obtain the data to be sent to the second terminal. business data. Specifically, in the application layer, service data can be passed in through the sending interface of the calling terminal. In addition, in the application layer, a second terminal capable of transmitting service data can be selected from the address book, and the address information of the first terminal and the second terminal can be determined.
应用层的业务数据可以发送至数据传输层,进而经数据传输层处理后,传入数据发送层,在数据发送层中将业务数据发送至第二终端。The business data of the application layer can be sent to the data transmission layer, and then, after being processed by the data transmission layer, is transmitted to the data transmission layer, where the business data is sent to the second terminal.
在第一终端和第二终端交互过程中,可以应用预先创建的重传机制和/或响应机制,即当第一终端与第二终端的状态符合重传机制或响应机制中的预设条件时,则触发数据传输层进行数据重传或响应。During the interaction process between the first terminal and the second terminal, the pre-created retransmission mechanism and/or response mechanism can be applied, that is, when the status of the first terminal and the second terminal meets the preset conditions in the retransmission mechanism or response mechanism , triggers the data transmission layer to retransmit data or respond.
在本发明一实施例中,在数据传输层中缓存业务数据;在完成业务数据传输后,清除数据传输层中缓存的业务数据。In an embodiment of the present invention, the business data is cached in the data transmission layer; after the service data transmission is completed, the cached business data in the data transmission layer is cleared.
在本发明实施例中,在数据传输层中创建与第二终端进行数据传输过程中的重传机制和/或响应机制;进而可以在数据传输层接收到待传输至第二终端的业务数据后,基于数据传输层和数据发送层之间的数据交互,采用重传机制和/或响应机制,与第二终端进行业务数据的数据传输,实现了在数据传输过程中,重传和响应由数据传输层触发,无需到达应用层,从而,避免了应用程序执行重传,当网络因数据量大而拥塞时,可以提高数据成功传输的概率,应用层可以及时获悉业务数据是否发送到第二终端,减少应用层等待时间。In the embodiment of the present invention, a retransmission mechanism and/or a response mechanism during data transmission with the second terminal are created in the data transmission layer; and then the service data to be transmitted to the second terminal can be received in the data transmission layer. , based on the data interaction between the data transmission layer and the data sending layer, the retransmission mechanism and/or response mechanism is used to transmit business data with the second terminal, realizing that during the data transmission process, retransmission and response are performed by the data The transport layer is triggered without reaching the application layer, thereby avoiding the application program to perform retransmissions. When the network is congested due to a large amount of data, the probability of successful data transmission can be improved. The application layer can learn in time whether the business data is sent to the second terminal. , Reduce application layer waiting time.
参照图2,示出了本发明一实施例提供的另一种业务数据传输的方法的步骤流程图,具体可以包括如下步骤:Referring to Figure 2, a flow chart of another method for transmitting service data provided by an embodiment of the present invention is shown. Specifically, it may include the following steps:
步骤201,在数据传输层中创建与第二终端进行数据传输过程中的重传机制和/或响应机制;重传机制为超时重传机制;Step 201: Create a retransmission mechanism and/or response mechanism in the data transmission layer during data transmission with the second terminal; the retransmission mechanism is a timeout retransmission mechanism;
步骤202,在数据发送层向第二终端发送业务数据时,启动数据传输层中的定时器进行计时;Step 202: When the data transmission layer sends service data to the second terminal, start the timer in the data transmission layer for timing;
数据传输层中创建的重传机制可以为超时重传机制,即当第一终端超过预设时间未收到响应数据,则触发第一终端重新发送业务数据至第二终端。The retransmission mechanism created in the data transmission layer may be a timeout retransmission mechanism, that is, when the first terminal does not receive response data beyond the preset time, the first terminal is triggered to resend the service data to the second terminal.
在超时重传机制中,可以在数据传输层中设置一定时器,记录数据发送时间,当业务数据可以经由数据传输层发送至数据发送层,数据发送层可以调用发送接口,通过业务透传协议发送业务数据,在发送业务数据同时,向数据传输发送指令,以开启定时器进行计时。In the timeout retransmission mechanism, a timer can be set in the data transmission layer to record the data transmission time. When the business data can be sent to the data transmission layer through the data transmission layer, the data transmission layer can call the transmission interface and pass the business transparent transmission protocol Send business data. While sending business data, send instructions to data transmission to start the timer for timing.
步骤203,当定时器的计时数据大于或等于时间阈值时,数据传输层未检测到第一终端接收到第二终端针对业务数据反馈的响应数据时,采用数据传输层和数据发送层将业务数据重传至第二终端。Step 203: When the timing data of the timer is greater than or equal to the time threshold and the data transmission layer does not detect that the first terminal receives the response data for the service data feedback from the second terminal, the data transmission layer and the data transmission layer are used to transmit the service data. Retransmit to the second terminal.
在一示例中,超时重传机制中还可以设置重传次数。例如,设置重传次数为3次,则可以在确定定时器超时情况下重传三次业务数据至第二终端。In an example, the number of retransmissions can also be set in the timeout retransmission mechanism. For example, if the number of retransmissions is set to three times, the service data can be retransmitted three times to the second terminal when the timer is determined to have expired.
当第二终端收到任意一次发送的业务数据,则表示重传成功,当三次均未收到,则表示重传失败,在重传失败的情况下,可以提示用户确认第一终端和第二终端的设备状态。When the second terminal receives the service data sent at any time, it means that the retransmission is successful. When it does not receive it three times, it means that the retransmission fails. In the case of retransmission failure, the user can be prompted to confirm that the first terminal and the second terminal The device status of the terminal.
在本发明实施例中,通过设置超时重传机制,当数据传输层监测到定时器超时,则可以即可从数据传输层开始启动重传,相比于从应用层进行重传可以缩短响应时间,减少应用层等待时间。In the embodiment of the present invention, by setting a timeout retransmission mechanism, when the data transmission layer detects that the timer has expired, retransmission can be started from the data transmission layer. Compared with retransmission from the application layer, the response time can be shortened. , Reduce application layer waiting time.
参照图3,示出了本发明一实施例提供的另一种业务数据传输的方法的步骤流程图,具体可以包括如下步骤:Referring to Figure 3, a flow chart of another method for transmitting service data provided by an embodiment of the present invention is shown. Specifically, it may include the following steps:
步骤301,在数据传输层中创建与第二终端进行数据传输过程中的重传机制和/或响应机制;重传机制为丢包重传机制;Step 301: Create a retransmission mechanism and/or response mechanism in the data transmission layer during data transmission with the second terminal; the retransmission mechanism is a packet loss retransmission mechanism;
其中,业务数据以一个或多个数据包的形式被发送至第二终端,每个数据包设置有报文序号。The service data is sent to the second terminal in the form of one or more data packets, and each data packet is set with a message sequence number.
业务数据可以被拆分成一个或多个数据包,每个数据包进行编号,即每个数据对应有其报文序号,进而可以将数据包发送至第二终端。The service data can be split into one or more data packets, and each data packet is numbered, that is, each data corresponds to its message sequence number, and then the data packet can be sent to the second terminal.
步骤302,采用数据传输层接收第二终端发送的丢包的数据包对应的目标报文序号;Step 302: Use the data transmission layer to receive the target message sequence number corresponding to the lost data packet sent by the second terminal;
其中,数据传输层用于在业务数据传输过程中满足重传机制和/或响应机制的触发条件时,执行重传机制和/或响应机制;Among them, the data transmission layer is used to execute the retransmission mechanism and/or response mechanism when the triggering conditions of the retransmission mechanism and/or response mechanism are met during the service data transmission process;
第二终端接收数据包,并根据数据包的报文序号判断是否存在丢包,进而确定丢包的数据包对应的目标报文序号,并将该目标报文序号发送至所述第一终端,以触发第一终端重新发送该目标报文序号对应的数据包。The second terminal receives the data packet, determines whether there is packet loss based on the message sequence number of the data packet, and then determines the target message sequence number corresponding to the lost data packet, and sends the target message sequence number to the first terminal, To trigger the first terminal to resend the data packet corresponding to the target message sequence number.
步骤303,采用数据发送层将目标报文序号对应的数据包重传至第二终端。Step 303: Use the data transmission layer to retransmit the data packet corresponding to the target message sequence number to the second terminal.
其中,数据发送层用于业务数据传输过程中,与第一终端的数据传输层和/或第二终端进行数据交互。具体的,第一终端中的数据发送层将第一中终端的数据发送至第二终端或者接收所述第二终端发送至第一终端的数据。The data transmission layer is used for data interaction with the data transmission layer of the first terminal and/or the second terminal during service data transmission. Specifically, the data sending layer in the first terminal sends data from the first terminal to the second terminal or receives data sent from the second terminal to the first terminal.
在本发明一实施例中,在触发重传后,确定重传次数;在重传次数大于预设次数时,则停止重传。In an embodiment of the present invention, after triggering retransmission, the number of retransmissions is determined; when the number of retransmissions is greater than the preset number, retransmissions are stopped.
在本发明一实施例中,在数据传输层中缓存业务数据;在完成业务数据传输后,清除数据传输层中缓存的业务数据。In an embodiment of the present invention, the business data is cached in the data transmission layer; after the service data transmission is completed, the cached business data in the data transmission layer is cleared.
在本发明实施例中,第一终端可以针对数据传输过程中丢包的数据包进行重传,从而确保第二终端可以收到业务数据的所有数据包。当网络因数据量大而拥塞时,可以提高数据成功传输的概率,应用层可以及时获悉业务数据是否发送到第二终端,减少应用层等待时间。In the embodiment of the present invention, the first terminal can retransmit the data packets lost during the data transmission process, thereby ensuring that the second terminal can receive all data packets of the service data. When the network is congested due to a large amount of data, the probability of successful data transmission can be increased. The application layer can learn in time whether the business data is sent to the second terminal, reducing the waiting time of the application layer.
参照图4,示出了本发明一实施例提供的另一种业务数据传输的方法的步骤流程图,具体可以包括如下步骤:Referring to Figure 4, a flowchart of steps of another service data transmission method provided by an embodiment of the present invention is shown. Specifically, it may include the following steps:
步骤401,在数据传输层中创建与第二终端进行数据传输过程中的重传机制和/或响应机制;Step 401: Create a retransmission mechanism and/or response mechanism in the data transmission layer during data transmission with the second terminal;
步骤402,采用数据传输层和数据发送层发送业务数据至第二终端;Step 402: Use the data transmission layer and the data sending layer to send the service data to the second terminal;
步骤403,采用所述数据发送层接收第二终端针对业务数据返回的响应数据。Step 403: Use the data sending layer to receive response data returned by the second terminal for the service data.
在第一终端发送业务数据至第二终端后,则可以基于响应机制,接收到第二终端反馈的响应数据。After the first terminal sends the service data to the second terminal, the response data fed back by the second terminal can be received based on the response mechanism.
第二终端的响应数据可以包括但不限于:业务数据发送成功的响应消息、业务数据发送失败的消息。The response data of the second terminal may include but is not limited to: a response message indicating that the service data is successfully sent, and a message indicating that the service data is failed to be sent.
在本发明实施例中,第一终端和第二终端之间设备响应机制,基于响应机制进行传输,可以提高数据成功传输的概率,且应用层可以及时获悉业务数据是否发送到第二终端,减少应用层等待时间。In the embodiment of the present invention, the device response mechanism between the first terminal and the second terminal is transmitted based on the response mechanism, which can improve the probability of successful data transmission, and the application layer can learn in time whether the service data is sent to the second terminal, reducing Application layer waiting time.
参照图5,示出了本发明一实施例提供的另一种业务数据传输的方法的步骤流程图,应用于第二终端,第二终端包括应用层、数据传输层以及数据发送层。Referring to FIG. 5 , there is shown a step flow chart of another service data transmission method provided by an embodiment of the present invention, which is applied to a second terminal. The second terminal includes an application layer, a data transmission layer, and a data sending layer.
基于本发明实施例中的第二终端,业务数据传输过程具体可以包括如下步骤:Based on the second terminal in the embodiment of the present invention, the service data transmission process may specifically include the following steps:
步骤501,在数据传输层中创建与第一终端进行数据传输过程中的重传机制和/或响应机制;Step 501: Create a retransmission mechanism and/or response mechanism in the data transmission layer during data transmission with the first terminal;
步骤502,采用数据发送层接收第一终端发送至第二终端的业务数据;Step 502: Use the data sending layer to receive the service data sent from the first terminal to the second terminal;
步骤503,基于数据传输层和数据发送层之间的数据交互,采用重传机制和/或响应机制,与第一终端进行业务数据的数据传输。Step 503: Based on the data interaction between the data transmission layer and the data sending layer, a retransmission mechanism and/or a response mechanism is used to transmit service data with the first terminal.
在本发明一实施例中,重传机制为丢包重传机制,业务数据以一个或多个数据包的形式被发送至第二终端,每个数据包设置有报文序号,采用数据传输层和数据发送层,基于重传机制和/或响应机制,与第一终端进行业务数据的数据传输,包括:采用数据传输层根据接收的数据包的报文序号,判断第一终端向第二终端发送数据包过程中是否存在丢包;当数据传输层判断业务数据传输存在丢包时,确定丢包的数据包对应目标报文序号;将目标报文序号发送至第一终端,以使第一终端重传目标报文序号对应的数据包至第二终端。In one embodiment of the present invention, the retransmission mechanism is a packet loss retransmission mechanism. The service data is sent to the second terminal in the form of one or more data packets. Each data packet is set with a message sequence number, and a data transmission layer is used. and the data transmission layer, based on the retransmission mechanism and/or response mechanism, to perform data transmission of business data with the first terminal, including: using the data transmission layer to determine the transmission of service data from the first terminal to the second terminal based on the message sequence number of the received data packet. Whether there is packet loss during the process of sending data packets; when the data transmission layer determines that there is packet loss in business data transmission, it determines that the lost data packet corresponds to the target message sequence number; sends the target message sequence number to the first terminal so that the first The terminal retransmits the data packet corresponding to the target message sequence number to the second terminal.
在一示例中,当数据传输层接收到业务数据后,根据业务数据类型判断是否为响应报文,当业务数据不为响应报文时,根据接收的每个数据包的报文序号判断是否接收到所有的数据包,在接收到所有数据包时,可以按照报文序号对多个数据包进行重组,还原业务数据,进而将该业务数据反馈至应用层。In an example, when the data transmission layer receives the service data, it determines whether it is a response message based on the service data type. When the service data is not a response message, it determines whether it is received based on the message sequence number of each received data packet. When all data packets are received, multiple data packets can be reorganized according to the message sequence number, the business data can be restored, and the business data can be fed back to the application layer.
当未接收到所有数据包时,即在第一终端和第二终端的业务数据传输过程中发生了丢包,则可以向第一终端发送反馈报文,在反馈报文中先可以携带丢包的数据包对应目标报文序号,进而可以以目标报文序号触发数据包重传。When not all data packets are received, that is, packet loss occurs during the service data transmission process between the first terminal and the second terminal, a feedback message can be sent to the first terminal, and the feedback message can first carry the lost packet. The data packet corresponds to the target message sequence number, and the data packet retransmission can be triggered by the target message sequence number.
在一示例中,当未接收到所有数据包时,判断接收是否超时,如未超时则继续接收数据,如接收超时,则可以第一终端发送反馈报文。In an example, when not all data packets are received, it is determined whether the reception times out. If the reception times out, the data continues to be received. If the reception times out, the first terminal may send a feedback message.
在本发明实施例中,在所述数据传输层中创建与第一终端进行数据传输过程中的重传机制和/或响应机制;采用数据发送层接收所述第一终端发送至所述第二终端的业务数据;基于所述数据传输层和所述数据发送层,采用所述重传机制和/或响应机制,与所述第一终端进行所述业务数据的数据传输。实现了在数据传输过程中,重传和响应由数据传输层触发,无需到达应用层,从而,避免了应用程序执行重传,当网络因数据量大而拥塞时,可以提高数据成功传输的概率,应用层可以及时获悉业务数据是否发送到第二终端,减少应用层等待时间。In the embodiment of the present invention, a retransmission mechanism and/or a response mechanism during data transmission with the first terminal is created in the data transmission layer; the data transmission layer is used to receive the data sent by the first terminal to the second terminal. The service data of the terminal; based on the data transmission layer and the data sending layer, the retransmission mechanism and/or the response mechanism are used to perform data transmission of the service data with the first terminal. It realizes that during the data transmission process, retransmission and response are triggered by the data transmission layer without reaching the application layer, thus avoiding the application program to perform retransmission. When the network is congested due to a large amount of data, it can increase the probability of successful data transmission. , the application layer can learn in time whether the business data is sent to the second terminal, reducing the waiting time of the application layer.
如图6a所示,为本本发明实施例中一种通过业务透传协议进行可靠传输数据交互流程示意图。As shown in Figure 6a, it is a schematic diagram of a data interaction process for reliable transmission through a service transparent transmission protocol in an embodiment of the present invention.
第一终端中可以包括管控软件(即应用层)、可靠传输模块(即数据传输层和数据发送层)、第二终端中可以包括可靠传输模块(即数据传输层和数据发送层)和终端应用程序(即应用层),The first terminal may include management and control software (i.e., application layer), a reliable transmission module (i.e., data transmission layer and data transmission layer), and the second terminal may include a reliable transmission module (i.e., data transmission layer and data transmission layer) and a terminal application. Program (i.e. application layer),
第一终端和第二终端的交互可以包括但不限于以下三种类型:The interaction between the first terminal and the second terminal may include but is not limited to the following three types:
第一类:第一终端的管控软件发送数据至可靠传输模块,可靠传输模块基于业务透传协议发送业务透传报文至第二终端的可靠传输模块,第二终端的可靠传输模块,将数据上送至第二终端的终端应用程序,同时向第一终端的可靠传输层反馈ACK报文。Category 1: The management and control software of the first terminal sends data to the reliable transmission module. The reliable transmission module sends the business transparent transmission message to the reliable transmission module of the second terminal based on the business transparent transmission protocol. The reliable transmission module of the second terminal transmits the data Uploaded to the terminal application of the second terminal, and at the same time, the ACK message is fed back to the reliable transport layer of the first terminal.
第二类:第一终端的管控软件发送数据至可靠传输模块,可靠传输模块基于业务透传协议发送业务透传报文,第一终端超时未收到ACK报文,即响应超时,则重传该业务透传报文,在重传三次均响应超时时,则向第一终端的管控软件反馈数据发送失败,并停止重传。Category 2: The management and control software of the first terminal sends data to the reliable transmission module. The reliable transmission module sends business transparent transmission messages based on the business transparent transmission protocol. If the first terminal times out and does not receive the ACK message, that is, the response times out, it retransmits. If the transparent transmission message of this service times out after three retransmissions, the data transmission failure will be reported to the management and control software of the first terminal and retransmission will be stopped.
第三类:第一终端的管控软件发送数据至可靠传输模块,可靠传输模块基于业务透传协议发送业务透传报文,业务透传报文分为4个数据包分别进行传输,当第二终端可靠传输模块未收到业务透传报文(3/4)时,则可以向第一终端的可靠传输模块发送ACK(第三个报文丢失),第一终端在接收待ACK后,重传业务透传报文(3/4)至第二终端的可靠传输模块,第二终端可靠传输模块收到后,则可以将所有的业务透传报文发生发送至应用程序,并向第一终端的可靠传输模块发送ACK。第一终端的可靠传输模块向管控软件发送成功的消息。Category 3: The management and control software of the first terminal sends data to the reliable transmission module. The reliable transmission module sends business transparent transmission messages based on the business transparent transmission protocol. The business transparent transmission messages are divided into 4 data packets for transmission respectively. When the second When the terminal's reliable transmission module does not receive the service transparent transmission message (3/4), it can send an ACK to the reliable transmission module of the first terminal (the third message is lost). After receiving the pending ACK, the first terminal re- Transmit the business transparent transmission message (3/4) to the reliable transmission module of the second terminal. After the reliable transmission module of the second terminal receives it, it can send all the business transparent transmission messages to the application program and send them to the first terminal. The terminal's reliable transmission module sends ACK. The reliable transmission module of the first terminal sends a successful message to the management and control software.
如图6b所示,为本发明实施例中一种业务数据传输过程的示意图。As shown in Figure 6b, it is a schematic diagram of a service data transmission process in an embodiment of the present invention.
在第一终端的应用层中:调用发送接口、传入目的号码、子号码和要发送的数据(即业务数据)。In the application layer of the first terminal: call the sending interface, input the destination number, sub-number and data to be sent (ie, service data).
在第一中终端的可靠传输层(即数据传输层)中,可以填充可靠传输需要的信息,如报文序号、本地窗口大小、报文类型、缓存数据、发送次数设置等。In the reliable transmission layer (that is, the data transmission layer) of the first terminal, information required for reliable transmission can be filled in, such as message sequence number, local window size, message type, cached data, transmission number settings, etc.
在基础数据配置完成后,可以将配置好的数据发送至业务透传层(即数据发送层)。After the basic data configuration is completed, the configured data can be sent to the business transparent transmission layer (that is, the data transmission layer).
在业务透传层中,可以调用发送接口,通过业务透传协议发送业务数据至第二终端的业务透传层,同时第一终端的业务透传层可以在发送数据时,向第一终端中的可靠传输层发送消息,以在第一终端可靠传输层中,咳哟开启定时器、当可靠传输层监测到定时器超时时,则触发业务数据重传,在重传过程中,判断当前重传次数是否大于三次,当重传次数大于三次时,则通知应用程序本次业务数据发送失败,当重传次数小于三次,则可以继续进行重传,直到在预设时间内接收到第二终端的ACK。In the service transparent transmission layer, the sending interface can be called to send service data to the service transparent transmission layer of the second terminal through the service transparent transmission protocol. At the same time, the service transparent transmission layer of the first terminal can send data to the first terminal when sending data. The reliable transport layer of the first terminal sends a message to start the timer in the reliable transport layer of the first terminal. When the reliable transport layer detects that the timer has expired, it triggers the retransmission of the service data. During the retransmission process, it determines the current retransmission. Whether the number of retransmissions is greater than three times. When the number of retransmissions is greater than three times, the application is notified that the service data transmission failed this time. When the number of retransmissions is less than three times, retransmissions can continue until the second terminal is received within the preset time. ACK.
当业务数据从第一终端的业务透传层传输至第二终端的业务透传层时。则可以将接收的数据发送至可靠传输层进行处理。When service data is transmitted from the service transparent transmission layer of the first terminal to the service transparent transmission layer of the second terminal. Then the received data can be sent to the reliable transport layer for processing.
在第二终端的可靠传输层中,判断接收数据是否为响应报文,当接收数据为响应报文的情况下,停止可靠传输层的中定时器,并判断该响应报文是否正确,,当响应正确时,则即需判断是否有响应内容,在有响应内容时,提取用户数据,返回至第一终端的应用程序,当无响应内容时,则通知第一终端应用程序发送成功。In the reliable transport layer of the second terminal, it is judged whether the received data is a response message. When the received data is a response message, the timer of the reliable transport layer is stopped and it is judged whether the response message is correct. When the response is correct, it is necessary to determine whether there is response content. If there is response content, extract the user data and return it to the application program of the first terminal. When there is no response content, notify the first terminal application program that the transmission was successful.
在接收数据非响应报文的情况下,可以判断是否接收到所有报文,当接收到所有报文时,则可以重组所有报文,并将重组后的数据返回第二终端的应用程序;当未接收到所有报文时,则判断当前接收是否超时,在接收未超时情况下,继续执行接收数据,当接收超时情况下,则发送ack报文(包含丢失报文的序号)至第一终端的可靠传输层。In the case of receiving data non-response messages, it can be determined whether all messages have been received. When all messages are received, all messages can be reorganized and the reorganized data can be returned to the application program of the second terminal; when When not all messages are received, it is determined whether the current reception has timed out. If the reception has not timed out, continue to receive data. When the reception times out, an ack message (including the sequence number of the lost message) is sent to the first terminal. reliable transport layer.
在响应错误的情况下,可以判断当前业务数据的发送次数是否小于三次,如小于三次,则通知第一终端的应用程序发送失败,继续进行重传。如大于或等于三次,则停止重传。In the case of a response error, it can be determined whether the number of times the current service data has been sent is less than three times. If it is less than three times, the application program of the first terminal is notified of the sending failure and continues to retransmit. If it is greater than or equal to three times, retransmission will be stopped.
需要说明的是,对于方法实施例,为了简单描述,故将其表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。It should be noted that for the sake of simple description, the method embodiments are expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequence, because according to In this embodiment of the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of the present invention.
参照图7,示出了本发明一实施例提供的一种业务数据传输的装置的结构示意图,应用于第一终端,所述第一终端包括应用层、数据传输层以及数据发送层,具体可以包括如下模块:Referring to Figure 7, there is shown a schematic structural diagram of a service data transmission device provided by an embodiment of the present invention, which is applied to a first terminal. The first terminal includes an application layer, a data transmission layer and a data transmission layer. Specifically, Includes the following modules:
第一机制创建模块701,用于在所述数据传输层中创建与第二终端进行数据传输过程中的重传机制和/或响应机制;The first mechanism creation module 701 is used to create a retransmission mechanism and/or a response mechanism in the data transmission layer during data transmission with the second terminal;
第一业务数据传输模块702,用于在所述数据传输层接收到待传输至所述第二终端的业务数据后,基于所述数据传输层和所述数据发送层之间的数据交互,采用所述重传机制和/或响应机制,与所述第二终端进行所述业务数据的数据传输。The first service data transmission module 702 is configured to, after the data transmission layer receives the service data to be transmitted to the second terminal, based on the data interaction between the data transmission layer and the data sending layer, using The retransmission mechanism and/or response mechanism performs data transmission of the service data with the second terminal.
在本发明一实施例中,所述重传机制为超时重传机制,所述第一业务数据传输模块702可以包括:In an embodiment of the present invention, the retransmission mechanism is a timeout retransmission mechanism, and the first service data transmission module 702 may include:
定时期启动子模块,用于在所述数据发送层向所述第二终端发送业务数据时,启动所述数据传输层中的定时器进行计时;A timing period startup submodule, configured to start the timer in the data transmission layer for timing when the data transmission layer sends service data to the second terminal;
第一重传子模块,用于当所述定时器的计时数据大于或等于时间阈值时,所述数据传输层未检测到所述第一终端接收到所述第二终端针对所述业务数据反馈的响应数据时,采用所述数据传输层和所述数据发送层将所述业务数据重传至所述第二终端。A first retransmission submodule, configured to: when the timing data of the timer is greater than or equal to the time threshold, the data transmission layer does not detect that the first terminal receives the feedback of the service data from the second terminal When receiving the response data, the data transmission layer and the data sending layer are used to retransmit the service data to the second terminal.
在本发明一实施例中,所述重传机制为丢包重传机制,所述业务数据以一个或多个数据包的形式被发送至第二终端,每个数据包设置有报文序号,所述第一业务数据传输模块702可以包括:In an embodiment of the present invention, the retransmission mechanism is a packet loss retransmission mechanism, and the service data is sent to the second terminal in the form of one or more data packets, and each data packet is set with a message sequence number. The first service data transmission module 702 may include:
目标报文序号接收子模块,用于采用所述数据传输层接收所述第二终端发送的丢包的数据包对应的目标报文序号,所述数据传输层用于在所述业务数据传输过程中满足所述重传机制和/或响应机制的触发条件时,执行所述重传机制和/或响应机制;The target message sequence number receiving sub-module is used to use the data transmission layer to receive the target message sequence number corresponding to the lost data packet sent by the second terminal. The data transmission layer is used to receive the target message sequence number during the service data transmission process. When the triggering conditions of the retransmission mechanism and/or response mechanism are met, execute the retransmission mechanism and/or response mechanism;
第二重传子模块,用于采用所述数据发送层将所述目标报文序号对应的数据包重传至所述第二终端,所述数据发送层用于所述业务数据传输过程中,与所述第一终端的数据传输层和/或所述第二终端进行数据交互。The second retransmission submodule is used to retransmit the data packet corresponding to the target message sequence number to the second terminal using the data transmission layer, which is used in the service data transmission process, Perform data interaction with the data transmission layer of the first terminal and/or the second terminal.
在本发明一实施例中,所述第一业务数据传输模块702可以包括:In an embodiment of the present invention, the first service data transmission module 702 may include:
业务数据发送子模块,用于采用所述数据传输层和所述数据发送层发送所述业务数据至所述第二终端;A service data sending submodule, configured to send the service data to the second terminal using the data transmission layer and the data sending layer;
响应数据接收子模块,用于采用所述数据传输层接收所述第二终端针对所述业务数据返回的响应数据。A response data receiving submodule is configured to use the data transmission layer to receive response data returned by the second terminal for the service data.
参照图8,示出了本发明一实施例提供的一种业务数据传输的装置的结构示意图,应用于第二终端,所述第二终端包括应用层、数据传输层以及数据发送层,具体可以包括如下模块:Referring to Figure 8, there is shown a schematic structural diagram of a service data transmission device provided by an embodiment of the present invention, applied to a second terminal. The second terminal includes an application layer, a data transmission layer and a data sending layer. Specifically, Includes the following modules:
第一机制创建模块801,用于在所述数据传输层中创建与第一终端进行数据传输过程中的重传机制和/或响应机制;The first mechanism creation module 801 is used to create a retransmission mechanism and/or a response mechanism in the data transmission layer with the first terminal;
业务数据接收模块802,用于采用所述数据发送层接收所述第一终端发送至所述第二终端的业务数据;The service data receiving module 802 is configured to use the data sending layer to receive the service data sent by the first terminal to the second terminal;
第二业务数据传输模块803,用于基于所述数据传输层和所述数据发送层之间的数据交互,采用所述重传机制和/或响应机制,与所述第一终端进行所述业务数据的数据传输。The second service data transmission module 803 is configured to use the retransmission mechanism and/or response mechanism to perform the service with the first terminal based on the data interaction between the data transmission layer and the data sending layer. Data transfer of data.
在本发明一实施例中,所述重传机制为丢包重传机制,所述业务数据以一个或多个数据包的形式被发送至第二终端,每个数据包设置有报文序号,所述第二业务数据传输模块803:In an embodiment of the present invention, the retransmission mechanism is a packet loss retransmission mechanism, and the service data is sent to the second terminal in the form of one or more data packets, and each data packet is set with a message sequence number. The second service data transmission module 803:
丢包判断子模块,用于采用所述数据传输层,根据接收的数据包的报文序号,判断所述第一终端向所述第二终端发送数据包过程中是否存在丢包;A packet loss determination submodule, configured to use the data transmission layer to determine whether there is packet loss when the first terminal sends a data packet to the second terminal according to the message sequence number of the received data packet;
目标报文序号确定子模块,用于当所述数据传输层判定所述第一终端向所述第二终端发送数据包过程中存在丢包时,确定所述丢包的数据包对应目标报文序号;Target message sequence number determination submodule, used to determine the target message corresponding to the lost data packet when the data transmission layer determines that there is packet loss in the process of sending the data packet from the first terminal to the second terminal. serial number;
目标报文序号发送子模块,用于采用所述数据发送层将所述目标报文序号发送至所述第一终端,以使所述第一终端重传所述目标报文序号对应的数据包至所述第二终端。The target message sequence number sending submodule is used to use the data sending layer to send the target message sequence number to the first terminal, so that the first terminal retransmits the data packet corresponding to the target message sequence number. to the second terminal.
本发明一实施例还提供了一种电子设备,可以包括处理器、存储器及存储在存储器上并能够在处理器上运行的计算机程序,计算机程序被处理器执行时实现如上业务数据传输的方法。An embodiment of the present invention also provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the above method of transmitting business data is implemented.
本发明一实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储计算机程序,计算机程序被处理器执行时实现如上业务数据传输的方法。An embodiment of the present invention also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the above method for transmitting business data is implemented.
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on its differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other.
本领域内的技术人员应明白,本发明实施例可提供为方法、装置、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that embodiments of the present invention may be provided as methods, devices, or computer program products. Thus, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本发明实施例是参照根据本发明实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the invention are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine such that the instructions are executed by the processor of the computer or other programmable data processing terminal device. Means are generated for implementing the functions specified in the process or processes of the flowchart diagrams and/or the block or blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing terminal equipment to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the The instruction means implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, so that a series of operating steps are performed on the computer or other programmable terminal equipment to produce computer-implemented processing, thereby causing the computer or other programmable terminal equipment to perform a computer-implemented process. The instructions executed on provide steps for implementing the functions specified in a process or processes of the flow diagrams and/or a block or blocks of the block diagrams.
尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。Although preferred embodiments of the embodiments of the present invention have been described, those skilled in the art will be able to make additional changes and modifications to these embodiments once the basic inventive concepts are apparent. Therefore, it is intended that the appended claims be construed to include the preferred embodiments and all changes and modifications that fall within the scope of embodiments of the invention.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or any such actual relationship or sequence between operations. Furthermore, the terms "comprises," "comprises," or any other variation thereof are intended to cover a non-exclusive inclusion such that a process, method, article, or end device that includes a list of elements includes not only those elements, but also elements not expressly listed or other elements inherent to such process, method, article or terminal equipment. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or terminal device including the stated element.
以上对所提供的一种业务数据传输的方法及装置、电子设备、存储介质,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The above provides a detailed introduction to the method and device, electronic equipment, and storage medium for transmitting business data. This article uses specific examples to illustrate the principles and implementation modes of the present invention. The description of the above embodiments is only It is used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the field, there will be changes in the specific implementation and application scope according to the idea of the present invention. In summary, this The content of the description should not be construed as limiting the invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310952646.9A CN117040692A (en) | 2023-07-31 | 2023-07-31 | Method and device for transmitting service data, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310952646.9A CN117040692A (en) | 2023-07-31 | 2023-07-31 | Method and device for transmitting service data, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117040692A true CN117040692A (en) | 2023-11-10 |
Family
ID=88623723
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310952646.9A Pending CN117040692A (en) | 2023-07-31 | 2023-07-31 | Method and device for transmitting service data, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117040692A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117575482A (en) * | 2023-11-23 | 2024-02-20 | 广州方舟信息科技有限公司 | Drug data warehousing method, device, equipment and storage medium |
-
2023
- 2023-07-31 CN CN202310952646.9A patent/CN117040692A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117575482A (en) * | 2023-11-23 | 2024-02-20 | 广州方舟信息科技有限公司 | Drug data warehousing method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103138905B (en) | Acknowledgment method for RLC data packet transmission and RLC AM entity sender | |
TWI259674B (en) | Method and apparatus for reducing transmission errors in a third generation cellular system | |
CN1319303C (en) | Communication device, transmission control method and program product | |
AU644800B2 (en) | Data communication method and system | |
CN107979449B (en) | A data transmission method and device | |
CN101645766B (en) | Method, device and system for realizing data packet retransmission | |
CN103780363B (en) | Message transmitting device and method again | |
CN103973414B (en) | A kind of data transmission method and device | |
CN109981385B (en) | A method, device and system for realizing packet loss detection | |
CN103220091A (en) | Data transmission method and device | |
CN113765976A (en) | Communication method and system | |
CN106506124A (en) | Method and device for determining retransmission message | |
CN101174927A (en) | Feedback method for processing data receiving state and receiving and sending device | |
CN104348874B (en) | The method and apparatus that message is transmitted between cloud platform component | |
CN100505608C (en) | An adaptive congestion control method and system suitable for satellite networks | |
CN117040692A (en) | Method and device for transmitting service data, electronic equipment and storage medium | |
CN102804664B (en) | Communication system, communication device, communication method, and program | |
EP3939190A1 (en) | Method of enabling harq, network entity and computer program | |
CN101615990A (en) | A method, system and device for retransmitting data | |
CN108183767A (en) | A kind of method for reliable transmission suitable for space DTN networks | |
CN116249155B (en) | An information transmission method, device and user equipment | |
US7995517B2 (en) | System and method for transmitting units of messages in a mobile communication system | |
CN102404098B (en) | Transmission method and transmission device of link access procedure of D channel | |
CN104604174A (en) | Method for providing automatic repeat request error control based on relay terminal, related terminal and ARQ control center | |
WO2022056791A1 (en) | Packet retransmission method and apparatus |
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 |