A flow balancing method, system, device and computer-readable storage medium

Through real-time monitoring and adjustment of network card ports, the problem of traffic imbalanced network card ports on the NFS server side is solved, automated traffic balance is achieved, and bandwidth utilization and user experience is improved.

CN116170449BActive Publication Date: 2025-08-26LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310183439.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2025-08-26
Estimated Expiration
2043-02-24

AI Technical Summary

Technical Problem

When multiple network card ports are configured on the NFS server and the number of clients is small, the network card port traffic is unbalanced, resulting in halving of network bandwidth performance. The existing technology is balanced by increasing the number of TCP links, but increasing the equipment is cumbersome and impractical.

Method used

By monitoring each network card port in real time during data transmission between the server and the client, we can determine whether the current target network card port and the last used network card port, and adjust the target network card port when it is repeated until it is different. The client service termination thread is used to control the client service to terminate and remount it to determine the new target network card port.

Benefits of technology

It realizes the avoidance of reuse of the same network card port when there are fewer clients, and automatically completes traffic equalization, improving bandwidth utilization and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116170449B_ABST
    Figure CN116170449B_ABST
Patent Text Reader

Abstract

The present application discloses a traffic balancing method, system, device and computer-readable storage medium, which relate to the field of data transmission. In this solution, when the server and the client perform data transmission through the network card port, each network card port is monitored in real time; it is determined whether the target network card port for the current data transmission is the same as the network card port used last time; if so, the target network card port is adjusted until the target network card port is different from the network card port used last time. It can be seen that the method in this application can avoid the reuse of the same network card port, so that even when there are fewer clients, the balance of network card port traffic can be achieved, avoiding insufficient bandwidth utilization, and the entire process is completed automatically, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data transmission, and in particular to a traffic balancing method, system, device, and computer-readable storage medium. Background Art

[0002] When using an NFS (Network File System) server, client programs connect to the NFS server through network card port configuration to perform business reading and writing. If the NFS server is configured with more than one network card port and the number of client programs is small, traffic will be unbalanced between the network card ports. For example, if there is only one client, a corresponding TCP (Transmission Control Protocol) link selects a network card port through calculation when sending traffic. After that, the TCP link will always send and receive traffic on this network card port. Similarly, if there are two clients, two TCP links are used to receive traffic. Because the selection of network card ports by TCP links has a certain degree of randomness, it is possible that two TCP links will receive and send traffic from the same network card port. In this case, the NFS server is equivalent to using one network card port to receive and process traffic from two clients, while the other network card port is idle. As a result, the network bandwidth cannot achieve its actual performance, and the performance is halved.

[0003] The existing technology can only address the above technical issues by increasing the number of TCP connections, thereby maximizing the balance of network port selections across all connections. Consequently, the more TCP connections, the more balanced the results. However, increasing TCP connections is equivalent to increasing the number of clients, which means adding physical devices. In general, adding multiple devices is not permitted. Furthermore, adding multiple client devices is cumbersome. Summary of the Invention

[0004] The purpose of this application is to provide a traffic balancing method, system, device and computer-readable storage medium, which can avoid the repeated use of the same network card port, so that even when there are fewer clients, the network card port traffic can be balanced, avoiding insufficient bandwidth utilization, and the entire process is completed automatically, thereby improving the user experience.

[0005] To solve the above technical problems, this application provides a traffic balancing method, including:

[0006] When the server and the client perform data transmission via the network card port, each of the network card ports is monitored in real time;

[0007] Determine whether the target network card port for current data transmission is the same as the network card port used last time;

[0008] If so, the target network card port is adjusted until the target network card port is different from the network card port used last time.

[0009] Preferably, when the server and the client are transmitting data via the network card ports, each of the network card ports is monitored in real time, including:

[0010] Establishing a link between the server and the client, and obtaining feature information corresponding to the link;

[0011] Each of the network card ports is monitored to determine the target network card port that is currently transmitting the characteristic information.

[0012] Preferably, the characteristic information includes one or more combinations of source IP, destination IP, source port and destination port.

[0013] Preferably, monitoring each of the network card ports to determine the target network card port currently transmitting the characteristic information includes:

[0014] Monitoring the characteristic messages of each of the network card ports to determine whether each of the network card ports sends the characteristic messages;

[0015] The network card port that sends the characteristic message is used as the target network card port.

