CN112583935B - Buffer window adjusting method, gateway device and storage medium - Google Patents

Buffer window adjusting method, gateway device and storage medium Download PDF

Info

Publication number
CN112583935B
CN112583935B CN202011588275.3A CN202011588275A CN112583935B CN 112583935 B CN112583935 B CN 112583935B CN 202011588275 A CN202011588275 A CN 202011588275A CN 112583935 B CN112583935 B CN 112583935B
Authority
CN
China
Prior art keywords
buffer area
space
buffer
sending
information
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.)
Active
Application number
CN202011588275.3A
Other languages
Chinese (zh)
Other versions
CN112583935A (en
Inventor
李林林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202011588275.3A priority Critical patent/CN112583935B/en
Publication of CN112583935A publication Critical patent/CN112583935A/en
Application granted granted Critical
Publication of CN112583935B publication Critical patent/CN112583935B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures

Abstract

The invention belongs to the technical field of communication networks and discloses a buffer window adjusting method, gateway equipment and a storage medium. The method is applied to gateway equipment, and the gateway equipment comprises a receiving buffer area and a sending buffer area, wherein the receiving buffer area is used for caching data sent by a sending end, and the sending buffer area is used for caching the data sent to a receiving end; the method comprises the following steps: acquiring spatial variation information of a sending buffer area; and adjusting the space of the receiving buffer area according to the space change information so as to enable the storage space change trend of the receiving buffer area to be consistent with the storage space change trend of the sending buffer area. Through the mode, the size of the free space of the receiving buffer area is adjusted according to the space change information of the sending buffer area, the receiving buffer area is prevented from continuously receiving data which is possibly lost, the data transmission at two ends of the gateway equipment is kept balanced, the problem that a large amount of data is cached on the gateway equipment is solved, and the possibility of data loss is reduced.

Description

Buffer window adjusting method, gateway device and storage medium
Technical Field
The present invention relates to the field of communications network technologies, and in particular, to a buffer window adjustment method, a gateway device, and a storage medium.
Background
When a gateway device (e.g., a load balancing device) is connected to a client and a server, a large amount of data is often cached on the gateway device due to inconsistent transmission speeds of the connection networks, which not only reduces the performance of the gateway device, but also increases the possibility of data loss due to a failure of the gateway device.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a buffer window adjusting method, gateway equipment and a storage medium, and aims to solve the technical problem of how to prevent a large amount of data from being cached in the gateway equipment.
In order to achieve the above object, the present invention provides a buffer window adjusting method, which is applied to a gateway device, where the gateway device includes a receiving buffer and a sending buffer, where the receiving buffer is used to cache data sent by a sending end, and the sending buffer is used to cache data sent to a receiving end;
the buffer window adjusting method comprises the following steps:
acquiring the space change information of the sending buffer area;
and adjusting the space of the receiving buffer area according to the space change information so as to enable the storage space change trend of the receiving buffer area to be consistent with the storage space change trend of the sending buffer area.
Optionally, before the obtaining the spatial variation information of the sending buffer, the buffer window adjusting method further includes:
taking out data information to be sent from the receiving buffer area;
processing the data information to be sent to obtain target data information;
storing the target data information to a sending buffer area;
correspondingly, the obtaining the spatial variation information of the sending buffer includes:
acquiring first space change information of the sending buffer area;
the adjusting the space of the receiving buffer according to the space variation information includes:
and adjusting the size of the free space of the receiving buffer area according to the first space change information.
Optionally, after the adjusting the size of the free space of the receiving buffer according to the first space variation information, the method further includes:
sending the target data information to the receiving end;
when the successful data transmission information is received, the target data information in the sending buffer area is cleared;
acquiring second space change information of the sending buffer area;
and adjusting the size of the free space of the receiving buffer area according to the second space change information.
Optionally, the number of the sending buffers is N, where N is an integer greater than or equal to 2;
correspondingly, the obtaining the first spatial variation information of the sending buffer includes:
acquiring spatial variation information of each sending buffer area;
and calculating total space change information according to the space change information of each sending buffer area, and taking the total space change information as first space change information.
Optionally, the obtaining the second spatial variation information of the sending buffer includes:
acquiring spatial variation information of each sending buffer area;
and calculating total space change information according to the space change information of each sending buffer area, and taking the total space change information as second space change information.
Optionally, the number of the receiving buffers is N, where N is an integer greater than or equal to 2;
correspondingly, the retrieving data information to be sent from the receiving buffer includes:
taking data information to be sent out of an ith receiving buffer area, wherein i is more than or equal to 1 and less than or equal to N;
the adjusting the size of the free space of the receiving buffer area according to the first space change information includes:
and adjusting the size of the free space of the ith receiving buffer area according to the first space change information.
Optionally, the adjusting the size of the free space of the receiving buffer according to the second space variation information includes:
determining a receiving buffer area from which the successfully transmitted data comes according to the second space change information so as to determine the receiving buffer area to be adjusted and adjust the size of the space;
and adjusting the space size of the receiving buffer area according to the determined receiving buffer area to be adjusted and the adjustment space size.
Optionally, the sending the target data information to the receiving end includes:
and when receiving the indication information of successful adjustment of the receiving buffer, sending the target data information to a receiving end.
In addition, to achieve the above object, the present invention further provides a gateway device, including: a memory, a processor and a buffer window adjustment program stored on the memory and executable on the processor, the buffer window adjustment program configured to implement the steps of the buffer window adjustment method as described above.
Furthermore, to achieve the above object, the present invention further provides a storage medium, on which a buffer window adjusting program is stored, and the buffer window adjusting program, when executed by a processor, implements the steps of the buffer window adjusting method as described above.
The method for adjusting the buffer window is applied to gateway equipment, and the gateway equipment comprises a receiving buffer area and a sending buffer area, wherein the receiving buffer area is used for caching data sent by a sending end, and the sending buffer area is used for caching the data sent to a receiving end; the method comprises the following steps: acquiring space change information of a sending buffer area; and adjusting the space of the receiving buffer area according to the space change information so as to enable the storage space change trend of the receiving buffer area to be consistent with the storage space change trend of the sending buffer area. Through the mode, the size of the free space of the receiving buffer area is adjusted according to the space change information of the sending buffer area, so that the data transmission at two ends of the gateway equipment is kept balanced, the problem that the data are cached on the gateway equipment in a large quantity is solved, the performance of the gateway equipment is improved, and the possibility of data loss is reduced.
Drawings
Fig. 1 is a schematic structural diagram of a gateway device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a buffer window adjustment method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a buffer window adjustment method according to the present invention;
FIG. 4 is a first diagram illustrating a request flow of a buffer window adjustment method according to an embodiment of the present invention;
FIG. 5 is a first diagram illustrating a response flow of an embodiment of a buffer window adjustment method according to the present invention;
FIG. 6 is a flowchart illustrating a buffer window adjustment method according to a third embodiment of the present invention;
FIG. 7 is a diagram illustrating a scene structure according to an embodiment of a buffer window adjustment method of the present invention;
FIG. 8 is a second diagram illustrating a request flow of a buffer window adjustment method according to an embodiment of the present invention;
FIG. 9 is a flowchart illustrating a buffer window adjustment method according to a fourth embodiment of the present invention;
fig. 10 is a second schematic diagram of a response flow of an embodiment of a buffer window adjustment method according to the invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a gateway device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the gateway apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001 described previously.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the gateway device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a buffer window adjusting program.
In the gateway apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the gateway device of the present invention may be disposed in the gateway device, and the gateway device calls the buffer window adjustment program stored in the memory 1005 through the processor 1001 and executes the buffer window adjustment method provided in the embodiment of the present invention.
Referring to fig. 2, fig. 2 is a schematic flowchart of a first embodiment of a buffer window adjustment method according to the present invention.
In this embodiment, the buffer window adjustment method is applied to a gateway device, where the gateway device includes a receiving buffer and a sending buffer, where the receiving buffer is used to cache data sent by a sending end, and the sending buffer is used to cache data sent to a receiving end;
the buffer window adjusting method comprises the following steps:
step S10: and acquiring the space change information of the sending buffer area.
The main execution body of this embodiment is a gateway device, which may be a load balancing device, a router, or another gateway network communication device, and this embodiment takes the load balancing device as an example for description. The load balancing device is provided with a TCP server, an agent and a TCP client, wherein the TCP server is in communication connection with the client, and the TCP client is in communication connection with the server. The sending end can be a client or a server; accordingly, the receiving end may be a server or a client.
It should be noted that the transmission buffer refers to a fixed size space in the tcp connection for storing data to be transmitted. Data sent by an application layer is firstly put into a sending buffer area, and the idle space of the sending buffer area is reduced at the moment; when the data is confirmed to be sent to the opposite terminal, the corresponding data is deleted in the sending buffer area, and the space of the sending buffer area is increased at the moment. If the transmission buffer free space is reduced to zero, the data transmitted by the application layer can not be accommodated any more.
It will be appreciated that TCP will ensure that each data item is sent to the other connection, and that after the data item has been sent, an acknowledgement message must be received from the other connection, and if the data item is not received later, the data item will be retransmitted over time until an acknowledgement message is received from the other connection. Therefore, after the TCP sends out the data, the data is not immediately deleted from the memory, and the data is needed to be retransmitted. TCP provides a mechanism for a sender to control the amount of data sent, i.e., the sliding window, based on the actual reception capabilities of the receiver. The receiving side can calculate how many bytes of data can be received subsequently according to its receiving buffer, that is, a receiving window, and the receiving side can put the currently receivable size in a window field in the TCP message header, so that the window size notification can be performed.
In specific implementation, the load balancing device obtains the spatial variation information of the sending buffer area through a window field in a TCP message header, and is suitable for a scenario in which a client sends a request message to a server, a scenario in which the server sends a response message to the client, and other data transmission processes. Explaining by taking an example that a client sends request information to a server, when the request information is stored in a sending buffer corresponding to a TCP client, the space of the sending buffer corresponding to the TCP client changes, when the request information is successfully transmitted to the server, corresponding data in the sending buffer corresponding to the TCP client is deleted, and at the moment, the space of the sending buffer corresponding to the TCP client also changes; for the explanation, the server sends the response information to the client as an example, when the response information is stored in the sending buffer corresponding to the TCP server, the space of the sending buffer corresponding to the TCP server changes, and when the response information is successfully transmitted to the client, the corresponding data in the sending buffer corresponding to the TCP server is deleted, and at this time, the space of the sending buffer corresponding to the TCP server also changes.
Step S20: and adjusting the space of the receiving buffer area according to the space change information so as to enable the storage space change trend of the receiving buffer area to be consistent with the storage space change trend of the sending buffer area.
It should be noted that the receiving buffer refers to a fixed size space in the tcp connection for storing the received data. Data received through a network can be firstly put into a receiving buffer area, and the idle space of the receiving buffer area is reduced at the moment; after the application layer program is read, the corresponding data in the receiving buffer area is deleted, and at the moment, the free space of the receiving buffer area is increased. If the free space of the receiving buffer is zero, no more data can be received from the network.
It can be understood that, the load balancing device determines the space change information of the sending buffer area according to the window field in the TCP message header, adjusts the space of the receiving buffer area according to the space change information, and takes the example of sending the request information from the client to the server as an illustration, when the request information is stored in the sending buffer area corresponding to the TCP client, the space of the sending buffer area corresponding to the TCP client decreases, at this time, the space decrease is fed back through the sliding window, and the load balancing device decreases the free space of the receiving buffer area corresponding to the TCP server according to the decrease; when the request information is successfully transmitted to the server, deleting corresponding data in a sending buffer zone corresponding to the TCP client, wherein the space of the sending buffer zone corresponding to the TCP client is increased, and the load balancing equipment increases the free space of a receiving buffer zone corresponding to the TCP server according to the increase amount; when the TCP server feeds back the idle size of the receiving buffer area to the client, the excessive data can be prevented from being transmitted to the load balancing equipment by the client.
Explaining by taking the example that the server sends response information to the client as an example, when the server sends the response information to the client, and when the response information is stored in a sending buffer corresponding to a TCP server, the space of the sending buffer corresponding to the TCP server is reduced, at the moment, the space reduction is fed back through a sliding window, and the load balancing equipment reduces the idle space of a receiving buffer corresponding to the TCP client according to the reduction; when the response information is successfully transmitted to the client, deleting corresponding data in the sending buffer zone corresponding to the TCP server, wherein at the moment, the space of the sending buffer zone corresponding to the TCP server is increased, and the load balancing equipment increases the free space of the receiving buffer zone corresponding to the TCP client according to the increase; when the TCP client feeds back the free size of the receiving buffer area to the server, the excessive data can be prevented from being transmitted to the load balancing equipment by the server.
The method for adjusting the window of the buffer area in the embodiment is applied to gateway equipment, and the gateway equipment comprises a receiving buffer area and a sending buffer area, wherein the receiving buffer area is used for caching data sent by a sending end, and the sending buffer area is used for caching data sent to a receiving end; the method comprises the following steps: acquiring spatial variation information of a sending buffer area; and adjusting the space of the receiving buffer area according to the space change information so as to enable the storage space change trend of the receiving buffer area to be consistent with the storage space change trend of the sending buffer area. Through the mode, the size of the free space of the receiving buffer area is adjusted according to the space change information of the sending buffer area, so that the data transmission at two ends of the gateway equipment is kept balanced, the problem that the data are cached on the gateway equipment in a large quantity is solved, the performance of the gateway equipment is improved, and the possibility of data loss is reduced.
Referring to fig. 3, fig. 3 is a flowchart illustrating a buffer window adjusting method according to a second embodiment of the present invention.
Based on the first embodiment, before the step S10, the method for adjusting a buffer window in this embodiment further includes:
step S101: and taking out the data information to be sent from the receiving buffer area.
In a specific implementation, the method for receiving data information to be sent through a receiving buffer connected to a sending end further includes, before step S101: receiving data information sent by a sending end; and storing the data information as data information to be sent to a receiving buffer area.
Step S102: and processing the data information to be sent to obtain target data information.
It should be noted that, the process of processing the data information to be sent may include encapsulating and internally forwarding the data information to be sent. The client sends request information to the server as an example to explain, the data information to be sent is forwarded, so that the data is forwarded from the TCP server to the TCP client through the proxy, and the TCP server deletes the data information to be sent in the corresponding receiving buffer after receiving the forwarding success message fed back by the TCP client. Taking the example that the server sends the response information to the client as an example to explain, the data information to be sent is forwarded and processed, so that the data is forwarded from the TCP client to the TCP server through the proxy, and after receiving the forwarding success message fed back by the TCP server, the TCP client deletes the data information to be sent in the corresponding receiving buffer.
Step S103: and storing the target data information to a sending buffer area.
It is understood that the target data information is stored in the transmission buffer to transmit the corresponding data information to the receiving end through the tcp connection relation connected to the receiving end.
Accordingly, the step S10 includes:
step S104: and acquiring first space change information of the sending buffer area.
It should be noted that the first space variation information may include free space reduction amount information.
Correspondingly, the adjusting the space of the receiving buffer according to the space variation information includes:
step S201: and adjusting the size of the free space of the receiving buffer area according to the first space change information.
It can be understood that, the size of the free space of the receiving buffer is adjusted according to the amount of the free space of the sending buffer, so that the free size of the receiving buffer is reduced, and the continuous transmission of excessive data is avoided.
Correspondingly, after the adjusting the space of the receiving buffer according to the space variation information, the method further includes:
step S202: and sending the target data information to the receiving end.
Specifically, in order to keep the transmission rates at both ends of the gateway device consistent and avoid data accumulation, step S202 includes: and when receiving the indication information of successful adjustment of the receiving buffer area, sending the target data information to a receiving end.
It can be understood that the load balancing device internally transmits the indication information of the successful adjustment of the receiving buffer according to the window information.
Step S203: and when the data transmission success information is received, clearing the target data information in the sending buffer area.
Step S204: and acquiring second space change information of the sending buffer area.
It should be noted that, when the data transmission corresponding to the sending buffer is successful, because the target data information is cleared, the free space of the sending buffer becomes larger, and the second space change information may include information of the amount of increase of the free space. The first space change information and the second space change information are used for distinguishing from each other, and when the data transmission process is different, the space change information is different due to different data processing modes, for example, when related caches in the sending buffer are cleared, the free space corresponding to the sending buffer is increased, and when the target data information is stored in the sending buffer, the free space corresponding to the sending buffer is decreased.
Step S205: and adjusting the size of the free space of the receiving buffer area according to the second space change information.
It can be understood that, the size of the free space of the receiving buffer is adjusted according to the amount of increase of the free space of the sending buffer, so that the free size of the receiving buffer is increased, and the sending end is notified that the amount of data that can be received is increased.
The following explanation is made with reference to the drawings:
referring to fig. 4, fig. 4 is a first schematic view of a request flow of an embodiment of a buffer window adjusting method according to the present invention, in this embodiment, a client sends request information to a server, where a load balancing device includes a TCP client, an agent, and a TCP server, the TCP server is in communication connection with the client, and the TCP client is in communication connection with the server.
The process of the client sending the request information to the server can comprise the following steps: the client sends request information to a TCP server connected with the client, the TCP server receives the client request information and stores the client request information in a receiving buffer of the TCP server, an agent analyzes and forwards the client request information and sends the client request information to a sending buffer of the TCP client, at the moment, the free space of the sending buffer is reduced and changes information of the sending buffer is notified, the TCP server reduces the free space of the receiving buffer according to the changes information of the sending buffer and sends indication information for adjusting the completion of the receiving buffer, the TCP client sends the request information to a server, when receiving sending success information fed back by the server, the corresponding request information in the sending buffer of the TCP client is deleted, at the moment, the free space of the sending buffer is increased and notifies the change information of the sending buffer, and the TCP server increases the free space of the receiving buffer according to the change information of the sending buffer.
Referring to fig. 5, fig. 5 is a first schematic view of a response flow of an embodiment of a buffer window adjusting method according to the present invention, in this embodiment, a server sends response information to a client, where a load balancing device includes a TCP client, an agent, and a TCP server, the TCP server is in communication connection with the client, and the TCP client is in communication connection with the server.
The process of sending the response information to the client by the server may include: the server sends response data to a TCP client connected with the server, the TCP client receives the server response data and stores the server response data in a receiving buffer of the TCP client, an agent analyzes and forwards the server response data and sends the server response data to a sending buffer of the TCP server, at the moment, the free space of the sending buffer is reduced and the change information of the sending buffer is notified, the TCP client reduces the free space of the receiving buffer according to the change information of the sending buffer and sends indication information for adjusting the completion of the receiving buffer, the TCP server sends the response data to the client, when the sending success information fed back by the client is received, the corresponding response data in the sending buffer of the TCP server is deleted, at the moment, the free space of the sending buffer is increased and the change information of the sending buffer is notified, and the TCP client increases the free space of the receiving buffer according to the change information of the sending buffer.
In the process of sending the target data information to the receiving end, the size of the free space of the receiving buffer area is adjusted according to the space change information of the sending buffer area, so that data transmission at two ends of the gateway equipment is always balanced, the problem that data are cached on the gateway equipment in a large quantity is solved, the performance of the gateway equipment is improved, and the possibility of data loss is reduced.
Referring to fig. 6, fig. 6 is a flowchart illustrating a buffer window adjusting method according to a third embodiment of the present invention.
Based on the first and second embodiments, in this embodiment, the number of the transmission buffers is N, where N is an integer greater than or equal to 2;
step S104, comprising:
step S1041: and acquiring the spatial variation information of each sending buffer area.
It can be understood that, in the present embodiment, there are N receiving ends, and there is a one-to-one correspondence with N transmission buffers.
Referring to fig. 7 and fig. 7 are schematic views of a scene structure of an embodiment of a buffer window adjustment method according to the present invention, where there are 3 servers, and in a specific implementation, N servers may be N servers, where N is an integer greater than or equal to 2.
Further, in order to determine the corresponding first transmission buffer, so that the destination of the transmission data is correct, and the data forwarding is normal, before step S103, the method further includes: analyzing the destination address of the data information to obtain a destination address analysis result; determining a target sending buffer area corresponding to the destination address analysis result; accordingly, step S103 includes: and storing the target data information to the target sending buffer area.
It can be understood that the proxy decodes the data information and analyzes the destination address, determines the corresponding IP address (IP address) and Port address (Port address), and determines the corresponding TCP client according to the IP address and the Port address, thereby determining the transmission buffer connected to the receiving end.
Step S1042: and calculating total space change information according to the space change information of each sending buffer area, and taking the total space change information as first space change information.
It should be noted that, when data is stored in the corresponding multiple sending buffers, the free spaces of the multiple sending buffers decrease, and the total space change information is determined according to the space change information of all sending buffers, so as to notify the total decrease amount of the free spaces of the TCP server, so that the receiving buffer corresponding to the TCP server adjusts the size of the receiving buffer according to the total decrease amount of the free spaces.
Accordingly, step S204 includes:
step S2041: and acquiring the spatial variation information of each sending buffer area.
It can be understood that after the data transmission is completed, the data corresponding to the multiple sending buffers is deleted, the free space of the multiple sending buffers is increased, and the total space change information is determined according to the space change information of all the sending buffers.
Step S2042: and calculating total space change information according to the space change information of each sending buffer area, and taking the total space change information as second space change information.
It should be noted that the TCP client notifies the TCP server of the total increase of the free space, so that the receiving buffer corresponding to the TCP server adjusts the size of the receiving buffer according to the total increase of the free space.
It can be understood that, when a client sends request information to a plurality of servers through a gateway device at the same time, a proxy processes the request information received by a TCP server through analysis, encapsulation, forwarding and the like, obtains each server corresponding to the request information and each sending buffer connected with each server according to destination address analysis, sends the processed data to the corresponding TCP client one by one, each TCP client stores the data in the corresponding sending buffer to wait for sending, each TCP client obtains spatial variation information of the corresponding sending buffer and feeds the spatial variation information back to the proxy and the TCP server, and the gateway device calculates total spatial variation information according to the spatial variation information. The TCP server side adjusts the size of the free space of the receiving buffer area connected with the client side according to the total space change information, and can prevent excessive data from being transmitted to the load balancing equipment by the client side.
The following is illustrated by way of example in the accompanying drawings:
referring to fig. 8, fig. 8 is a second schematic diagram of a request flow of an embodiment of a buffer window adjustment method according to the present invention, where a sending end is a client and a receiving end is multiple servers. The process of the client sending the request information to the plurality of servers may include:
the client sends request information to a TCP server connected with the client, the TCP server receives the client request information and stores the client request information in a receiving buffer area of the TCP server, an agent analyzes and forwards the client request information and sends a request to a designated server n, the free space of the sending buffer area corresponding to the server n is reduced and changes information of the sending buffer area is notified, the agent calculates total change information of all sending buffer areas connected with the server according to the change information of all the sending buffer areas, the TCP server reduces the free space of the receiving buffer area according to the total change information and sends indication information for adjusting the completion of the receiving buffer area, a plurality of TCP clients send the request information to a plurality of servers, when the sending success information fed back by the server is received, the corresponding request information in the sending buffer areas of the plurality of TCP clients is deleted, at the moment, the free space of the sending buffer area is increased and the change information of the sending buffer area is notified, the agent calculates the total change information of all the sending buffer areas connected with the server according to the change information of all the sending buffer areas, and the TCP server increases the buffer space of the receiving buffer area according to the total change information of the receiving buffer area.
According to the embodiment, when the sending end sends information to the multiple receiving ends, the total space change information is calculated according to the space change information of the sending buffer area corresponding to each receiving end, the size of the sending buffer area is adjusted through the total space change information, the problem that when data are not transmitted to the corresponding receiving ends, the sending end sends too much data, and a large amount of data are cached on the gateway equipment is avoided, so that data transmission at two ends of the gateway equipment is always balanced, the problem that the data are cached on the gateway equipment in a large amount is solved, the performance of the gateway equipment is improved, and meanwhile, the possibility of data loss is reduced.
Referring to fig. 9, fig. 9 is a flowchart illustrating a buffer window adjusting method according to a fourth embodiment of the present invention.
Based on the first and second embodiments, in this embodiment, the number of the sending ends is N, the number of the receiving buffers is N, and N is an integer greater than or equal to 2;
accordingly, step S101 includes:
step S1011: taking data information to be sent out of an ith receiving buffer area, wherein i is more than or equal to 1 and less than or equal to N;
it should be noted that, in this embodiment, N sending ends are provided and correspond to the receiving buffer areas one to one, the sending end is a server, and the receiving end is a client, and when multiple sending ends send data, multiple pieces of data information to be sent are taken out from the receiving buffer areas corresponding to the multiple sending ends.
Step S201, including:
step S2011: and adjusting the size of the free space of the ith receiving buffer area according to the first space change information.
It can be understood that the first space change information may include an amount of reduction of the free space of the sending buffer corresponding to the TCP server, and the agent determines an amount of reduction of the free space of each receiving buffer according to the amount of reduction of the free space of the sending buffer, so as to reduce the free space of each receiving buffer according to each amount of reduction of the free space.
Accordingly, step S205 includes:
step S2051: and determining a receiving buffer area from which the successfully transmitted data comes according to the second space change information so as to determine the receiving buffer area to be adjusted and adjust the space size.
It should be noted that the second space change information may include an amount of increase in free space of a sending buffer corresponding to the TCP server, and the agent determines a receiving buffer to be adjusted and an adjustment space size according to the amount of increase in free space of the sending buffer, that is, determines the receiving buffer to be adjusted and a corresponding amount of increase. Specifically, it needs to record and determine which receiving buffer area each data comes from in advance, and then after the data is successfully transmitted, based on the successful data source, correspondingly increase the corresponding receiving buffer area, and adjust the space size to the size of the successfully transmitted data.
Step S2052: and adjusting the space size of the receiving buffer area according to the determined receiving buffer area to be adjusted and the adjustment space size.
The following is illustrated by way of example in the accompanying drawings:
referring to fig. 10, fig. 10 is a second schematic diagram of a response flow of an embodiment of the buffer window adjustment method of the present invention, where a sending end is a plurality of servers and a receiving end is a client. The process of the plurality of servers sending the reply data to the client may include:
the server n sends response data to a TCP client n connected with the server, the TCP client n receives the server response data and stores the server response data in a receiving buffer area of the TCP client n, an agent analyzes and forwards the server response data and sends the server response data to the sending buffer area of the TCP server, at the moment, the idle space of the sending buffer area is reduced, the change information of the sending buffer area is recorded and the change information of the sending buffer area is notified, the agent determines the idle space reduction amount of the receiving buffer area corresponding to the server n according to the change information of the sending buffer area, the TCP client reduces the idle space of the receiving buffer area according to the idle space reduction amount and sends indication information for adjusting the completion of the receiving buffer area, the TCP server sends the response data to the client, when the sending success information fed back by the client is received, the corresponding response data in the sending buffer area of the TCP server is deleted, at the moment, the idle space of the sending buffer area is increased and notifies the change information of the sending buffer area, the agent calculates the TCP client and notification information needed to the client to notify according to the change information of the recorded in the transmitting buffer area, and the client needed to notify the change information of the TCP client.
This embodiment provides when a plurality of sending ends send information to the receiving end, confirm the receiving buffer area of adjustment and adjustment space size through the space change information according to the sending buffer area that the receiving end corresponds, thereby adjust the space size of receiving buffer area, avoided when data do not transmit to the receiving end, a plurality of sending ends continuously send too much data, lead to a large amount of data to be cached on gateway equipment, make the data transmission at gateway equipment both ends remain balanced all the time, solve the problem that data are cached on gateway equipment by a large amount, thereby promote gateway equipment performance and reduce, the possibility that data lost has been reduced simultaneously.
In addition, an embodiment of the present invention further provides a storage medium, where a buffer window adjustment program is stored on the storage medium, and the buffer window adjustment program, when executed by a processor, implements the steps of the buffer window adjustment method described above.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent structures or equivalent processes performed by the present invention or directly or indirectly applied to other related technical fields are also included in the scope of the present invention.

Claims (10)

1. A buffer window adjusting method is applied to gateway equipment and is characterized in that the gateway equipment comprises a receiving buffer and a sending buffer, wherein the receiving buffer is used for caching data sent by a sending end, and the sending buffer is used for caching data sent to a receiving end;
the buffer window adjusting method comprises the following steps:
acquiring space change information of the sending buffer area, wherein the space change information comprises an idle space increase amount and an idle space decrease amount, and when data are stored in the sending buffer area or the data in the sending buffer area are deleted, the idle space of the sending buffer area changes;
and adjusting the free space of the receiving buffer area according to the space change information so as to enable the storage space change trend of the receiving buffer area to be consistent with the storage space change trend of the sending buffer area.
2. The buffer window adjusting method of claim 1, wherein before the obtaining the spatial variation information of the transmission buffer, the buffer window adjusting method further comprises:
data information to be sent is taken out from the receiving buffer area;
processing the data information to be sent to obtain target data information;
storing the target data information to a sending buffer area;
correspondingly, the obtaining the spatial variation information of the sending buffer includes:
acquiring first space change information of the sending buffer area;
the adjusting the space of the receiving buffer area according to the space variation information includes:
and adjusting the size of the free space of the receiving buffer area according to the first space change information.
3. The buffer window adjusting method according to claim 2, wherein after the adjusting the size of the free space of the receiving buffer according to the first space variation information, the method further comprises:
sending the target data information to the receiving end;
when the data transmission success information is received, clearing the target data information in the sending buffer area;
acquiring second space change information of the sending buffer area;
and adjusting the size of the free space of the receiving buffer area according to the second space change information.
4. The buffer window adjusting method according to claim 3, wherein the number of the transmission buffers is N, and N is an integer greater than or equal to 2;
correspondingly, the acquiring the first spatial variation information of the transmission buffer includes:
acquiring space change information of each sending buffer area;
and calculating total space change information according to the space change information of each sending buffer area, and taking the total space change information as first space change information.
5. The buffer window adjusting method according to claim 4, wherein the obtaining the second spatial variation information of the transmission buffer comprises:
acquiring spatial variation information of each sending buffer area;
and calculating total space change information according to the space change information of each sending buffer area, and taking the total space change information as second space change information.
6. The buffer window adjusting method according to claim 3, wherein the number of the receiving buffers is N, where N is an integer greater than or equal to 2;
correspondingly, the fetching data information to be sent from the receiving buffer includes:
taking data information to be sent out of an ith receiving buffer area, wherein i is more than or equal to 1 and less than or equal to N;
the adjusting the size of the free space of the receiving buffer according to the first space variation information includes:
and adjusting the size of the free space of the ith receiving buffer area according to the first space change information.
7. The buffer window adjusting method according to claim 6, wherein the adjusting the size of the free space of the receiving buffer according to the second space variation information comprises:
determining a receiving buffer area from which the successfully transmitted data comes according to the second space change information so as to determine the receiving buffer area to be adjusted and adjust the size of the space;
and adjusting the space size of the receiving buffer area according to the determined receiving buffer area to be adjusted and the adjusted space size.
8. The buffer window adjusting method according to any one of claims 3 to 6, wherein the sending the target data information to the receiving end comprises:
and when receiving the indication information of successful adjustment of the receiving buffer, sending the target data information to a receiving end.
9. A gateway device, characterized in that the device comprises: memory, a processor and a buffer window adjustment program stored on the memory and executable on the processor, the buffer window adjustment program being configured to implement the steps of the buffer window adjustment method according to any of claims 1 to 8.
10. A storage medium having stored thereon a buffer window adjustment program, which when executed by a processor implements the steps of the buffer window adjustment method according to any one of claims 1 to 8.
CN202011588275.3A 2020-12-28 2020-12-28 Buffer window adjusting method, gateway device and storage medium Active CN112583935B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011588275.3A CN112583935B (en) 2020-12-28 2020-12-28 Buffer window adjusting method, gateway device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011588275.3A CN112583935B (en) 2020-12-28 2020-12-28 Buffer window adjusting method, gateway device and storage medium

Publications (2)

Publication Number Publication Date
CN112583935A CN112583935A (en) 2021-03-30
CN112583935B true CN112583935B (en) 2022-11-22

Family

ID=75143849

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011588275.3A Active CN112583935B (en) 2020-12-28 2020-12-28 Buffer window adjusting method, gateway device and storage medium

Country Status (1)

Country Link
CN (1) CN112583935B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113179327B (en) * 2021-05-14 2023-06-02 中兴通讯股份有限公司 High concurrency protocol stack unloading method, equipment and medium based on large-capacity memory

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357147A (en) * 2015-11-30 2016-02-24 北京控制工程研究所 High-speed and high-reliability network-on-chip adapter unit

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3782308B2 (en) * 2001-02-15 2006-06-07 三菱電機株式会社 DATA DISTRIBUTION MANAGEMENT DEVICE, DATA DISTRIBUTION MANAGEMENT SYSTEM AND DATA DISTRIBUTION MANAGEMENT METHOD USING THE SAME, AND PROGRAM FOR CAUSING COMPUTER TO EXECUTE THE METHOD
US8782221B2 (en) * 2012-07-05 2014-07-15 A10 Networks, Inc. Method to allocate buffer for TCP proxy session based on dynamic network conditions
US9769288B2 (en) * 2013-04-06 2017-09-19 Citrix Systems, Inc. Systems and methods for dynamic receive buffering
CN107318107A (en) * 2017-07-31 2017-11-03 努比亚技术有限公司 Data transmission system, method, external equipment and mobile terminal
CN108199925B (en) * 2018-01-30 2021-06-04 网宿科技股份有限公司 Data sending method, receiving method and device
CN109391929B (en) * 2018-11-23 2022-02-22 深圳时空壶技术有限公司 Low-power-consumption Bluetooth data transmission method and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357147A (en) * 2015-11-30 2016-02-24 北京控制工程研究所 High-speed and high-reliability network-on-chip adapter unit

Also Published As

Publication number Publication date
CN112583935A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
JP5986654B2 (en) Enterprise client / server system and method for providing web application support through distributed emulation of web socket communications
EP3780542B1 (en) Data transmission method and device
US9264512B2 (en) Performance enhancing proxy
EP2557754B1 (en) Method for inserting and unloading tcp proxy and service gateway device
US8131823B2 (en) System and method for reading ahead of content
KR100779751B1 (en) Method and apparatus for obtaining data information
US11876716B2 (en) Systems and methods for adjusting a congestion window value of a content delivery network
JP2004516693A (en) Selection of communication contents based on automatic detection of communication bandwidth
US20040111492A1 (en) Access relaying apparatus
CN112583874B (en) Message forwarding method and device of heterogeneous network
US20020165973A1 (en) Adaptive transport protocol
KR20130082070A (en) Communication apparatus and communication method
EP3459221B1 (en) Multicast aggregation of multiple streaming connections
US9848067B2 (en) Managing sequence values with added headers in computing devices
CN111314237A (en) Method, device and equipment for adjusting data packet transmission rate and readable storage medium
Ehsan et al. Evaluation of performance enhancing proxies in internet over satellite
CN112583935B (en) Buffer window adjusting method, gateway device and storage medium
US8516069B1 (en) Optimizer-to-link layer interface using dynamic buffering
CN111372283A (en) Congestion control method, base station and user plane functional entity
CN111314447B (en) Proxy server and method for processing access request thereof
EP1515513A1 (en) System and method for real-time data distribution using UDP
CN105230074B (en) Video cache switching handling method, device and system
CN106095559A (en) Based on mobile terminal data proxy data acclerating section streaming system and method
WO2024060915A1 (en) Core network data transmission method, electronic device, and computer-readable storage medium
US20240146658A1 (en) Systems and methods for adjusting a congestion window value of a content delivery network

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
GR01 Patent grant
GR01 Patent grant