Search

CN-115865671-B - Data packet auxiliary acceleration method, device, electronic equipment and computer readable medium

CN115865671BCN 115865671 BCN115865671 BCN 115865671BCN-115865671-B

Abstract

The disclosure relates to the field of data packet acceleration, and provides a data packet auxiliary acceleration method, a data packet auxiliary acceleration device, electronic equipment and a computer readable medium. The method comprises the steps of reading an accelerometer based on a preset reading interval to obtain an accelerometer value, determining target acceleration connection in response to the accelerometer value being larger than a preset threshold value, and carrying out acceleration forwarding on a data packet corresponding to the target acceleration connection. The method is based on soft acceleration, hard acceleration and Ethernet packet receiving interfaces provided by a factory gateway or a router SDK, develops a data packet auxiliary acceleration module, and helps the data packet which cannot be normally accelerated to realize acceleration forwarding through the auxiliary acceleration method when acceleration tables are full and acceleration cannot be normally accelerated during hardware acceleration and software acceleration.

Inventors

  • LI KE
  • XIAO DUANLIANG
  • WANG XIZHU
  • CHEN ZHENG
  • WANG ZHOUFENG

Assignees

  • 湖南亿联无限科技有限公司

Dates

Publication Date
20260508
Application Date
20221026

Claims (7)

  1. 1. A method for packet assisted acceleration, comprising: Reading an accelerometer based on a preset reading interval to obtain an accelerometer value, wherein the accelerometer comprises a hardware accelerometer and a software accelerometer; determining a target acceleration connection in response to the acceleration table value being greater than a preset threshold, i.e., when the acceleration table is full; Carrying out acceleration forwarding on the data packet corresponding to the target acceleration connection; The determining the target acceleration connection in response to the acceleration table value being greater than a preset threshold, i.e. when the acceleration table is full, includes: Reading a connection tracking table to obtain a connection tracking result in response to the acceleration table value being greater than a preset threshold value; determining candidate target acceleration connections based on the connection tracking results; Determining a target acceleration connection based on the candidate target acceleration connection; The determining a target acceleration connection based on the candidate target acceleration connection includes: matching the candidate target acceleration connection with the connection in the acceleration table to obtain a matching result; Responding to the matching result to represent matching failure, and writing the source IP, the source port, the destination IP and the destination port of the candidate target acceleration connection into an auxiliary acceleration file; initializing an auxiliary acceleration table based on the auxiliary acceleration file; registering an auxiliary acceleration function in an Ethernet driving packet receiving inlet, wherein the Ethernet driving packet receiving inlet refers to an original factory gateway, and the data packet auxiliary acceleration method is based on soft acceleration and hard acceleration provided by the original factory gateway or a router SDK and an Ethernet packet receiving interface, and is a developed data packet auxiliary acceleration module; judging whether the source IP, the source port, the destination IP and the destination port of the candidate target acceleration connection are in an auxiliary acceleration table or not based on the auxiliary acceleration function to obtain a judging result; Responding to the judging result to represent that the source IP, the source port, the destination IP and the destination port of the candidate target acceleration connection are in the auxiliary acceleration table, and determining the candidate target acceleration connection as a target acceleration connection; the step of forwarding the data packet corresponding to the target acceleration connection in an acceleration way comprises the following steps: modifying a data packet corresponding to the target acceleration connection based on the connection characteristic of the target acceleration connection; And calling a driving packet forwarding function to forward the data packet to finish acceleration.
  2. 2. The method of claim 1, wherein the step of reading the accelerometer based on the predetermined reading interval to obtain the accelerometer value comprises: and starting an accelerometer detection thread, and reading the accelerometer based on a preset reading interval.
  3. 3. The method of packet-assisted acceleration according to claim 1, wherein the determining a candidate target acceleration connection based on the connection tracking result comprises: And filtering the connection with the preset number of connection states of Established from the connection tracking result to serve as candidate target acceleration connection.
  4. 4. The method of claim 1, wherein modifying the data packets corresponding to the target acceleration connection based on the connection characteristics of the target acceleration connection comprises modifying a route, SNAT, SNAPT, DNAT, SNPT, DNPT, DNAPT.
  5. 5. A packet-assisted acceleration device, comprising: An accelerometer reading unit configured to read an accelerometer based on a preset reading interval, to obtain an accelerometer value, where the accelerometer includes a hardware accelerometer and a software accelerometer; A target acceleration connection determining unit configured to determine a target acceleration connection in response to the accelerometer value being greater than a preset threshold, i.e. when the accelerometer is full; The acceleration unit is used for carrying out acceleration forwarding on the data packet corresponding to the target acceleration connection; the target acceleration connection determining unit is further configured to: Reading a connection tracking table to obtain a connection tracking result in response to the acceleration table value being greater than a preset threshold value; determining candidate target acceleration connections based on the connection tracking results; Determining a target acceleration connection based on the candidate target acceleration connection; the target acceleration connection determining unit is further configured to: matching the candidate target acceleration connection with the connection in the acceleration table to obtain a matching result; Responding to the matching result to represent matching failure, and writing the source IP, the source port, the destination IP and the destination port of the candidate target acceleration connection into an auxiliary acceleration file; initializing an auxiliary acceleration table based on the auxiliary acceleration file; registering an auxiliary acceleration function in an Ethernet driving packet receiving inlet, wherein the Ethernet driving packet receiving inlet refers to an original factory gateway, and the data packet auxiliary acceleration method is based on soft acceleration and hard acceleration provided by the original factory gateway or a router SDK and an Ethernet packet receiving interface, and is a developed data packet auxiliary acceleration module; judging whether the source IP, the source port, the destination IP and the destination port of the candidate target acceleration connection are in an auxiliary acceleration table or not based on the auxiliary acceleration function to obtain a judging result; Responding to the judging result to represent that the source IP, the source port, the destination IP and the destination port of the candidate target acceleration connection are in the auxiliary acceleration table, and determining the candidate target acceleration connection as a target acceleration connection; The acceleration unit is further configured to: modifying a data packet corresponding to the target acceleration connection based on the connection characteristic of the target acceleration connection; And calling a driving packet forwarding function to forward the data packet to finish acceleration.
  6. 6. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 4 when the computer program is executed.
  7. 7. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 4.