[0016] Preferably, monitoring each of the network card ports includes:

[0017] Start a sniffing thread to monitor each of the network card ports.

[0018] Preferably, adjusting the target network card port includes:

[0019] The client's service is controlled to terminate, and the client is re-mounted on the server to re-determine the target network card port.

[0020] Preferably, adjusting the target network card port includes:

[0021] The client's service termination is controlled by a sniffing thread, and notification information is output to the client, so that the client is remounted to the server to re-determine the target network card port.

[0022] To solve the above technical problems, the present application also provides a flow balancing system, comprising:

[0023] A monitoring unit, configured to monitor each of the network card ports in real time when the server and the client are transmitting data through the network card ports;

[0024] A judging unit, configured to judge whether a target network card port currently performing data transmission is the same as a network card port used last time;

[0025] The execution unit is configured to adjust the target network card port when the target network card port currently performing data transmission is the same as the network card port used last time, until the target network card port is different from the network card port used last time.

[0026] Preferably, the monitoring unit includes:

[0027] a characteristic information acquisition unit, configured to establish a link between the server and the client, and acquire characteristic information corresponding to the link;

[0028] The sub-monitoring unit is used to monitor each of the network card ports to determine the target network card port that is currently transmitting the characteristic information.

[0029] Preferably, the characteristic information includes one or more combinations of source IP, destination IP, source port and destination port.

[0030] Preferably, the sub-monitoring unit includes:

[0031] A message identification unit, configured to monitor the characteristic messages of each of the network card ports to determine whether each of the network card ports sends a characteristic message;

[0032] The determining unit is configured to use the network card port that sends the characteristic message as the target network card port.

[0033] Preferably, the sub-monitoring unit is specifically used for:

[0034] Start a sniffing thread to monitor each of the network card ports.

[0035] Preferably, the execution unit is specifically used for:

[0036] The client's service is controlled to terminate, and the client is re-mounted on the server to re-determine the target network card port.

[0037] Preferably, the execution unit is specifically used for:

[0038] The client's service termination is controlled by a sniffing thread, and notification information is output to the client, so that the client is remounted to the server to re-determine the target network card port.

[0039] To solve the above technical problems, the present application also provides a flow balancing device, comprising:

[0040] memory for storing computer programs;

[0041] A processor, configured to implement the steps of the traffic balancing method described above when executing a computer program:

[0042] When the server and the client perform data transmission via the network card port, each of the network card ports is monitored in real time;

[0043] Determine whether the target network card port for current data transmission is the same as the network card port used last time;

[0044] If so, the target network card port is adjusted until the target network card port is different from the network card port used last time.

[0045] Preferably, when the server and the client are transmitting data via the network card ports, each of the network card ports is monitored in real time, including:

[0046] Establishing a link between the server and the client, and obtaining feature information corresponding to the link;

[0047] Each of the network card ports is monitored to determine the target network card port that is currently transmitting the characteristic information.

[0048] Preferably, the characteristic information includes one or more combinations of source IP, destination IP, source port and destination port.

[0049] Preferably, monitoring each of the network card ports to determine the target network card port currently transmitting the characteristic information includes:

[0050] Monitoring the characteristic messages of each of the network card ports to determine whether each of the network card ports sends the characteristic messages;

[0051] The network card port that sends the characteristic message is used as the target network card port.

[0052] Preferably, monitoring each of the network card ports includes:

[0053] Start a sniffing thread to monitor each of the network card ports.

[0054] Preferably, adjusting the target network card port includes:

[0055] The client's service is controlled to terminate, and the client is re-mounted on the server to re-determine the target network card port.

[0056] Preferably, adjusting the target network card port includes:

[0057] The client's service termination is controlled by a sniffing thread, and notification information is output to the client, so that the client is remounted to the server to re-determine the target network card port.

[0058] To solve the above technical problems, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the traffic balancing method described above are implemented:

[0059] When the server and the client perform data transmission via the network card port, each of the network card ports is monitored in real time;

[0060] Determine whether the target network card port for current data transmission is the same as the network card port used last time;

[0061] If so, the target network card port is adjusted until the target network card port is different from the network card port used last time.

[0062] Preferably, when the server and the client are transmitting data via the network card ports, each of the network card ports is monitored in real time, including:

[0063] Establishing a link between the server and the client, and obtaining feature information corresponding to the link;

