Network acceleration method based on Android system and application thereof in POS machine
By dynamically adjusting the timeout retransmission time RTO of the TCP retransmission timer, adjusting the RTO value in real time according to the network conditions, and fixing the RTO to 1.5 seconds in a high-delay network, it solves the problem of poor performance of the existing TCP retransmission mechanism in high-bandwidth delay network and high packet loss rate environment, and improves the performance of TCP in complex network environments.
Patent Information
- Application Number
- CN202411915173.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-24
AI Technical Summary
The existing TCP retransmission mechanisms perform poorly in high bandwidth latency networks and high packet loss environments, and it is difficult to meet the higher requirements for TCP protocol performance, especially in terms of real-time, throughput and stability.
A network acceleration method based on Android system is proposed, by dynamically adjusting the timeout retransmission time RTO of the TCP retransmission timer, and adjusting the RTO value in real time according to the network conditions. When the RTO is less than the first threshold, use the formula RTOnew=α×RTT+β× packet loss rate+γ× congestion coefficient+δ to adjust; when the RTO is greater than or equal to the first threshold, it is fixed to 1.5 seconds.
This method improves the TCP retransmission time mechanism, reduces unnecessary retransmission delays, and improves the efficiency and reliability of data transmission, especially in environments with high latency networks and high packet loss rates.
Smart Images

