Android-based network acceleration method and application thereof in POS machine
By dynamically adjusting the TCP retransmission timer's timeout (RTO), the TCP retransmission mechanism is optimized, solving the data transmission problem under high bandwidth latency and high packet loss environments, and improving the transaction success rate and data transmission efficiency of POS machines.
Patent Information
- Application Number
- CN202411915173.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-12-24
AI Technical Summary
Existing TCP retransmission mechanisms perform poorly in high-bandwidth, high-latency networks and high-packet-loss environments, making it difficult to guarantee the real-time performance and stability of data transmission.
By dynamically adjusting the TCP retransmission timeout (RTO) and combining it with round-trip time (RTT), packet loss rate, and congestion coefficient, the retransmission mechanism is optimized. In particular, in high-latency networks, the RTO is fixed at 1.5 seconds to reduce unnecessary retransmission delays.
It improves the data transmission efficiency and reliability of TCP in complex network environments, and significantly enhances the transaction success rate of POS machines, especially in environments with high latency and high packet loss.
Smart Images

Figure CN119728029B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer networks and data communication technology, and in particular to a network acceleration method based on the Android system and its application in POS machines. Background Technology
[0002] TCP (Transmission Control Protocol) is a connection-oriented, reliable transport layer protocol widely used in the Internet and other network environments. Its primary purpose is to ensure that data packets are reliably delivered from sender to receiver, guaranteeing data integrity even under poor network conditions. TCP's retransmission mechanism is a key component in achieving this goal, designed to ensure reliable data transmission by retransmitting lost or corrupted data packets. Figure 1 As shown, the existing TCP transmission process employs the following measures to ensure transmission quality and efficiency:
[0003] (1) Timeout retransmission technical measures:
[0004] • Sequence Number and Acknowledgment: Each TCP segment has a sequence number, indicating the position of the first byte of that segment within the entire data stream. The receiver sends an acknowledgment (ACK) to inform the sender of the maximum sequence number of the 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 assumes that the data segment is lost or corrupted and retransmits it.
[0006] • Timeout: The timeout (RTO, Retransmission Time-Out) is dynamically calculated based on the RTT (Round-Trip Time). TCP uses a method called the Karn algorithm to estimate the RTT and set the RTO accordingly.
[0007] (2) Fast retransmission technology 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 were lost.
[0009] • Fast retransmission: 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, not just the last consecutive data segment. This allows the sender to know more precisely which data segments were lost and to retransmit only those lost segments, rather than the entire window of data.
[0012] While existing traditional TCP retransmission mechanisms have addressed congestion issues to some extent, they perform poorly in high-bandwidth, high-latency networks (such as satellite links) and high packet loss environments. With the advancement of network technology, higher demands are being placed on the performance of the TCP protocol, particularly in terms of real-time performance, throughput, and stability. Summary of the Invention
[0013] In view of this, the purpose of this invention is to propose a reliable, flexible, and efficient network acceleration method based on the Android system and its application in POS machines.
[0014] To achieve the above-mentioned technical objectives, the technical solution adopted by this invention is as follows:
[0015] A network acceleration method based on the Android system, using TCP protocol transmission, includes:
[0016] Initialize the retransmission timer's timeout retransmission time RTO and set it to the preset initial value;
[0017] The current network latency is determined by continuously measuring the round-trip time (RTT) of data transmission.
[0018] The packet loss rate of the current network is estimated by statistically analyzing the ACK responses.
[0019] The current network congestion status can be obtained by monitoring network congestion indication signals;
[0020] The retransmission timeout (RTO) of the retransmission timer for the current data transmission is monitored. When the RTO is less than a first threshold, its dynamic adjustment formula is as follows:
[0021] RTO new = α×RTT + β×packet loss rate + γ×congestion coefficient + δ
[0022] Among them, RTO new The adjusted timeout retransmission time is α, β, γ, and δ, which are preset adjustable parameters. RTT is the round-trip time currently measured. The packet loss rate is the network packet loss rate currently obtained from statistics. The congestion coefficient is the current value obtained from the congestion indication signal of the monitored 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, this scheme further initializes the retransmission timer's timeout retransmission time RTO, setting it to 200ms as a preset initial value.
[0025] As a possible implementation, this scheme further estimates the round-trip time (RTT) of data transmission using the Karn algorithm while continuously measuring the RTT, in order to obtain the current network latency.
[0026] As a preferred implementation option, the first threshold of this scheme is preferably 1.5s.
[0027] As a preferred implementation option, this scheme fixes the timeout retransmission time (RTO) to 1.5s as a preset fixed value when the timeout retransmission time (RTO) is greater than or equal to the first threshold.
[0028] This solution aims to provide an improved TCP retransmission timeout algorithm. By optimizing the retransmission mechanism and accelerating one side, it enhances TCP performance in complex network environments, especially in high-bandwidth, high-latency networks and high-packet-loss environments.
[0029] This solution proposes a novel dynamic RTO adjustment algorithm that can adjust the RTO value in real time based on network conditions. Specifically, when network conditions are good, the RTO can be maintained at a low level; while in high-latency networks, the RTO is fixed at 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 aforementioned 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 improves the TCP retransmission time mechanism by introducing a fixed upper limit RTO adjustment strategy, so that TCP retransmission packets are retransmitted at fixed intervals of 1.5 seconds after a delay of 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 and high-packet-loss network environments. This solution, by dynamically adjusting the RTO value, can better adapt to different network conditions and improve the overall performance of TCP. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a schematic diagram of the existing RTO update process;
[0034] Figure 2 This is a schematic diagram of the RTO update process for this solution;
[0035] Figure 3 This is a network connection diagram of the example mentioned in this solution. Detailed Implementation
[0036] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0037] This embodiment provides a network acceleration method based on the Android system, using TCP protocol transmission, which includes:
[0038] Initialize the retransmission timeout (RTO) of the retransmission timer and set it to the preset initial value;
[0039] The current network latency is determined by continuously measuring the round-trip time (RTT) of data transmission.
[0040] The packet loss rate of the current network is estimated by statistically analyzing the ACK responses.
[0041] The current network congestion status can be obtained by monitoring network congestion indication signals (such as ECN, Explicit Congestion Notification);
[0042] Combination Figure 2 As shown, the timeout retransmission time (RTO) of the retransmission timer for the current data transmission is monitored. When the timeout retransmission time (RTO) is less than the first threshold, its dynamic adjustment formula is as follows:
[0043] RTO new = α×RTT + β×packet loss rate + γ×congestion coefficient + δ
[0044] Among them, RTO new The adjusted timeout retransmission time is α, β, γ, and δ, which are preset adjustable parameters. RTT is the round-trip time currently measured. The packet loss rate is the network packet loss rate currently obtained from statistics. The congestion coefficient is the current value obtained from the congestion indication signal of the monitored 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, this solution is based on the Linux platform, and the timeout retransmission time (RTO) of the initial retransmission timer is set to 200ms as a preset initial value.
[0047] As a possible implementation, this scheme further estimates the round-trip time (RTT) of data transmission using the Karn algorithm while continuously measuring the RTT, in order to obtain the current network latency.
[0048] As a preferred implementation option, the first threshold in this scheme is preferably 1.5s. Preferably, when the timeout retransmission time (RTO) is greater than or equal to the first threshold, this scheme fixes it at 1.5s as a preset fixed value.
[0049] Regarding the starting and resetting of the retransmission timer, this solution includes the following:
[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 assume that the data segment is lost or corrupted and will retransmit the data segment.
[0052] 3. RTO Reset: After each successful ACK reception, 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, further testing was conducted using the CPQD laboratory certification in Brazil, including the following:
[0054] Test environment
[0055] Delay configuration - 5S
[0056] Packet loss configuration - port transmit / receive packet loss 60%
[0057] Configuration:
[0058] Configure ETH on PC-LINUX.
[0059] 1. Clear existing configurations. Before configuring new rules, clear existing TC rules to avoid conflicts.
[0060] sudo tc qdisc del dev eth0 root
[0061] 2. Add a root queue rule for the specified network interface, using the HTB (Hierarchical TokenBucket) queue scheduler:
[0062] sudo tc qdisc add dev eth0 root handle 1:htb default 30
[0063] 3. Create a classification rule for a specific port (e.g., 8080). Here, a U32 filter is used to match traffic to 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 matched traffic.
[0068] sudo tc qdisc add dev eth0 parent 1:10handle 10:netem delay 5000ms
[0069] 5. Add a 60% packet loss rate to the matched traffic.
[0070] sudo tc qdisc change dev eth0 parent 10:handle 10:netem loss 60%
[0071] Tests have shown that, in an environment with 60% packet loss and a 5-second delay, the success rate of POS transactions increased from 76% to 95% in the CPQD laboratory certification in Brazil.
[0072] This solution introduces a novel mechanism that fixes the RTO to 1.5 seconds when it exceeds 1.5 seconds. This avoids the long waiting times caused by the RTO constantly doubling in high-latency networks. By fixing the maximum RTO value, this solution can significantly reduce retransmission latency in high-latency networks, improving 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 aforementioned network acceleration method based on the Android system.
[0074] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A network acceleration method based on the Android system, using TCP protocol transmission, characterized in that, It includes: Initialize the retransmission timer's timeout retransmission time RTO and set it to the preset initial value; The current network latency is determined by continuously measuring the round-trip time (RTT) of data transmission. The packet loss rate of the current network is estimated by statistically analyzing the ACK responses. The current network congestion status can be obtained by monitoring network congestion indication signals; The retransmission timeout (RTO) of the retransmission timer for the current data transmission is monitored. When the RTO is less than a first threshold, its dynamic adjustment formula is as follows: RTO new = α×RTT + β×packet loss rate + γ×congestion coefficient + δ Among them, RTO new The adjusted timeout retransmission time is α, β, γ, and δ, which are preset adjustable parameters. RTT is the round-trip time currently measured. The packet loss rate is the network packet loss rate currently obtained from statistics. The congestion coefficient is the current value obtained from the congestion indication signal of the monitored 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. The network acceleration method based on the Android system as described in claim 1, characterized in that, Initialize the retransmission timer's timeout retransmission timer RTO, setting it to 200ms as the preset initial value.
3. The network acceleration method based on the Android system as described in claim 1, characterized in that, By continuously measuring the round-trip time (RTT) of data transmission, the Karn algorithm is used to estimate the RTT in order to obtain the current network latency.
4. A network acceleration method based on the Android system as described in any one of claims 1 to 3, characterized in that, The first threshold is 1.5s.
5. The network acceleration method based on the Android system as described in claim 4, characterized in that, When the timeout retransmission time (RTO) is greater than or equal to the first threshold, it is fixed at 1.5s as a preset fixed value.
6. A POS machine network optimization method based on the Android system, characterized in that, Its application includes the network acceleration method based on the Android system as described 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