[0064] Each of the network card ports is monitored to determine the target network card port that is currently transmitting the characteristic information.

[0065] Preferably, the characteristic information includes one or more combinations of source IP, destination IP, source port and destination port.

[0066] Preferably, monitoring each of the network card ports to determine the target network card port currently transmitting the characteristic information includes:

[0067] Monitoring the characteristic messages of each of the network card ports to determine whether each of the network card ports sends the characteristic messages;

[0068] The network card port that sends the characteristic message is used as the target network card port.

[0069] Preferably, monitoring each of the network card ports includes:

[0070] Start a sniffing thread to monitor each of the network card ports.

[0071] Preferably, adjusting the target network card port includes:

[0072] The client's service is controlled to terminate, and the client is re-mounted on the server to re-determine the target network card port.

[0073] Preferably, adjusting the target network card port includes:

[0074] The client's service termination is controlled by a sniffing thread, and notification information is output to the client, so that the client is remounted to the server to re-determine the target network card port.

[0075] The present application provides a traffic balancing method, which relates to the field of data transmission. In this solution, when the server and the client transmit data through the network card port, each network card port is monitored in real time; it is determined whether the target network card port for the current data transmission is the same as the network card port used last time; if so, the target network card port is adjusted until the target network card port is different from the network card port used last time. It can be seen that the method in this application can avoid the reuse of the same network card port, so that even when there are fewer clients, the balance of network card port traffic can be achieved, avoiding insufficient bandwidth utilization, and the entire process is completed automatically, thereby improving the user experience.

[0076] The present application also provides a flow balancing system, device, and computer-readable storage medium, which have the same beneficial effects as the flow balancing method described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0078] Figure 1 A flow chart of a flow balancing method provided in this application;

[0079] Figure 2 A structural block diagram of a flow balancing system provided in this application;

[0080] Figure 3 This is a structural block diagram of a flow balancing device provided in this application;

[0081] Figure 4 This is a structural block diagram of a computer-readable storage medium provided in this application. DETAILED DESCRIPTION

[0082] The core of this application is to provide a traffic balancing method, system, device and computer-readable storage medium, which can avoid the repeated use of the same network card port, so that even when there are fewer clients, the network card port traffic can be balanced, avoiding insufficient bandwidth utilization. The entire process is completed automatically, improving the user experience.

[0083] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0084] Please refer to Figure 1 , Figure 1 A flow chart of a flow balancing method provided in this application, the method comprising:

[0085] S11: When the server and the client are transmitting data through the network card port, each network card port is monitored in real time;

[0086] Specifically, when a client is mounted on a server, data is exchanged through the network card port to ensure the normal operation of the client program. If the number of mounted clients is small, there may be a situation where the client only transmits data through one or several network card ports, resulting in uneven traffic on the network card ports.

[0087] To avoid the above situation, when the client is mounted on the server for data transmission, this application monitors each network card port when the client selects the network card port to determine which network card port the client selects so as to perform subsequent traffic balancing.

[0088] As a preferred embodiment, monitoring each network card port includes:

[0089] Start the sniffing thread to monitor each network card port.

[0090] In a specific embodiment, the method of monitoring each network card port in the present application is: monitoring through a sniffing thread.

[0091] Of course, other implementations are also possible and are not limited to the above examples, and this application does not make any special limitations here.

[0092] S12: Determine whether the target network card port for current data transmission is the same as the network card port used last time;

[0093] Since there is a certain degree of randomness when selecting the network card port using a TCP link, when the number of clients is small, the probability of selecting the same network card port twice in a row is higher. For example, when there are only two network card ports, the probability of selecting each network card port each time is 0.5, and the probability of selecting the same network card port twice in a row is 0.5*0.5=0.25, which is still a relatively high probability.

[0094] Therefore, when monitoring the target network card port for current data transmission, it is necessary to determine whether the target network card port is the same as the network card port used last time, so as to determine whether the same network card port is selected twice in a row. If the same network card port is used, the current network card port can be adjusted to avoid traffic imbalance.

[0095] It should be noted that the target network card port for data transmission described in this application refers to the target network card port currently selected by the client for data transmission, and does not necessarily refer to the current normal data transmission process. The last used network card port also refers to the network card port that the client program last used for data transmission.

[0096] As a preferred embodiment, when the server and the client transmit data through the network card port, each network card port is monitored in real time, including:

[0097] Establish a link between the server and the client, and obtain feature information corresponding to the link;

[0098] Monitor each network card port to determine the target network card port of the current transmission characteristic information.

[0099] In a specific embodiment, the specific implementation method of monitoring each network card port is: by identifying the characteristic information transmitted by the network card port, and identifying the port with the monitored characteristic information as the target network card port.

[0100] Specifically, the principle is as follows: when the client is mounted to the server, the corresponding characteristic information is output for hash calculation to randomly select a network card port. After that, the TCP connection will always send and receive data based on this network card port, which has data containing the characteristic information. Therefore, in this application, it is only necessary to monitor whether each network card port contains information containing the characteristic information. If it does, then the network card port is determined to be the target network card port.

[0101] As a preferred embodiment, the characteristic information includes one or more combinations of source IP, destination IP, source port and destination port.

[0102] In a specific embodiment, the characteristic information includes the source IP, destination IP, source port and destination port. At this time, the complete steps for identifying the characteristic information are: after establishing a connection session between the client and the server, record the source IP, destination IP, source port and destination port of the connection (that is, the TCP link), and then use the characteristic information of the source IP, destination IP, source port and destination port as filtering conditions to monitor the traffic of each network card.

[0103] As a preferred embodiment, monitoring each network card port to determine the target network card port for currently transmitting characteristic information includes:

[0104] Monitor the characteristic messages of each network card port to determine whether each network card port sends characteristic messages;

[0105] The network card port that sends the signature message is used as the target network card port.

[0106] Specifically, the specific method of monitoring the characteristic information of each network card port is: monitoring the characteristic message sent by each network card port, and taking the network card port that sends the characteristic message as the target network card port.

[0107] Specifically, after recording the characteristic information of the source IP, destination IP, source port, and destination port of the connection, the sniffing thread is started to complete the sniffing of the characteristic information. The sniffing thread will use the libpcap library to send the characteristic information of the source IP, destination IP, source port, and destination port as filtering conditions to monitor the traffic of each network card port. Among them, Libpcap is a user-state library that can copy a characteristic message before the characteristic message of the network card port enters the kernel protocol stack and pass it to the user-state caller. If all messages are not needed, the characteristic message that you want can be filtered and copied by sending filtering conditions. This sniffing thread monitors the characteristic messages of different network card ports. If a message is sent up, it can be considered that the TCP link is received on the network card port, and the characteristic message will not be sniffed from multiple network card ports at the same time (because the TCP link will only randomly select one network card port during a data transmission).

[0108] S13: If yes, adjust the target network card port until the target network card port is different from the network card port used last time.

[0109] Specifically, if the above monitoring and judgment determine that the target network card port is the same as the last used network card port, it does not conform to the design concept of traffic balancing in this application. Therefore, in this application, the target network card port will be adjusted until the adjusted network card port is different from the last used network card port.

[0110] The above is only one implementation method of the balanced traffic provided by this application, which can be, but is not limited to, adjusting the target network card port to be different from the network card port used last time. As a preferred embodiment, multiple network card ports can be adjusted so that they take turns as the target network card port according to preset rules. For example, they take turns as the target network card port, etc. However, considering that the client's selection of the target network card port has a certain degree of randomness, if there is a designated network card port each time, the matching time may be longer. Therefore, taking all factors into consideration, in this application, it is only necessary to ensure that the adjusted target network card port is different from the network card port used last time.

[0111] As a preferred embodiment, adjusting the target network card port includes:

[0112] Control the client's business termination and re-mount the client to the server to re-determine the target network card port.

[0113] Furthermore, when adjusting the target network card port, the specific measures are as follows: controlling the termination of the client's service, controlling the client to be uninstalled from the server, and remounting it, thereby re-establishing the link and re-entering the step of selecting the network card port. At this time, the selected network card port may be different from the network card port used last time, or it may still be the same as the network card port used last time. If it is still the same, then re-entering the step of controlling the termination of the client's service and remounting the client to the server to re-determine the target network card port until the selected network card port is different from the network card port used last time; otherwise, directly ending the port selection step and entering the step of transmitting data through this target network card port.

[0114] As a preferred embodiment, adjusting the target network card port includes:

[0115] The client's business is terminated by controlling the sniffing thread, and a notification message is output to the client so that the client can be re-mounted to the server to re-determine the target network card port.