Figure CN119728029A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer networks and data communications, and in particular to an Android-based network acceleration method and an application thereof in a POS machine. Background Art
[0002] TCP (Transmission Control Protocol) is a connection-oriented, reliable transport layer protocol that is widely used on the Internet and other network environments. Its main purpose is to ensure that data packets can be reliably delivered from the sender to the receiver, and to ensure data integrity even under poor network conditions. TCP's retransmission mechanism is a key component to achieve this goal, designed to ensure reliable data transmission by retransmitting lost or damaged data packets. Figure 1 As shown, in the existing TCP transmission process, the following measures are taken to ensure transmission quality and efficiency:
[0003] (1) Timeout retransmission technical measures:
[0004] Sequence number and acknowledgment: Each TCP data segment has a sequence number, which indicates the position of the first byte of the data segment in the entire data stream. The receiver will send an acknowledgment (ACK) to inform the sender of the maximum sequence number of the data segment that has been successfully received.
[0005] Retransmission timer: The sender starts a retransmission timer when sending each data segment. If no ACK is received from the receiver before the timer expires, the sender will assume that the data segment is lost or damaged and resend the data segment.
[0006] Timeout: The timeout (RTO, Retransmission Time-Out) is dynamically calculated based on the RTT (Round-Trip Time). TCP uses a method called Karn's algorithm to estimate the RTT and sets the RTO accordingly.
[0007] (2) Fast retransmission technical measures:
[0008] Duplicate ACK: If the receiver receives multiple out-of-order data segments in succession (i.e., there are missing data segments in the middle), it will send duplicate ACKs to inform the sender which data segments are missing.
[0009] Fast retransmit: If the sender receives three or more duplicate ACKs, it will immediately retransmit the lost data segment without waiting for the retransmission timer to expire. This mechanism is faster than timeout retransmission and improves transmission efficiency.
[0010] (3) Selective Acknowledgment (SACK) technical measures:
[0011] SACK option: allows the receiver to report to the sender the data blocks it has received, rather than just the last consecutive data segment. This way, the sender can know more precisely which data segments were lost and retransmit only those lost data segments, rather than the entire window of data.
[0012] Although the existing traditional TCP retransmission mechanism technology solves the congestion problem to a certain extent, it performs poorly in high-bandwidth delay networks (such as satellite links) and high packet loss rate environments. With the development of network technology, higher requirements are placed on the performance of the TCP protocol, especially in terms of real-time performance, throughput and stability. Summary of the invention
[0013] In view of this, the purpose of the present invention is to propose an Android system-based network acceleration method with reliable implementation, flexible application and high transmission efficiency and its application in a POS machine.
[0014] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0015] A network acceleration method based on Android system, based on TCP protocol transmission, comprising:
[0016] Initialize the retransmission timeout RTO of the retransmission timer and set it to a preset initial value;
[0017] By continuously measuring the round-trip time (RTT) of data transmission, the current network latency can be obtained;
[0018] By counting the ACKs, the current network packet loss rate can be estimated.
[0019] By monitoring the network congestion indication signal, the current congestion situation of the network can be obtained;
[0020] The timeout retransmission time RTO of the retransmission timer of the current data transmission is monitored. When the timeout retransmission time RTO is less than the first threshold, the dynamic adjustment formula is as follows:
[0021] RTO new =α×RTT+β×packet loss rate+γ×congestion coefficient+δ
[0022] Among them, RTO new is the adjusted timeout retransmission time, α, β, γ, and δ are preset adjustable parameters, RTT is the round-trip time currently measured, the packet loss rate is the network packet loss rate currently obtained by statistics, and the congestion coefficient is the current value obtained by monitoring the congestion indication signal of the network;
[0023] When the timeout retransmission time RTO is greater than or equal to the first threshold, it is fixed to a preset fixed value.
[0024] As a possible implementation mode, further, the present solution initializes the retransmission timeout RTO of the retransmission timer and sets it to 200 ms as a preset initial value.
[0025] As a possible implementation mode, further, this solution estimates the round-trip time RTT by using the Karn algorithm while continuously measuring the round-trip time RTT of data transmission to obtain the current network delay.
[0026] As a preferred implementation option, preferably, the first threshold value in this solution is 1.5s.
[0027] As a preferred implementation option, preferably, in this solution, when the timeout retransmission time RTO is greater than or equal to the first threshold, it is fixed to 1.5s as a preset fixed value.
[0028] This scheme aims to provide an improved TCP retransmission mechanism timeout algorithm, which can improve the performance of TCP in complex network environments, especially in high-bandwidth delay networks and high packet loss rate environments, by optimizing the retransmission mechanism and unilateral acceleration.
[0029] This solution proposes a new dynamic RTO adjustment algorithm that can adjust the RTO value in real time according to the network conditions. Specifically, when the network conditions are good, the RTO can be kept at a low level; in high-latency networks, the RTO is fixed to 1.5 seconds. This dynamic adjustment mechanism can better adapt to different network environments, ensuring efficient transmission in high-latency networks without affecting performance in low-latency networks.
[0030] Based on the above, this solution also provides a POS machine network optimization method based on the Android system, which applies the above-mentioned network acceleration method based on the Android system.
[0031] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art: the present invention introduces a fixed upper limit RTO adjustment strategy by improving the TCP retransmission time mechanism, so that the TCP retransmission message is retransmitted at a fixed interval of 1.5 seconds after more than 1.5 seconds. This improvement not only reduces unnecessary retransmission delays, but also improves the efficiency and reliability of data transmission, especially in high-latency networks and high packet loss rate network environments. By dynamically adjusting the RTO value, the present solution can better adapt to different network conditions and improve the overall performance of TCP. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 It is a schematic diagram of the RTO update process of the prior art;
[0034] Figure 2 This is a schematic diagram of the RTO update process of this solution;
[0035] Figure 3 This is a diagram of the network connection of the example mentioned in this solution. DETAILED DESCRIPTION
[0036] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0037] This embodiment provides a network acceleration method based on the Android system, based on TCP protocol transmission, which includes:
[0038] Initialize the retransmission timeout RTO (Retransmission Time-Out) of the retransmission timer and set it to a preset initial value;
[0039] By continuously measuring the round-trip time (RTT) of data transmission, the current network latency can be obtained;
[0040] By counting the ACKs, the current network packet loss rate can be estimated.
[0041] By monitoring the network's congestion indication signals (such as ECN, Explicit Congestion Notification), the current congestion situation of the network can be obtained;
[0042] Combination Figure 2 As shown, the timeout retransmission time RTO of the retransmission timer of the current data transmission is monitored. When the timeout retransmission time RTO is less than the first threshold, the dynamic adjustment formula is as follows:
[0043] RTO new =α×RTT+β×packet loss rate+γ×congestion coefficient+δ
[0044] Among them, RTO new is the adjusted timeout retransmission time, α, β, γ, and δ are preset adjustable parameters, RTT is the round-trip time currently measured, the packet loss rate is the network packet loss rate currently obtained by statistics, and the congestion coefficient is the current value obtained by monitoring the congestion indication signal of the network;
[0045] When the timeout retransmission time RTO is greater than or equal to the first threshold, it is fixed to a preset fixed value.
[0046] As a possible implementation mode, further, this solution is based on the Linux platform, which initializes the timeout retransmission time RTO of the retransmission timer and sets it to 200ms as a preset initial value.
[0047] As a possible implementation mode, further, this solution estimates the round-trip time RTT by using the Karn algorithm while continuously measuring the round-trip time RTT of data transmission to obtain the current network delay.
[0048] As a preferred implementation option, preferably, the first threshold of this solution is 1.5s. Preferably, when the timeout retransmission time RTO is greater than or equal to the first threshold, this solution fixes it to 1.5s as a preset fixed value.
[0049] The scheme includes the following aspects in starting and resetting the retransmission timer:
[0050] 1. Start the retransmission timer: The sender starts a retransmission timer when sending each data segment.
[0051] 2. Timeout retransmission: If no ACK is received within the RTO time, the sender will consider the data segment lost or damaged and resend the data segment.
[0052] 3. RTO reset: After each successful ACK is received, the retransmission timer will be reset to the initial RTO value.
[0053] Combination Figure 3 As shown, in order to further test the performance of this solution, the Brazilian CPQD laboratory certification was used to further test this solution, which includes the following:
[0054] Test environment
[0055] Delay configuration-5S
[0056] Packet loss configuration - port packet loss 60%
[0057] Configuration:
[0058] Configure ETH on PC-LINUX.
[0059] 1. Clear the existing configuration. Before configuring new rules, clear the existing tc rules to avoid conflicts.
[0060] sudo tc qdisc del dev eth0 root
[0061] 2. Add a root queue discipline for the specified network interface. Here, the htb (Hierarchical TokenBucket) queue scheduler is used:
[0062] sudo tc qdisc add dev eth0 root handle 1:htb default 30
[0063] 3. Create a classification rule for a specific port (such as 8080). Here, the u32 filter is used to match traffic on a specific port.
[0064] sudo tc class add dev eth0 parent 1:classid 1:1htb rate 100mbit
[0065] sudo tc class add dev eth0 parent 1:1classid 1:10htb rate 100mbit
[0066] sudo tc filter add dev eth0 protocol ip parent 1:prio 1u32 match ipdport 80800xffff flowid 1:10
[0067] 4. Add a 5 second delay to the matching traffic
[0068] sudo tc qdisc add dev eth0 parent 1:10handle 10:netem delay 5000ms
[0069] 5. Add 60% packet loss rate to the matching traffic
[0070] sudo tc qdisc change dev eth0 parent 10:handle 10:netem loss 60%
[0071] After testing, it was found that this solution was certified by the Brazilian CPQD laboratory. When tested in an environment with 60% packet loss and 5S delay in sending and receiving, the success rate of POS transactions increased from the original 76% to 95%.
[0072] This solution introduces a new mechanism that fixes the RTO to 1.5 seconds when it exceeds 1.5 seconds. This can avoid long waits caused by the continuous doubling of the RTO in high-latency networks. By fixing the maximum value of the RTO, this solution can significantly reduce retransmission delays in high-latency networks and improve data transmission efficiency and response speed.
[0073] Based on the above, this solution also provides a POS machine network optimization method based on the Android system, which applies the above-mentioned network acceleration method based on the Android system.
[0074] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A network acceleration method based on Android system, based on TCP protocol transmission, characterized in that: It includes: Initialize the retransmission timeout RTO of the retransmission timer and set it to a preset initial value; By continuously measuring the round-trip time (RTT) of data transmission, the current network latency can be obtained; By counting the ACKs, the current network packet loss rate can be estimated. By monitoring the network congestion indication signal, the current congestion situation of the network can be obtained; The timeout retransmission time RTO of the retransmission timer of the current data transmission is monitored. When the timeout retransmission time RTO is less than the first threshold, the dynamic adjustment formula is as follows: RTO new =α×RTT+β×packet loss rate+γ×congestion coefficient+δ Among them, RTO new is the adjusted timeout retransmission time, α, β, γ, and δ are preset adjustable parameters, RTT is the round-trip time currently measured, the packet loss rate is the network packet loss rate currently obtained by statistics, and the congestion coefficient is the current value obtained by monitoring the congestion indication signal of the network; When the timeout retransmission time RTO is greater than or equal to the first threshold, it is fixed to a preset fixed value.
2. A network acceleration method based on Android system as claimed in claim 1, characterized in that: Initialize the retransmission timeout RTO of the retransmission timer and set it to 200ms as a preset initial value.
3. A network acceleration method based on Android system as claimed in claim 1, characterized in that: By continuously measuring the round-trip time (RTT) of data transmission, the round-trip time (RTT) is estimated using the Karn algorithm to obtain the current network delay.
4. A network acceleration method based on an Android system as claimed in any one of claims 1 to 3, characterized in that: The first threshold is 1.5s.
5. A network acceleration method based on Android system as claimed in claim 4, characterized in that: When the timeout retransmission time RTO is greater than or equal to the first threshold, it is fixed to 1.5s as a preset fixed value.
6. A POS machine network optimization method based on Android system, characterized in that: The invention is applied with the network acceleration method based on Android system as claimed in any one of claims 1 to 5.
Citation Information
Patent Citations
Network congestion control method and device and storage medium
CN116684359A
Adaptive data transmission method and device of fusion transmission system
CN117156167A
RTO design optimization method and system for adaptive short-wave communication link
CN117856984A
Data retransmission method and apparatus, and device and storage medium
WO2023147772A1