Description

Data packet auxiliary acceleration method, device, electronic equipment and computer readable medium Technical Field The present disclosure relates to the field of data packet acceleration, and in particular, to a data packet auxiliary acceleration method, apparatus, electronic device, and computer readable medium. Background At present, most gateways support hardware acceleration and software acceleration, and carry out hardware acceleration on synchronous TCP/UDP/broadcast messages, so that protocol stacks and CPU (Central processing Unit) are skipped to process the messages, thereby reducing network delay and increasing throughput. However, the current hard acceleration and soft acceleration also have bottlenecks, the hard acceleration and soft acceleration tables are full, and after the acceleration tables are full, the network connection added subsequently cannot be forwarded in an acceleration way, so that the delay and throughput of the network behind are slow. Disclosure of Invention Object of the invention In view of the above problems, in order to solve the problem that software acceleration and hardware acceleration cannot be normally accelerated when an acceleration table is full, the present disclosure provides the following technical solutions. (II) technical scheme In a first aspect of an embodiment of the present disclosure, a method for packet-assisted acceleration is provided, including: reading an accelerometer based on a preset reading interval to obtain an accelerometer value; determining a target acceleration connection in response to the acceleration table value being greater than a preset threshold; and carrying out acceleration forwarding on the data packet corresponding to the target acceleration connection. In one possible implementation manner, the reading the accelerometer based on the preset reading interval to obtain the accelerometer value includes: And starting an accelerometer detection thread, and reading the accelerometer based on a preset reading interval, wherein the accelerometer comprises a software accelerometer and a hardware accelerometer. In one possible implementation manner, the determining the target acceleration connection in response to the accelerometer value being greater than a preset threshold value includes: Reading a connection tracking table to obtain a connection tracking result in response to the acceleration table value being greater than a preset threshold value; determining candidate target acceleration connection based on the connection tracking result; And determining the target acceleration connection based on the candidate target acceleration connection. In one possible embodiment, the determining the candidate target acceleration connection based on the connection tracking result includes: and filtering the connection with the preset number of connection states of Established from the connection tracking result to serve as candidate target acceleration connection. In one possible embodiment, the determining the target acceleration connection based on the candidate target acceleration connection includes: matching the candidate target acceleration connection with the connection in the acceleration table to obtain a matching result; responding to the matching result to represent matching failure, and writing the source IP, the source port, the destination IP and the destination port of the candidate target acceleration connection into an auxiliary acceleration file; Initializing an auxiliary acceleration table based on the auxiliary acceleration file; Registering an auxiliary acceleration function in an Ethernet-driven packet receiving inlet; judging whether the source IP, the source port, the destination IP and the destination port of the candidate target acceleration connection are in an auxiliary acceleration table or not based on the auxiliary acceleration function to obtain a judging result; And responding to the judging result to represent that the source IP, the source port, the destination IP and the destination port of the candidate target acceleration connection are in the auxiliary acceleration table, and determining the candidate target acceleration connection as the target acceleration connection. In one possible implementation manner, the forwarding acceleration of the data packet corresponding to the target acceleration connection includes: Modifying a data packet corresponding to the target acceleration connection based on the connection characteristic of the target acceleration connection; and calling a driving packet forwarding function to forward the data packet to finish acceleration. In one possible implementation, the modifying operation adopted by the modifying the data packet corresponding to the target acceleration connection based on the connection characteristic of the target acceleration connection includes a route modification, SNAT modification, SNAPT modification, DNAT modification, SNPT modification, DNPT modific