[0116] Specifically, the specific method of controlling the termination of the client's business is: directly controlling the termination of the client's business program through the sniffer program, and then the sniffer program outputs a notification message to the client, so that the client can uninstall and remount the server according to this notification message, thereby entering the step of re-determining the target network card port.

[0117] The above is only one implementation method provided by this embodiment, and is not limited to the above example. This application does not make any special limitations here.

[0118] In summary, this application provides a traffic balancing method that monitors each network card port in real time when the server and client are transmitting data through the network card port; determines whether the target network card port for the current data transmission is the same as the network card port used last time; if so, adjusts the target network card port until the target network card port is different from the network card port used last time. It can be seen that the method in this application can avoid the reuse of the same network card port, so that even when there are fewer clients, the network card port traffic can be balanced, avoiding insufficient bandwidth utilization. The entire process is completed automatically, improving the user experience.

[0119] In order to solve the above technical problems, this application also provides a flow balancing system, please refer to Figure 2 , Figure 2 This is a structural block diagram of a flow balancing system provided in this application, which includes:

[0120] The monitoring unit 21 is used to monitor each network card port in real time when the server and the client are transmitting data through the network card port;

[0121] The judging unit 22 is used to judge whether the target network card port for current data transmission is the same as the network card port used last time;

[0122] The execution unit 23 is configured to adjust the target network card port when the target network card port for current data transmission is the same as the network card port used last time, until the target network card port is different from the network card port used last time.

[0123] As a preferred embodiment, the monitoring unit includes:

[0124] A feature information acquisition unit, configured to establish a link between the server and the client, and acquire feature information corresponding to the link;

[0125] The sub-monitoring unit is used to monitor each network card port to determine the target network card port for currently transmitting characteristic information.

[0126] As a preferred embodiment, the characteristic information includes one or more combinations of source IP, destination IP, source port and destination port.

[0127] As a preferred embodiment, the sub-monitoring unit includes:

[0128] The message identification unit is used to monitor the characteristic messages of each network card port to determine whether each network card port sends a characteristic message;

[0129] The determining unit is used to use the network card port that sends the characteristic message as the target network card port.

[0130] As a preferred embodiment, the sub-monitoring unit is specifically used for:

[0131] Start the sniffing thread to monitor each network card port.

[0132] As a preferred embodiment, the execution unit is specifically configured to:

[0133] Control the client's business termination and re-mount the client to the server to re-determine the target network card port.

[0134] As a preferred embodiment, the execution unit is specifically configured to:

[0135] The client's business is terminated by controlling the sniffing thread, and a notification message is output to the client so that the client can be re-mounted to the server to re-determine the target network card port.

[0136] For an introduction to the flow balancing system, please refer to the above embodiments, which will not be described in detail in this application.

[0137] In order to solve the above technical problems, this application also provides a flow balancing device, please refer to Figure 3 , Figure 3 This is a structural block diagram of a flow balancing device provided in this application, which includes:

[0138] memory for storing computer programs;

[0139] A processor, configured to implement the steps of the above-mentioned traffic balancing method when executing a computer program:

[0140] When the server and client are transmitting data through the network card port, each network card port is monitored in real time;

[0141] Determine whether the target network card port for current data transmission is the same as the network card port used last time;

[0142] If so, the target network card port is adjusted until the target network card port is different from the network card port used last time.

[0143] As a preferred embodiment, when the server and the client transmit data through the network card port, each network card port is monitored in real time, including:

[0144] Establish a link between the server and the client, and obtain feature information corresponding to the link;

[0145] Monitor each network card port to determine the target network card port of the current transmission characteristic information.

[0146] As a preferred embodiment, the characteristic information includes one or more combinations of source IP, destination IP, source port and destination port.

[0147] As a preferred embodiment, monitoring each network card port to determine the target network card port for currently transmitting characteristic information includes:

[0148] Monitor the characteristic messages of each network card port to determine whether each network card port sends characteristic messages;

[0149] The network card port that sends the signature message is used as the target network card port.

[0150] As a preferred embodiment, monitoring each network card port includes:

[0151] Start the sniffing thread to monitor each network card port.

[0152] As a preferred embodiment, adjusting the target network card port includes:

[0153] Control the client's business termination and re-mount the client to the server to re-determine the target network card port.

[0154] As a preferred embodiment, adjusting the target network card port includes:

[0155] The client's business is terminated by controlling the sniffing thread, and a notification message is output to the client so that the client can be re-mounted to the server to re-determine the target network card port.

[0156] For an introduction to the flow balancing device, please refer to the above embodiments, which will not be described in detail in this application.

[0157] In order to solve the above technical problems, the present application also provides a computer readable storage medium 40, please refer to Figure 4 , Figure 4 This is a structural block diagram of a computer-readable storage medium provided in the present application. The computer-readable storage medium 40 stores a computer program 41. When the computer program is executed by a processor, the steps of the above-mentioned traffic balancing method are implemented:

[0158] When the server and client are transmitting data through the network card port, each network card port is monitored in real time;

[0159] Determine whether the target network card port for current data transmission is the same as the network card port used last time;

[0160] If so, the target network card port is adjusted until the target network card port is different from the network card port used last time.

[0161] As a preferred embodiment, when the server and the client transmit data through the network card port, each network card port is monitored in real time, including:

[0162] Establish a link between the server and the client, and obtain feature information corresponding to the link;

[0163] Monitor each network card port to determine the target network card port of the current transmission characteristic information.

[0164] As a preferred embodiment, the characteristic information includes one or more combinations of source IP, destination IP, source port and destination port.

[0165] As a preferred embodiment, monitoring each network card port to determine the target network card port for currently transmitting characteristic information includes:

[0166] Monitor the characteristic messages of each network card port to determine whether each network card port sends characteristic messages;

[0167] The network card port that sends the signature message is used as the target network card port.

[0168] As a preferred embodiment, monitoring each network card port includes:

[0169] Start the sniffing thread to monitor each network card port.

[0170] As a preferred embodiment, adjusting the target network card port includes:

[0171] Control the client's business termination and re-mount the client to the server to re-determine the target network card port.

[0172] As a preferred embodiment, adjusting the target network card port includes:

[0173] The client's business is terminated by controlling the sniffing thread, and a notification message is output to the client so that the client can be re-mounted to the server to re-determine the target network card port.

[0174] For an introduction to computer-readable storage media, please refer to the above embodiments, and this application will not go into details here.

[0175] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

[0176] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A flow balancing method, characterized in that: include: When the server and the client perform data transmission through the network card port, a link is established between the server and the client, and characteristic information corresponding to the link is obtained; The characteristic information includes one or more combinations of source IP, destination IP, source port, and destination port; Starting a sniffing thread, using the libpcap library to monitor the characteristic messages of each of the network card ports to determine whether each of the network card ports sends the characteristic messages; wherein the libpcap library copies a characteristic message before the characteristic message of the network card port enters the kernel protocol stack, and sends the characteristic information as a filtering condition to the libpcap library to determine whether each of the network card ports sends the characteristic message; The network card port that sends the characteristic message is used as the target network card port; Determine whether the target network card port for current data transmission is the same as the network card port used last time; If so, the target network card port is adjusted until the target network card port is different from the network card port used last time.

2. The flow balancing method according to claim 1, wherein: Adjusting the target network card port includes: The client's service is controlled to terminate, and the client is re-mounted on the server to re-determine the target network card port.

3. The flow balancing method according to claim 2, wherein: Adjusting the target network card port includes: The client's service termination is controlled by a sniffing thread, and notification information is output to the client, so that the client is remounted to the server to re-determine the target network card port.

4. A flow balancing system, characterized in that: include: A monitoring unit, configured to establish a link between the server and the client when the server and the client transmit data via a network card port, and obtain characteristic information corresponding to the link; The characteristic information includes one or more combinations of source IP, destination IP, source port, and destination port; Starting a sniffing thread to monitor the characteristic messages of each of the network card ports to determine whether each of the network card ports sends a characteristic message; The network card port that sends the characteristic message is used as the target network card port; A judging unit, configured to judge whether a target network card port currently performing data transmission is the same as a network card port used last time; The execution unit is configured to adjust the target network card port when the target network card port currently performing data transmission is the same as the network card port used last time, until the target network card port is different from the network card port used last time.

5. A flow balancing device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the traffic balancing method according to any one of claims 1 to 3 when storing a computer program.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the traffic balancing method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Processing method and device for network data packet and electronic equipment

    CN110022330A

  • Random load balancing method and apparatus, computer storage medium

    WO2018120814A1